以下は私の /etc/apache2/sites_available/default ファイルです。
mysite.com を /etc/hosts の localhost に指定しました。Web サイトは、実行中の同じマシンからアクセスすると正常に動作します。
ただし、2 台目のマシンを取得し、その /etc/hosts を編集して mysite.com を最初のマシンに向けると、Apache は一般的なNot Found: The requested URL / was not found on this server
メッセージしか表示しません。( mysite.com という名前を使用する代わりに、最初のマシンでhttp://127.0.0.1に移動すると、まったく同じメッセージが表示されます)
なぜこれが起こっているのですか?どうすれば修正できますか? また、Apache をキックするとNameVirtualHost *:80 has no VirtualHosts
、関連する場合に備えて と表示されます。
設定ファイルは次のとおりです。
<VirtualHost mysite.com:80>
ServerName mysite.com
ServerAdmin webmaster@mysite.com
DocumentRoot /var/www/mysite.com/public_html
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/mysite.com/public_html>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel info
ErrorLog ${APACHE_LOG_DIR}/mysite.com.error.log
CustomLog ${APACHE_LOG_DIR}/mysite.com.access.log combined
</VirtualHost>