centos下apache反向代理设置
来源:互联网 发布:淘宝卖家怎么提升等级 编辑:程序博客网 时间:2024/05/22 03:43
今天公司想要做一个微信公共平台,做这个东西的开发人员不会用php,就在服务器上自己搭了一个tomcat。问题出来了:服务器80端口我已经用掉了,他的tomcat只能用其他端口(用的8080),而微信公共平台只支持80端口。。。
于是折腾了半天,通过apache反向代理的方式,将请求微信公共平台的请求导向8080端口。
由于当时apache当时安装时没有加载proxy模块,所以我去官网下载了这个模块的源码:http://apache.webthing.com/mod_proxy_html/ 官网说这个模块安装还需要mod_xml2enc,其实在这个网页中下载的源码已经包含了mod_xml2enc。
下载到服务器上,解压之后,直接运行
apxs -c -I/usr/include/libxml2 -I. -i mod_proxy_html.capxs -c -I/usr/include/libxml2 -I. -i mod_xml2enc.c
proxy模块就自动安装好了,然后配置虚拟主机文件:/usr/local/apache2/conf/extra/httpd-vhosts.conf
<virtualhost xx.xx.xx.xx:80> ServerAdmin admin@padandroid.com DocumentRoot "/var/www/html/xxx" ServerName www.yourdomain.com ErrorLog "/var/www/html/xxx/logs/error_log" CustomLog "/var/www/html/xxx/logs/access_log" common <Directory "/var/www/html/xxx"> Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> ProxyPreserveHost On ProxyRequests Off ProxyPass /wechat http://www.yourdomain:8080/wechat/ ProxyPassReverse /wechat http://www.yourdomain.com:8080/wechat/</virtualhost>
重启apache服务:service httpd restart
OK,再次访问http://www.yourdomain.com/wechat 成功转向 http://www.yourdomain.com:8080/wechat
这个配置 也可以导向不同的服务器地址,有用!
0 0
- centos下apache反向代理设置
- Ubuntu下Apache反向代理设置
- Apache反向代理设置
- Apache反向代理设置
- Apache反向代理设置
- Apache设置反向代理
- Apache反向代理设置
- Apache反向代理设置方法
- apache 反向代理tomcat设置
- Apache设置https反向代理
- centos下nginx反向代理
- apache https反向代理设置方案
- apache https反向代理设置方案
- apache https反向代理设置方案
- apache https反向代理设置方案
- Apache反向代理设置一例
- 为OpenERP7.0设置Apache反向代理
- 为OpenERP7.0设置Apache反向代理
- oracle11g数据库的管理 学习笔记
- jQuery二级菜单
- cocos2d-html5使用jsbinding显示广告
- JAVA中this用法小结
- 天津之行
- centos下apache反向代理设置
- linux环境下 ./startup.sh: /bin/sh^M: bad interpreter: 没有那个文件或目录 解决办法
- c++ string iterators incompatible
- mysql数据库 触发器
- Android获取设备采用的时间制式(12小时制式或24小时制式)
- Android 通过拍照获取图片
- HTTPS的SSL双向认证
- Storm高级原语(四) — Trident API 综述
- idea maven编译出现 “不是语句” “缺少;” 等编译异常信息的解决方案