1,change httpd.conf
add listen port like this:
listen 80
listen 8080
2,add the virtaul host conf
vi conf.d/virtaulhost.conf
NameVirtualHost localhost:80
NameVirtualHost localhost:8080
<VirtualHost localhost:80>
DocumentRoot /var/www/html/web1
ServerName localhost:80
</VirtualHost>
<VirtualHost localhost:8080>
DocumentRoot /var/www/html/web2
ServerName locahost:8080
</VirtualHost>
3、restart apache
service httpd restart
4、test
0 Responses to “apache配置多个端口”