wampserver配置多站点
- 打开apache的配置文件
- 搜索httpd-vhosts,把Include conf/extra/httpd-vhosts.conf前面的#去掉(这样待会配置httpd-vhosts.conf文件才能起效)
# Virtual hosts
#Include conf/extra/httpd-vhosts.conf
- 找到\wamp\bin\apache\Apache2.4.4\conf\extra\httpd-vhosts.conf文件,添加一下代码
- 1907为端口号,自己自定义端口号
- D:\prxqf\1907HTML为站点路径,自己自定义路径
listen 1907
<VirtualHost *:1907>
ServerName locahost
DocumentRoot D:\prxqf\1907HTML
<Directory "D:\prxqf\1907HTML">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
- restart server重启服务
- 打开浏览器访问 localhost :1907
wampserver安装注意事项:
- 安装路径不能有中文,否则apache服务不能运行,图标为黄色。
- 如果默认端口被占用,图标为红色,需要更改apache的配置文件httpd.conf,直接搜索80,把80端口改为其他端口
pache的配置文件httpd.conf,直接搜索80,把80端口改为其他端口