Apache配置相关问题

 

 

出现以下错误
环境:本地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>


——————————————————————

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值