实验环境:一台带有两块网卡的OB服务器,一块连接外网1.1.1.1,一块连接内网192.168.100.1
1、开启apache的代理模块。修改httpd.conf文件,去掉下面的注释
代码: 全选
#LoadModule proxy_module /usr/lib/apache/modules/libproxy.so
[color="Red"]LoadModule proxy_module /usr/lib/apache/modules/libproxy.so[/color]
代码: 全选
<IfModule mod_proxy.c>
ProxyRequests Off
<Directory proxy:*>
Order deny,allow
Allow from all
</Directory>
</IfModule>
代码: 全选
NameVirtualHost 1.1.1.1
<VirtualHost 1.1.1.1>
ServerName www.gobsd.org
ProxyPass / http://192.168.100.2/
ProxyPassReverse / http://192.168.100.2/
SetEnv force-proxy-request-1.0 1
SetEnv proxy-nokeepalive 1
</VirtualHost>
代码: 全选
<VirtualHost 1.1.1.1>
ServerName it.gobsd.org
ProxyPass / https://192.168.100.3/
ProxyPassReverse / https://192.168.100.3/
SetEnv force-proxy-request-1.0 1
SetEnv proxy-nokeepalive 1
SSLEngine on
SSLCertificateFile /etc/ssl/server.crt
SSLCertificateKeyFile /etc/ssl/private/server.key
</VirtualHost>
代码: 全选
www.gobsd.org 1.1.1.1
it.gobsd.org 1.1.1.1