首页 > Windows开发 > 详细

xamppv3.2.1 在本地Windows上配置多域名、多ip段,无需修改host,windows本地多虚拟主机的正确设置教程127.0.0.9/127.0.0.8

时间:2019-10-09 19:59:43      阅读:94      评论:0      收藏:0      [点我收藏+]

之前一直用phpnow添加的虚拟主机,后来看xampp的php版本比较多,就改用了xampp,由于项目较多,始终切换同一个 127.0.0.1也不好,网上找了一些资料,但是大多都有问题,配置无效

 

多数时候会提示403等 如下错误

 

 

Access forbidden!
 
You don‘t have permission to 
access the requested directory. There is either no index document or the
 directory is read-protected.
 
If you think this is a server error, please contact the webmaster.
 
Error 403

  

最终解决方案:

 

在 apache/conf/extra/httpd-vhosts.conf  里 添加如下代码

 

<VirtualHost *:80>
DocumentRoot "网站路径"
<Directory "网站路径">
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    Require all granted
</Directory>
ServerName 本地的ip段
</VirtualHost>

 

# Virtual Hosts
#
# Required modules: mod_log_config
 
 
 
NameVirtualHost *
 
 
<VirtualHost *:80>
DocumentRoot "F:/mysite/jourmy_website"
<Directory "F:/mysite/jourmy_website">
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    Require all granted
</Directory>
ServerName 127.0.0.10
</VirtualHost>
 
<VirtualHost *:80>
DocumentRoot "F:/mysite/jourmy_website2"
<Directory "F:/mysite/jourmy_website2">
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    Require all granted
</Directory>
ServerName 127.0.0.8
</VirtualHost>

  

经测试,在浏览器中可以 通过输入  127.0.0.10  和 127.0.0.8  分别访问不同的站点

 

帮助您提升开发速度

 

转自http://www.jourmy.cn/html/122.html

xamppv3.2.1 在本地Windows上配置多域名、多ip段,无需修改host,windows本地多虚拟主机的正确设置教程127.0.0.9/127.0.0.8

原文:https://www.cnblogs.com/rjbc/p/11643968.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!