开启代理模块
- sudo a2enmod proxy
- sudo a2enmod proxy_http
- sudo a2enmod proxy_balancer
- sudo a2enmod lbmethod_byrequests
添加配置文件
- Debian 配置文件配置文件路径:
/etc/apache2/sites-available/
<VirtualHost *:80>
ProxyPreserveHost On
ServerName test.sttxx.com
ServerAlias test.sttxx.com
ProxyPass / http://127.0.0.1:11320/
ProxyPassReverse / http://127.0.0.1:11320/
</VirtualHost>
使用a2ensite工具启用配置文件
sudo a2ensite example.com.conf
- 禁用000-default.conf定义的默认站点:
sudo a2dissite 000-default.conf
- 测试配置:
sudo apache2ctl configtest
正常返回:Syntax OK
重启Apache2
sudo systemctl restart apache2
debian9 apache2 开启代理模块
There’s noticeably a bundle to learn about this. I assume you made certain nice points in options also.