1
66beta 2013-05-27 15:39:35 +08:00
如果是xampp,那么找到httpd-vhosts.conf,在里面建立多个虚拟主机即可。
|
2
66beta 2013-05-27 15:41:41 +08:00 1
按照xampp官方安装手册,应该在 /opt/lampp/etc/extra 下面;
贴个我的, <VirtualHost *:80> DocumentRoot /opt/lampp/htdocs/www ServerName www.aaaaaaaaaaaaaa.com ServerAlias aaaaaaaaaaaaaa.com </VirtualHost> <VirtualHost *:80> DocumentRoot /opt/lampp/htdocs/blog ServerName blog.aaaaaaaaaaaaaa.com </VirtualHost> |
3
cooper 2013-05-27 15:41:54 +08:00 1
1. 打开目录 {Apache2 安装目录}\conf\extra\, 找到 httpd-vhosts.conf 文件.
2. 仿照例子, 添加一段代码来指定某一域名的网站. # # DocumentRoot 是网站文件存放的根目录 # ServerName 是网站域名, 需要跟 DNS 指向的域名一致 # <VirtualHost *:80> ServerAdmin webmaster@dummy-host.example.com DocumentRoot "D:/workspace/php/demo_neoease_com" ServerName demo.neoease.com ErrorLog "logs/demo.neoease.com-error.log" CustomLog "logs/demo.neoease.com-access.log" common </VirtualHost> 3. 打开 httpd.conf 文件, 添加如下语句. # Virtual hosts Include conf/extra/httpd-vhosts.conf 4. 重启 Apache 服务. |
4
66beta 2013-05-27 15:42:28 +08:00
不好意思看错了,楼主是windows,那么在D:\xampp\apache\conf\extra
|
5
shpasspass OP |