当前位置 主页 > 服务器问题 > Linux/apache问题 >
1、打开httpd.conf,查找Listen:80,在下面一行加入Listen:8080;
2、查找#Include conf/extra/httpd-vhosts.conf,将此行前面的#去掉;
3、打开httpd.conf文件目录下面的extra文件夹下面的httpd-vhosts.conf文件;
4、查找NameVirtualHost *:80,在下面一行增加NameVirtualHost *:8080;
5、复制httpd-vhosts.conf文件最下面的如下代码,并且在下面粘贴一份:
复制代码 代码如下:
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.abc.com
DocumentRoot "G:\PHP"
ServerName dummy-host.abc.com
ServerAlias www.dummy-host.abc.ccom
ErrorLog "logs/dummy-host.abc.com-error.log"
CustomLog "logs/dummy-host.abc.com-access.log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.abc.com
DocumentRoot "G:\PHP"
ServerName dummy-host2.abc.com
ErrorLog "logs/dummy-host2.abc.com-error.log"
CustomLog "logs/dummy-host2.abc.com-access.log" common
</VirtualHost>
6、将上面代码修改为:
复制代码 代码如下:
<VirtualHost *:8080>
ServerAdmin webmaster@dummy-host.abc.com
DocumentRoot "G:\PHP\abc"
ServerName dummy-host.abc.com
ServerAlias www.dummy-host.abc.ccom
ErrorLog "logs/dummy-host.abc.com-error.log"
CustomLog "logs/dummy-host.abc.com-access.log" common
</VirtualHost>
<VirtualHost *:8080>
ServerAdmin webmaster@dummy-host2.abc.com
DocumentRoot "G:\PHP\abc"
ServerName dummy-host2.abc.com
ErrorLog "logs/dummy-host2.abc.com-error.log"
CustomLog "logs/dummy-host2.abc.com-access.log" common
</VirtualHost>