apache 配置多个虚拟主机,不同的端口

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>

上一篇:hibernate基本配置与简单增删改查


下一篇:JDBC学习笔记——增删改查