Apache 2.4: Invalid command ‘LanguagePriority’

新規FreeBSDサーバーを構築中です。(English translation page is here.)

Apache 2.4 Webサーバーには、今までは 2.2系を使って構築していたのですが、今回は 2.4系を試してみようとしており、多言語エラーメッセージ機能をオンにするために、httpd.conf ファイルのextra/httpd-multilang-errordoc.conf 部分のコメントを外して apache を起動しました

# Multi-language error messages
Include etc/apache24/extra/httpd-multilang-errordoc.conf

そうしたら、以下のようなエラーが発生して Apache が起動しない模様。

/usr/local/etc/rc.d # ./apache24 start
Performing sanity check on apache24 configuration:
AH00526: Syntax error on line 31 of /usr/local/etc/apache24/extra/httpd-multilang-errordoc.conf:
Invalid command 'LanguagePriority', perhaps misspelled or defined by a module not included in the server configuration
Starting apache24.
AH00526: Syntax error on line 31 of /usr/local/etc/apache24/extra/httpd-multilang-errordoc.conf:
Invalid command 'LanguagePriority', perhaps misspelled or defined by a module not included in the server configuration
./apache24: WARNING: failed to start apache24

httpd-multilang-errordoc.conf ファイルなんてデフォルトのままで触ってもいないところが「Invalid command LanguagePriority」って何よ。

Apache 2.2 では特に何かを編集した記憶がないので、また 2.2から2.4で httpd.conf の書き方に変更があったのか?と、httpd-multilang-errordoc.conf ファイルの最初の方を見てみたら、書いてありました。

# Required modules: mod_alias, mod_authz_core, mod_authz_host,
# mod_include, mod_negotiation

これらのモジュールのコメントを外さないといけないようで、httpd.conf を見てみたら、mod_include と mod_negotiation がコメントされていました。

これらの行を有効にして、再度 apache の起動を掛けたところ、無事に起動しました。

/usr/local/etc/rc.d # ./apache24 start
Performing sanity check on apache24 configuration:
Syntax OK
Starting apache24.

apache 2.2 の httpd.conf をそのまま使えれば楽なのにね~。owncloud の時といい、メジャーバージョンアップって嫌いだ!

コメントを残す