一、转发时需开启如下:
1 | sudo a2enmod proxy |
二、相关代码:
80端口转发其他多个项目端口
1 | <VirtualHost *:80> |
apache 监听多个端口
目录:/etc/apache2/ports.conf
1
2
3
4
5
6
7
8
9
10
11Listen 80
Listen 8003
Listen 8004
<IfModule ssl_module>
Listen 443
</IfModule>
<IfModule mod_gnutls.c>
Listen 443
</IfModule>目录:/etc/apache2/sites-available/000-default.conf
1
2
3
4
5
6
7
8
9
10
11
12
13<VirtualHost *:8003>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/xunke
ErrorLog /etc/apache2/error.log
CustomLog /etc/apache2/access.log combined
</VirtualHost>
<VirtualHost *:8004>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/qibo
ErrorLog /etc/apache2/error.log
CustomLog /etc/apache2/access.log combined
</VirtualHost>