4. ウィキクローン - MoinMoin - インストールし直し

 
4.1 エラー
4.2 mod_wsgi をインストールしなおし
4.3 ウェブサーバを再起動
4.4 アクセスしてみる

4.1 エラー


http://ドメイン名/mywiki/
 にアクセスすると

 わちゃちゃ。
 エラーログには以下のように表示されていました([日時][プロセスID][クライアントの情報]は略)。


[wsgi:error] mod_wsgi (pid=5042): Failed to exec Python script file '/usr/local/www/wiki/moin.wsgi'.
[wsgi:error] mod_wsgi (pid=5042): Exception occurred processing WSGI script '/usr/local/www/wiki/moin.wsgi'.
[wsgi:error] Traceback (most recent call last):
[wsgi:error]   File "/usr/local/www/wiki/moin.wsgi", line 42, in <module>
[wsgi:error]     from MoinMoin.web.serving import make_application
[wsgi:error]   File "/usr/local/lib/python2.7/site-packages/MoinMoin/web/serving.py", line 12, in <module>
[wsgi:error]     from MoinMoin import config
[wsgi:error]   File "/usr/local/lib/python2.7/site-packages/MoinMoin/config/__init__.py", line 23
[wsgi:error]     umask = 0770
[wsgi:error]                ^
[wsgi:error] SyntaxError: invalid token
 う~む。  「[Python] SyntaxError 無効なトークン」が、回答のようです。  やっぱり、python 3.6 では動作しないようです。

4.2 mod_wsgi をインストールしなおし

 ちょっと強引ですが・・・(なのであえてメッセージまで残しておきます)。  インストール済のものを削除。

> cd /usr/ports/www/mod_wsgi4
> make deinstall
===>  Deinstalling for ap24-py36-mod_wsgi
===>   Deinstalling ap24-py36-mod_wsgi-4.6.4
Updating database digests format: 100%
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 1 packages (of 0 packages in the universe):

Installed packages to be REMOVED:
        ap24-py36-mod_wsgi-4.6.4

Number of packages to be removed: 1
[1/1] Deinstalling ap24-py36-mod_wsgi-4.6.4...
[1/1] Deleting files for ap24-py36-mod_wsgi-4.6.4: 100%
Don't forget to remove all mod_wsgi-related directives in your httpd.conf
 ports は /etc/make.conf に「DEFAULT_VERSIONS+=python=3.6 pythonr3=3.6」の記述があるので  pkg で 2.7版 をインストール

> pkg install ap24-py27-mod_wsgi-4.6.4
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 5 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        ap24-py27-mod_wsgi: 4.6.4
        py27-Babel: 2.5.3
        py27-chardet: 3.0.4
        py27-pystemmer: 1.3.0_1
        openssl-devel: 1.1.0h_2

Number of packages to be installed: 5

The process will require 34 MiB more space.
7 MiB to be downloaded.

Proceed with this action? [y/N]: y
[1/4] Fetching ap24-py27-mod_wsgi-4.6.4.txz: 100%   75 KiB  76.4kB/s    00:01
[2/4] Fetching py27-Babel-2.5.3.txz: 100%    4 MiB 203.6kB/s    00:20
[3/4] Fetching py27-chardet-3.0.4.txz: 100%  151 KiB 154.8kB/s    00:01
[4/4] Fetching openssl-devel-1.1.0h_2.txz: 100%    3 MiB 496.2kB/s    00:07
Checking integrity... done (3 conflicting)
  - py27-Babel-2.5.3 conflicts with py36-Babel-2.6.0 on /usr/local/bin/pybabel
  - py27-chardet-3.0.4 conflicts with py36-chardet-3.0.4 on /usr/local/bin/chardetect
  - openssl-devel-1.1.0h_2 conflicts with openssl-1.0.2o_4,1 on /usr/local/bin/c_rehash
Checking integrity... done (0 conflicting)
Conflicts with the existing packages have been found.
One more solver iteration is needed to resolve them.
The following 10 package(s) will be affected (of 0 checked):

Installed packages to be REMOVED:
        py36-sphinx-1.6.5_1,1
        py36-requests-2.18.4
        py36-Jinja2-2.10
        py36-chardet-3.0.4
        py36-Babel-2.6.0

