/ 中存储网

Apache服务器端口映射

2014-03-18 16:17:01 来源:ITJS.CN
1、用 apache 反项代理 方法

先改 hppt.conf 

LoadModule proxy_http_module modules/mod_proxy_http.so

  ServerAdmin [email protected]

  ServerName http://www.server110.com

  ErrorLog logs/www.server110.com-error.log

  CustomLog logs/www.server110.com-access.log common

  ProxyPass /hn_edu http://localhost:8080/hn_edu

  ProxyPass / http://localhost:8080/hn_edu/

  ProxyPassReverse / http://localhost:8080/hn_edu/

</VirtualHost>

2、使用JK模块

下载mod_jk.so 放到modules目录里这个目录下都是SO文件

在httpd.conf 最后加上

=============================

LoadModule jk_module modules/mod_jk.so

JkWorkersFile conf/workers.properties

JkShmFile logs/mod_jk.shm

JkLogFile logs/mod_jk.log

JkLogLevel info

JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "

JkMount /yyy worker1

==============================

在conf目录下创建文件workers.properties

文 件内容如下,注意这里的8009是TOMCAT配置文件server.xml内

<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" /> AJP的端口,如果你改过了那这边也要一样

==============================

# Define 1 real worker using ajp13

worker.list=worker1

# Set properties for worker1 (ajp13)

worker.worker1.type=ajp13

worker.worker1.host=127.0.0.1

worker.worker1.port=8009

===============================