如何使用xampp 配置虚拟主机

手册/FAQ (646) 2016-05-10 13:53:00

xampp 配置虚拟主机 第一步:在apache/conf/extra/httpd-vhosts.conf中添加虚拟主机配置 :如
<VirtualHost *:80>
ServerAdmin a@a.com
DocumentRoot "E:/phpProj/test"
ServerName test.com
ServerAlias www.test.com
ErrorLog "logs/test-error.log"
CustomLog "logs/test-access.log" combined
</VirtualHost>
可添加多个
<VirtualHost *:80>
ServerAdmin a@a.com
DocumentRoot "E:/phpProj/aa"
ServerName aa.com
ServerAlias www.aa.com
ErrorLog "logs/aa-error.log"
CustomLog "logs/aa-access.log" combined
</VirtualHost>
第二步:在apache/conf/httpd.conf中把
<Directory />
省略....
</Directory>

改成<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
allow from all 
</Directory>
第三步修改hosts文件
127.0.0.1 test.com www.test.com
127.0.0.1 aa.com www.aa.com
ok完成

THE END