New packages to be INSTALLED:
        ap24-py27-mod_wsgi: 4.6.4
        py27-Babel: 2.5.3
        py27-chardet: 3.0.4
        py27-pystemmer: 1.3.0_1

Installed packages to be REINSTALLED:
        py36-cryptography-2.1.4 (direct dependency changed: python36)

Number of packages to be removed: 5
Number of packages to be installed: 4
Number of packages to be reinstalled: 1

The operation will free 16 MiB.
329 KiB to be downloaded.

Proceed with this action? [y/N]: y
[1/1] Fetching py36-cryptography-2.1.4.txz: 100%  329 KiB 337.3kB/s    00:01
[1/10] Deinstalling py36-sphinx-1.6.5_1,1...
[1/10] Deleting files for py36-sphinx-1.6.5_1,1: 100%
[2/10] Deinstalling py36-requests-2.18.4...
[2/10] Deleting files for py36-requests-2.18.4: 100%
[3/10] Deinstalling py36-Jinja2-2.10...
[3/10] Deleting files for py36-Jinja2-2.10: 100%
[4/10] Deinstalling py36-chardet-3.0.4...
[4/10] Deleting files for py36-chardet-3.0.4: 100%
[5/10] Deinstalling py36-Babel-2.6.0...
[5/10] Deleting files for py36-Babel-2.6.0: 100%
[6/10] Installing ap24-py27-mod_wsgi-4.6.4...
[6/10] Extracting ap24-py27-mod_wsgi-4.6.4: 100%
[7/10] Installing py27-Babel-2.5.3...
[7/10] Extracting py27-Babel-2.5.3: 100%
[8/10] Installing py27-chardet-3.0.4...
[8/10] Extracting py27-chardet-3.0.4: 100%
[9/10] Installing py27-pystemmer-1.3.0_1...
[9/10] Extracting py27-pystemmer-1.3.0_1: 100%
[10/10] Reinstalling py36-cryptography-2.1.4...
[10/10] Extracting py36-cryptography-2.1.4: 100%
Message from ap24-py27-mod_wsgi-4.6.4:

============================================================================

If you want to use daemon mode you will need to make sure Apache and APR
include thread support.

For more information, see :
http://www.modwsgi.org/en/latest/user-guides/quick-configuration-guide.html

============================================================================

4.3 ウェブサーバを再起動


> service apache24 graceful
Performing sanity check on apache24 configuration:
Syntax OK
Performing a graceful restart
 この時のログ([日時][プロセスID][クライアントの情報]は略)が

 [mpm_prefork:notice]  AH00171: Graceful restart requested, doing restart
 [mpm_prefork:notice]  AH00163: Apache/2.4.34 (FreeBSD) PHP/7.2.8 mod_wsgi/4.6.4 Python/2.7 OpenSSL/1.0.2o configured -- resuming normal operations
 [core:notice]  AH00094: Command line: '/usr/local/sbin/httpd -D NOHTTPACCEPT'
 「mod_wsgi/4.6.4 Python/2.7」ってのが期待をそそる。

4.4 アクセスしてみる

 再度

http://ドメイン名/mywiki/
 にアクセスしてみます。

 おお、これでいいのかしら

 ウェブサーバのログには


[wsgi:error] 2018-08-01 13:13:19,549 INFO MoinMoin.log:151 using logging configuration read from built-in fallback in MoinMoin.log module
[wsgi:error] 2018-08-01 13:13:19,550 INFO MoinMoin.log:157 Running MoinMoin 1.9.9 release code from /usr/local/lib/python2.7/site-packages/MoinMoin
[wsgi:error] 2018-08-01 13:13:21,516 WARNING MoinMoin.log:112 /usr/local/lib/python2.7/site-packages/MoinMoin/support/werkzeug/filesystem.py:63: BrokenFilesystemWarning: Detected a misconfigured UNIX filesystem: Will use UTF-8 as filesystem encoding instead of 'US-ASCII'
[wsgi:error] 2018-08-01 13:13:21,608 INFO MoinMoin.config.multiconfig:127 using wiki config: /usr/local/www/wiki/wikiconfig.py
 と出ています。  [wsgi:error] と言いつつ。  「INFO」と「WARNING」なのでこれでいいんじゃね?  とか言いつつ。  これから先の扱い方をまだ知らないのだ。