频道栏目
首页 > 资讯 > 其他 > 正文

关于 Apache 设置反向代理 http、https的实例教程

18-07-18        来源:[db:作者]  
收藏   我要投稿

在安装好apache(已配置好https),配置好tomcat的前提下:

1)、首先确保Apache有这些模块,在Apache根目录下确认有这些模块,主要包含以下模块:

mod_proxy.so

mod_proxy_ajp.so

mod_proxy_balancer.so

mod_proxy_connect.so

mod_proxy_http.so

mod_slotmem_shm.so

打开配置conf/httpd.conf文件,将这些模块的注释去除.

2 )、修改配置文件,打开文件 conf/httpd.conf ,在文件末尾加上如下配置:

ServerAdmin 你的网址

ServerName你的网址

Order deny,allow

Allow from all

ProxyRequests Off

ProxyPass /abc http://127.0.0.1:12000/abc/

ProxyPassReverse /abc http://127.0.0.1:12000/abc/

ProxyPass / http://127.0.0.1:8011/

ProxyPassReverse / http://127.0.0.1:8011/

注意: /abc 必须放在 / 的前面进行配置(有优先级关系),否则无法访问 http://你的网址/abc .

3)、修改配置文件,打开文件 conf/httpd.conf 将

Include conf/extra/httpd-ssl.conf 前面的#去掉

4)、修改配置文件, 打开文件conf/extra/httpd-ssl.conf

ServerAdmin 你的网址

ServerName 你的网址

SSLEngine on

SSLProxyEngine On

SSLProxyCheckPeerCN Off

SSLProxyCheckPeerName Off

SSLProxyVerify none

SSLCertificateFile cert/你的证书.pem

SSLCertificateKeyFile cert/你的证书.key

SSLCertificateChainFile cert/你的证书.pem

Order deny,allow

Allow from all

ProxyPreserveHost On

ProxyRequests Off

ProxyPass /abc https://127.0.0.1:12443/abc/

ProxyPassReverse /abc https://127.0.0.1:12443/abc/

ProxyPass / https://127.0.0.1:8443/

ProxyPassReverse / https://127.0.0.1:8443/

注意SSLProxyCheckPeerCN Off

SSLProxyCheckPeerName Off

这两句很重要,否则会报

Proxy Error

The proxy server could not handle the requestGET/.

Reason:Error during SSL Handshake with remote server

相关TAG标签
上一篇:重启ceph的错误health HEALTH_ERR [56 pgs are stuck inactive for more than 300 seconds] 分析及解决办法
下一篇:centos7中ls的基础运用实例讲解
相关文章
图文推荐

关于我们 | 联系我们 | 广告服务 | 投资合作 | 版权申明 | 在线帮助 | 网站地图 | 作品发布 | Vip技术培训 | 举报中心

版权所有: 红黑联盟--致力于做实用的IT技术学习网站