1. 编辑httpd.conf,查找Include conf/extra/httpd-vhosts.conf,把前面注释符号“#”删掉。
2. 编辑httpd-vhosts.conf,我把WAMPServer安装在D:/wamp,所以我这里的路径是D:\wamp\bin\apache\apache2.2.8\conf\extra\ httpd-vhosts.conf
2. 编辑httpd-vhosts.conf,我把WAMPServer安装在D:/wamp,所以我这里的路径是D:\wamp\bin\apache\apache2.2.8\conf\extra\ httpd-vhosts.conf
把里面的内容清空掉,换成下面的内容:
NameVirtualHost *:80<VirtualHost *:80>ServerAdmin webmaster@testDocumentRoot "D:\software\wamp\www\SAAS" (项目地址)ServerName www.saas.com (服务器名字)</VirtualHost><VirtualHost *:80>ServerAdmin webmaster@testDocumentRoot "D:\software\wamp\www\socialbroker"ServerName www.socialbroker.com</VirtualHost><VirtualHost *:80>ServerAdmin webmaster@testDocumentRoot "D:\software\wamp\www"ServerName localhost</VirtualHost><VirtualHost *:80>ServerAdmin webmaster@testDocumentRoot "D:\software\wamp\www"ServerName 192.168.222.154</VirtualHost><VirtualHost *:80>ServerAdmin webmaster@testDocumentRoot "D:\software\wamp\www"ServerName 127.0.0.1</VirtualHost>
3. 在hosts中添加域名
127.0.0.1 localhost
127.0.0.1 www.socialbroker.com
127.0.0.1 www.saas.com
4. 错误403:
Forbidden
You don't have permission to access on this server解决:打开httpd.conf 找到下面这段
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>将“Deny from all ”改为 Allow from all