xampp apache2.4.4 基于域名虚拟主机配置

来源:互联网 发布:单片机小车转弯 编辑:程序博客网 时间:2024/05/13 14:24

一、修改httpd.conf  

打开安装目录,找到httpd.conf文件,分别去掉下面文字前面的#号。 

去掉#意思是启用apache的虚拟主机功能。 

#Include conf/extra/httpd-vhosts.conf 

二、修改httpd-vhosts.conf

分别添加两个虚拟主机 px.shop.com px.shop_manage.com

<VirtualHost *:80>
ServerName px.shop.com
DocumentRoot "F:\web\yiishop\px_shop"
<Directory "F:\web\yiishop\px_shop"> 
Options FollowSymLinks IncludesNOEXEC Indexes
DirectoryIndex index.html index.htm index.php
AllowOverride all 
Order Deny,Allow 
Allow from all 
Require all granted
</Directory>
</VirtualHost>


<VirtualHost *:80>
ServerName px.shop_manage.com
DocumentRoot "F:\web\yiishop\px_shop_manage"
<Directory "F:\web\yiishop\px_shop_manage"> 
Options FollowSymLinks IncludesNOEXEC Indexes
DirectoryIndex index.html index.htm index.php
AllowOverride all 
Order Deny,Allow 
Allow from all 
Require all granted
</Directory>
</VirtualHost>

二、修改hosts

配置如下:
127.0.0.1       px.shop.com
127.0.0.1       px.shop_manage.com

如上就同时开启了两个虚拟主机!

0 0