1.在httpd.conf添加多个端口,如下
Listen 80
Listen 8080
2.开启Include conf/extra/httpd-vhosts.conf
3.具体代码如下
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "F:\phpStudy\WWW"
ServerName 192.168.1.134
ServerAlias www.dummy-host.example.com
ErrorLog "logs/dummy-host.example.com-error.log"
CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>
# Add any other Virtual Hosts below
<VirtualHost *:8080>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "F:\phpStudy\WWW\router"
ServerName 192.168.1.134
ServerAlias www.dummy-host.example.com
ErrorLog "logs/dummy-host.example.com-error.log"
CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>