1、打开httpd.conf,找到Listen:80,在其下加入一行:Listen:8080;
复制代码代码如下:
<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> 7、保存并重启apache。
备注: |