出现以下错误
环境:本地IP,192.168.1.1,建立了虚拟主机,端口1001,但访问http://192.168.1.5:1001/somefile.php,出现以下错误。此错误原因在于建立的虚拟主机指定的是127.0.0.1端口(如按照下下文中所示配置将出现此类错误,同理,如修改以下为192.168.1.1,则访问127.0.0.1:1001/somefile.php则出现同样错误)
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, 127.0.0.1 and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
——————————————————————
利用端口添加虚拟主机
1.添加监听端口Listen 1001
2.增加
<VirtualHost 127.0.0.1:1001>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "D:/AppServ/www/WWWROOT1/htdocs"
ServerName 127.0.0.1:1001
DirectoryIndex index.html index.htm index.shtml rslogin.php
Alias /cgi-bin/ "D:/AppServ/www/WWWROOT1/cgi-bin/"
</VirtualHost>
有一些选项没有添加,以下是一个网站的实例(从一虚拟主机上获取之,已做处理)
<VirtualHost 313.110.11.54>
ServerAdmin webmaster@hainan.net
DocumentRoot "/www/client/fjhh/htdocs"
<Directory /www/client/fjhh/htdocs>
<Files ~ "/.(php|php3)$">
Order allow,deny
Deny from all
</Files>
</Directory>
ServerName www.fjhh.com
Alias /cgi-bin/ "/www/client/fjhh/cgi-bin/"
CustomLog /www/apachelog/fjhh combined
</VirtualHost>
——————————————————————