我希望你能帮忙。我有一个现有的 Apache 2.2 服务器,它为我维护的网站提供服务。我正在尝试为同事添加其他网站。这样做后,当我尝试访问 URL 时,我得到以下信息:
未找到 在此服务器上未找到请求的 URL /。
这是我的 httpd-vhosts.conf 文件的摘要。我有三个新的、大致相同的主机无法正常工作。只有 NDV 和默认值有效。
NameVirtualHost *:80
<VirtualHost anycast.ns.cs.boeing.com:80>
ServerName anycast.ns.cs.boeing.com
ServerAdmin aodhan.hoffman@boeing.com
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 aodhan.hoffman@boeing.com
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 aodhan.hoffman@boeing.com
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