以下は私の/ etc/apache2/sites_available/defaultファイルです。このApache設定で何が問題になっていますか?
私はmysite.comを/ etc/hostsのlocalhostに指定していますが、実行中のマシンと同じマシンからアクセスするとうまく動作します。
しかし、2番目のマシンを取得した場合は、/ etc/hostsファイルを編集してmysite.comを最初のマシンに指定し、apacheは汎用のNot Found: The requested URL/was not found on this server
メッセージを出力します。 (mysite.comという名前を使用する代わりに最初のマシンでhttp://127.0.0.1に移動した場合、全く同じメッセージが表示されます)access.logまたはerror.logには何も入れませんが、other_vhosts_access.logに何かがあります。
なぜですかこれが起こって、どのように私はそれを修正するのですか?また、Apacheを起動すると、関連する場合はNameVirtualHost *:80 has no VirtualHosts
と表示されます。私はあなたの問題はあなたの<VirtualHost mysite.com:80>
であると信じて
<VirtualHost mysite.com:80>
ServerName mysite.com
ServerAdmin [email protected]
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>