1.打开C:\wamp\bin\apache\apache2.2.22\conf\httpd.conf(因安装的路径而异),查找listen 80 下面加上listen 8080html
2.而后加上apache
<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 allide
#
# Controls who can get stuff from this server.
#this
# onlineoffline tag - don't remove
Order Allow,Deny
Allow from allorm
</Directory>server
这是让服务器能够访问e:/www/这个文件夹htm
3.搜索Include conf/extra/httpd-vhosts.conf,把以前的#去掉ci
4.打开 conf/extra/httpd-vhosts.conf文件,而后加上(注意,要将默认80端口的也加上,不然你将用不了80端口了)rem
<Virtualhost *:80>
ServerName localhost
DocumentRoot "c:\wamp\www"
</Virtualhost>
<Virtualhost *:8080>
ServerName localhost
DocumentRoot "E:\www"
</Virtualhost>
完成。