下面是我的/ etc/apache2/sites_available/default文件。這個Apache安裝程序有什麼問題?
我已將mysite.com指向/ etc/hosts中的localhost,並且從運行它的同一臺機器訪問時,網站工作正常。但是,如果我得到第二臺機器,編輯其/ etc/hosts並將mysite.com指向第一臺機器,那麼apache只會提供一條通用的Not Found: The requested URL/was not found on this server
消息。 (如果我在第一臺計算機上導航到http://127.0.0.1而不是使用名稱mysite.com,則會得到完全相同的消息)沒有任何內容存入access.log或error.log,但存在other_vhosts_access.log中的內容
爲什麼發生這種情況,我該如何解決?另外,當我踢阿帕奇說它NameVirtualHost *:80 has no VirtualHosts
,萬一這是相關的。
這裏的配置文件:
<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>