我希望你能幫上忙。我有一個現有的Apache 2.2服務器,它服務於我維護的網站。我正在嘗試爲一位同事添加更多網站。完成後,當我嘗試訪問URL時,我收到以下內容:Apache 2.2 VirtualHosts URL not found
未找到請求的URL /在此服務器上未找到。
下面是我的httpd-vhosts.conf文件的摘要。我有三個新的,大致相同的主機不工作。只有NDV和默認正在工作。
NameVirtualHost *:80
<VirtualHost anycast.ns.cs.boeing.com:80>
ServerName anycast.ns.cs.boeing.com
ServerAdmin [email protected]
DocumentRoot "/opt/www/anycast"
ScriptAlias /cgi-bin "/opt/www/anycast/cgi-bin/"
ErrorLog "logs/grant_error_log"
CustomLog "logs/grant_access_log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "/opt/httpd/manual"
ServerAlias ntpm-application-01.ns.cs.boeing.com
ErrorLog "logs/error_log"
CustomLog "logs/access_log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "/opt/www/ndv/html"
ServerName ndv.web.boeing.com
ScriptAlias /cgi-bin/ "/opt/www/ndv/cgi-bin/"
ErrorLog "logs/error_log"
CustomLog "logs/access_log" common
</VirtualHost>
<Directory "/opt/www/ndv/html/" >
Options Indexes FollowSymLinks Includes
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
Order allow,deny
Allow from all
</Directory>
<Directory "/opt/www/anycast/html/" >
Options Indexes FollowSymLinks Includes
Order allow,deny
Allow from all
</Directory>
根據上面的配置,這是服務器正在看到的。
$ sudo bin/apachectl -S
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:80 is a NameVirtualHost
default server ntpm-application-01.ns.cs.boeing.com (/opt/httpd/conf/extra/httpd-vhosts.conf:30)
port 80 namevhost ntpm-application-01.ns.cs.boeing.com (/opt/httpd/conf/extra/httpd-vhosts.conf:30)
port 80 namevhost ndv.web.boeing.com (/opt/httpd/conf/extra/httpd-vhosts.conf:39)
port 80 namevhost anycast.ns.cs.boeing.com (/opt/httpd/conf/extra/httpd-vhosts.conf:48)
port 80 namevhost ntpget.ns.cs.boeing.com (/opt/httpd/conf/extra/httpd-vhosts.conf:60)
port 80 namevhost dnsdig.ns.cs.boeing.com (/opt/httpd/conf/extra/httpd-vhosts.conf:70)
Syntax OK
謝謝,我平衡了配置,它現在看起來像這樣但行爲沒有不同。 ndv仍然有效,但任播只是返回'URL not found'。由於我有索引,我期望看到一個自動索引,但它只是說'/'沒有找到。它令人驚歎。 – oddhan 2012-07-19 19:56:58
謝謝,但行爲沒有不同。 NameVirtualHost *:80 ServerName anycast.domain.com ServerAdmin [email protected]。COM 的DocumentRoot 「/選擇/網絡/泛播」 的ScriptAlias /的cgi-bin 「的/ opt/WWW /任播/的cgi-bin /」 錯誤日誌 「日誌/ grant_error_log」 的CustomLog 「日誌/ grant_access_log」 共同 虛擬主機> <目錄 「的/ opt/WWW /播/ HTML /」> 選項指標包括了FollowSymLinks令 允許,拒絕 所有 –
oddhan
2012-07-19 19:58:43
嚴正允許,只是我發現。引號真的可以在apache配置中工作嗎?我從來沒有見過。 – 2012-07-19 20:59:43