ソースからインストールしたApacheにモジュールを後から追加する方法
ソースからインストールしたApacheにモジュールを再起動無しで追加する方法です。
mod_soの確認
Apacheのコンパイル時にDSO(mod_so)が組み込まれていないと、この方法では追加できないので、DSOが組み込まれているか以下のコマンドを実行し手確認します。
# /usr/local/apache2/bin/httpd -l
一覧に「mod_so.c」がある事を確認してください。
無い場合は組み込まれていないので、Apacheの再コンパイルが必要です。
インストール(モジュールの追加)
>||
# cd /usr/local/src/httpd-2.2.15/src/modules/
|
上記ディレクトリ内にApache標準モジュールのソースが保存されています。
rewrite module は httpd-2.2.15/modules/mappers にありましたので、その中に移動します。
>||
# cd /usr/local/src/httpd-2.2.15/src/modules/mappers
|
Apacheのエラー:Could not reliably determine the server’s fully qualified domain name〜とメッセージが出たときの対応
Apacheを起動(再起動)した際に、
httpd: Could not reliably determine the server’s fully qualified domain name, using 127.0.0.1 for ServerName
というエラーが出る場合がある。
これは、「ServerNameに127.0.0.1を使用した、FQDN(完全に適切なドメイン名)が確定できませんでした。」という意味だそうで、Apache自体は動くのだが、エラーをそのままにしておくのは気持ちが悪いし、あとあと問題を引き起こす可能性が高い。
このエラーは、「/etc/sysconfig/network」、 「/etc/hosts」 にlocalhost以外に自分で設定したホスト名が、Apacheの設定ファイルに定義されていないために発生する。
/etc/sysconfig/network例
NETWORKING=yes NETWORKING_IPV6=yes HOSTNAME=hoge.altqua.com
/etc/hosts例
# Do not remove the following line, or various programs # that require network functionality will fail. 127.0.0.1 hoge.altqua.com localhost.localdomain localhost
と書いた場合、/etc/httpd/conf/httpd.conf のServerNameの設定にも次のように書いておく。
/etc/httpd/conf/httpd.conf
# ServerName gives the name and port that the server uses to identify itself. # This can often be determined automatically, but we recommend you specify # it explicitly to prevent problems during startup. # # If this is not set to valid DNS name for your host, server-generated # redirections will not work. See also the UseCanonicalName directive. # # If your host doesn't have a registered DNS name, enter its IP address here. # You will have to access it by its address anyway, and this will make # redirections work in a sensible way. # #ServerName www.example.com:80 ServerName hoge.altqua.com:80