/ 中存储网

Apache,Nginx和jboss的整合配置方法

2014-02-21 08:57:01 来源:kejihao
这几天帮朋友搭建两台web server,及有php环境需求,又有java环境需求.

我使用了两种办法,都成功部署.

1. 使用nginx + php(fastcgi),然后使用upstream模块.配置如下:

upstream www.server110.com {

server 127.0.0.1:8080;

}

# www.server110.com

server {

listen 80;

server_name www.server110.com;

location / {

proxy_pass http://www.server110.com;

}

}

实现php,java的整合.配置完之后支持php,jsp环境.

2. 使用apache+ mod_jk + jboss.

LoadModule jk_module modules/mod_jk.so

JkWorkersFile conf/workers.properties

JkLogFile logs/mod_jk.log

JkLogLevel info

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

JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories

JkRequestLogFormat "%w %V %T"

worker.list=jboss

worker.jboss.port=8009

worker.jboss.host=127.0.0.1

worker.jboss.type=ajp13

worker.jboss.lbfactor=50

#worker.jboss.cachesize=10

#worker.jboss.cache_timeout=600

worker.jboss.socket_keepalive=1

#worker.jboss.recycle_timeout=300

<VirtualHost *:80>

ServerAdmin [email protected]

DocumentRoot "/usr/java/jboss-4.0.3SP1/server/default/deploy"

ServerName www.server110.com

JkMount /* jboss

ErrorLog "/www/logs/www.server110.com-error_log"

CustomLog "/www/logs/www.server110.com-access_log" common

</VirtualHost>

还可以使用apache的http_proxy模块来做.或者ajp_proxy也可以实现.

我在这里只选择前两种来配置.

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