wampserver 自定义站点

时间:2023-03-10 01:04:27
wampserver 自定义站点

wampserver配置多站点,安装完wampserver后,我们要做的肯定是很多项目,那么如何配置wampserver多站点呢。

在“httpd.conf”文件中查找:Include conf/extra/httpd-vhosts.conf,去掉前面的注释#。

打开extra/httpd-vhosts.conf文件;在最后加入类似内容:(文件路径是自己安装程序的路径)

<VirtualHost *:80>

DocumentRoot "D:/wamp/www/aaa"(这是你放程序的文件路径)

ServerName www.aaa.com   (这是自己定义的域名)

</VirtualHost>

3、记事本编辑 D:\xampp\apache\conf\httpd.conf,在顶部添加需要被监听的端口:8080、8081,保留默认监听的 80 端口

Listen 80

Listen 8080

Listen 8081

<VirtualHost *:80>
DocumentRoot "E:\wamp\www\test02\phpstorm"
ServerName www.test.com
ServerAlias www.test.com
<Directory "E:\wamp\www\test02\phpstorm">
Options FollowSymLinks ExecCGI
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>
</VirtualHost>

wampserver 自定义站点

找到下图这个文件最后添加:

127.0.0.1   www.sae.com   (这是自己定义的域名)

wampserver 自定义站点