配置虚拟主机
-
在apache的httpd.conf文件末添加如下代码:
<VirtualHost *:80>
ServerName 修改成自己的域名
DocumentRoot "修改成自己的项目路径"
<Directory "修改成自己的项目路径">
Options FollowSymLinks IncludesNOEXEC Indexes
DirectoryIndex index.html index.htm default.htm index.php default.php index.cgi default.cgi index.pl default.pl index.shtml
AllowOverride All
Order Deny,Allow
Allow from all
</Directory>
</VirtualHost>
示例:
<VirtualHost *:80>
ServerName www.ff.com
DocumentRoot "E:/wamp/www/demo"
<Directory "E:/wamp/www/demo">
Options FollowSymLinks IncludesNOEXEC Indexes
DirectoryIndex index.html index.htm default.htm index.php default.php index.cgi default.cgi index.pl default.pl index.shtml
AllowOverride All
Order Deny,Allow
Allow from all
</Directory>
</VirtualHost>
在系统文件C:\Windows\System32\drivers\etc\hosts中添加如下配置127.0.0.1 www.ff.com
本文转自 素颜猪 51CTO博客,原文链接:http://blog.51cto.com/suyanzhu/1682636