私はUbuntu 14.10のコンピュータを持っていて、それはローカルのウェブサイトのテストに使用されています。このコンピュータには、7つのウェブサイトが設定されています。しかし、7つのうち2つにアクセスすると、自分のインデックスページではなく、Apache2 Ubuntu Default Page
が表示されます。
私の知る限りでは、7つのサイトすべてをまったく同じプロセスで立ち上げたので、この2つに何が足りないのかわかりません。また、Apacheのlogsディレクトリには、挙動不審な2つのサイトのそれぞれについて、error
とaccess
という2つのログファイルがありますが、すべて空です。Apache2`のサービスを再起動しても、エラーは発生しませんでした。何度も手順を辿ってみましたが、動作しているサイトと動作していないサイトの間に違いは見られません。
この問題を診断するには、どのようなオプションがありますか?どうにかしてエラーログをより詳細に表示させることはできませんか?どこかに参照できる別のログがありますか?
故障したサイトの一つの .conf
ファイルの例を示します。
<VirtualHost *:80>
ServerName www.local_example.com
ServerAlias local_example.com
ServerAdmin [email protected]
DocumentRoot /var/www/Websites/example.com
<Directory /var/www/Websites/example.com/>
Options Indexes FollowSymLinks MultiViews
# pcw AllowOverride None
AllowOverride All
Order allow,deny
allow from all
# This directive allows us to have apache2's default start page
# in /apache2-default/, but still have / go to the right place
# Commented out for Ubuntu
#RedirectMatch ^/$ /apache2-default/
</Directory>
ErrorLog /home/example/Apache_Logs/local_example.com_error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /home/example/Apache_Logs/local_example.com_access.log combined
ServerSignature On
</VirtualHost>
以下をお試しください。
詳細なログを有効にする。
sudo nano /etc/apache2/apache2.conf
LogLevel変数を探し、デフォルトのwarnからinfoまたはdebugに更新します。debugは最大量の出力を生成します。
# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
#
LogLevel debug
**Apache を再起動してください。
sudo service apache2 restart
Apache には、すばらしい小さな構文チェックツール
apache2ctl -t
バーチャルホスト定義のチェック
apache2ctl -S