VirtualHost 似乎无法正常工作

VirtualHost 似乎无法正常工作

早上好。我最近将我的 Web 服务器迁移到了新硬件和最新版本的 Apache。为了清楚起见,我之前也运行过 Apache 2。我似乎无法正常工作virtualhost。在旧服务器上,我只virtualhost设置了 1 个,用于/var/ww/prism。当我将所有内容移动到新服务器时,我可以访问 Prism 站点,但不幸的是,您尝试在其中导航的所有地方/var/www都会失败,因为它试图在 Prism 站点内查找。我通过文档发现,添加_default_:*虚拟主机应该可以解决问题。值得庆幸的是,这确实允许我直接通过 IP 访问所有其他站点,但不幸的是,现在当我输入 URL 时,我的 Prism 虚拟主机无法导航。有人在我的 httpd.conf 中看到任何明显的配置错误吗?

<Directory /var/www/employment_applicant_tracking/secure/pdf/>
Order deny,allow
Deny from all
Allow from 127.0.0.1, localhost
Allow from 172.16.0.0/20
Options none
</Directory>
<Directory /var/www/cfide/>
Order allow,deny
Allow from 172.16.0.0/20
Allow from 127
</Directory>
<Directory /var/www/CFIDE/>
Order allow,deny
Allow from 172.16.0.0/20
Allow from 127
</Directory>
<Directory /var/www/>
ErrorDocument 400 /error.html
ErrorDocument 401 /error.html
ErrorDocument 403 /error.html
ErrorDocument 404 /error.html
ErrorDocument 405 /error.html
ErrorDocument 406 /error.html
ErrorDocument 407 /error.html
ErrorDocument 408 /error.html
ErrorDocument 409 /error.html
ErrorDocument 410 /error.html
ErrorDocument 411 /error.html
ErrorDocument 412 /error.html
ErrorDocument 413 /error.html
ErrorDocument 414 /error.html
ErrorDocument 415 /error.html
ErrorDocument 500 /error.html
ErrorDocument 501 /error.html
ErrorDocument 502 /error.html
ErrorDocument 503 /error.html
ErrorDocument 504 /error.html
ErrorDocument 505 /error.html
</Directory>
NameVirtualHost 172.16.0.13:80

<VirtualHost _default_:80>
DocumentRoot /var/www
</VirtualHost>

<VirtualHost 172.16.0.13:80>
ServerName requests.mydomain.com
ServerPath /prism/
DocumentRoot /var/www/prism
</VirtualHost>

DirectoryIndex index.html index.htm index.cfm
# JRun Settings
LoadModule jrun_module /opt/coldfusion9/runtime/lib/wsconfig/1/mod_jrun22.so
<IfModule mod_jrun22.c>
    JRunConfig Verbose false
    JRunConfig Apialloc false
    JRunConfig Ignoresuffixmap false
    JRunConfig Serverstore /opt/coldfusion9/runtime/lib/wsconfig/1/jrunserver.store
    JRunConfig Bootstrap 127.0.0.1:51800
    #JRunConfig Errorurl url <optionally redirect to this URL on errors>
    #JRunConfig ProxyRetryInterval 600 <number of seconds to wait before trying to reconnect to unreachable clustered server>
    #JRunConfig ConnectTimeout 15 <number of seconds to wait on a socket connect to a jrun server>
    #JRunConfig RecvTimeout 300 <number of seconds to wait on a socket receive to a jrun server>
    #JRunConfig SendTimeout 15 <number of seconds to wait on a socket send to a jrun server>
    AddHandler jrun-handler .jsp .jws .cfm .cfml .cfc .cfr .cfswf
</IfModule>
<Files ~ ".hbmxml$">
Order allow,deny
Deny from all
</Files>

答案1

必须在 /etc/hosts 中添加条目

相关内容