首页 > 代码库 > PHP中虚拟主机的配置

PHP中虚拟主机的配置

1.开启……/apache/conf/httpd.conf:

1 # Virtual hosts2 #Include conf/extra/httpd-vhosts.conf

 

 设置成:

1 # Virtual hosts2 Include conf/extra/httpd-vhosts.conf

 

2.设置……\apache\conf\extra\httpd-vhosts.conf(可以设置多个主机)

1 <VirtualHost *:80>2     DocumentRoot "D:/www/OA/"3     ServerName OA4     ErrorLog "logs/oa-error.log"5     CustomLog "logs/oa-access.log" common6 </VirtualHost>

 

3.在C:\Windows\System32\drivers\etc\hosts里面添加如下:

1 127.0.0.1         phpMyAdmin2 127.0.0.1         OA3 …………