阿帕奇配置本地虚拟站点,XAMPP环境下

首先利用XAMPP搭建的阿帕奇环境,必须得启动,不能启动的话www.baidu.com

 在XAMPP的目录下的apache,打开httpd-vhosts.conf文件

E:\XAMPP\apache\conf\extra

 

 

 

 

 

 

在最后加上这个

80就是监听的端口

ServerName 就是本地的域名
DocumentRoot就是文件的环境
切记是\这种目录的斜杠
Directory 也要改
 
<VirtualHost *:80>

 ServerName ymh.com

 DocumentRoot "E:\XAMPP\htdocs\jianshu\fabu\public"

<Directory "E:\XAMPP\htdocs\jianshu\fabu\public"> 

 Options FollowSymLinks IncludesNOEXEC Indexes

 DirectoryIndex index.php index.html index.htm 

 AllowOverride all 

 Order Deny,Allow 

 Allow from all 

 Require all granted

</Directory>

</VirtualHost>

 

 

 

然后打开

C:\Windows\System32\drivers\etc

 

打开host文件

在最后加上这一句话


127.0.0.1 ymh.com

 

 然后重启阿帕奇OK!

 

posted @ 2018-02-14 20:01  万隆  阅读(305)  评论(0编辑  收藏  举报