您的位置:首页 > 其它

wampserver配置多站点

2015-05-31 20:43 218 查看
1.打开C:\wamp\bin\apache\apache2.2.22\conf\httpd.conf(因安装的路径而异),查找listen 80 下面加上listen 8080

2.然后加上

<Directory "e:/www/">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options # for more information.
#
Options Indexes FollowSymLinks

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride all

#
# Controls who can get stuff from this server.
#

# onlineoffline tag - don't remove
Order Allow,Deny
Allow from all

</Directory>

这是让服务器可以访问e:/www/这个文件夹

3.搜索Include conf/extra/httpd-vhosts.conf,把之前的#去掉

4.打开 conf/extra/httpd-vhosts.conf文件,然后加上(注意,要将默认80端口的也加上,否则你将用不了80端口了)

<Virtualhost *:80>

ServerName localhost

DocumentRoot "c:\wamp\www"

</Virtualhost>
<Virtualhost *:8080>

ServerName localhost

DocumentRoot "E:\www"

</Virtualhost>

完成。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: