- 論壇徽章:
- 0
|
操作系統(tǒng):centos 5.4 64位1,安裝jdk,已經(jīng)配置有yumrepository,直接使用。
yum install jdk2,安裝pcre,nginx運行所需perl庫。
yum install pcre pcre-devel3,安裝mysql ,mysql相關(guān)配置省略。
yum install mysql mysql-server
4,安裝并配置resin。
wget http://www.caucho.com/download/resin-4.0.3.tar.gz
tar zxvf resin-4.0.3.tar.gz
cd resin-4.0.3
./configure --prefix=/usr/local/resin
make && make install修改配置參數(shù)
vi /usr/local/resin/conf/resin.xml注釋掉下面代碼,不然會提示啟動錯誤
resin:if test="${resin.userName == 'root'}">
user-name>www-datauser-name>
group-name>www-datagroup-name>
resin:if>并添加相應配置
web-app id="/" document-directory="/data0/htdocs/" archive-path="/data0/htdocs/gdccb.war">
web-app-deploy path="/data0/htdocs/gdccb.war"/>
web-app>啟動resin
/usr/local/resin/bin/resin.sh start5,安裝nginx。
wget http://nginx.org/download/nginx-0.8.32.tar.gz
tar zxvf nginx-0.8.32.tar.gz
./configure --prefix=/usr/local/nginx
make && make install修改配置文件
vi /usr/local/nginx/conf/proxy
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffers 32 4k;vi /usr/local/nginx/conf/nginx
修改server { ... ...} 為下面代碼
server
{
listen 80;
server_name gd.bccb95533.com;
index index.jsp index.html index.htm ;
root /data0/htdocs;
if (-d $request_filename)
{
rewrite ^/(.*)([^/])$ http://$host/$1$2/ permanent;
}
location / {
include /usr/local/webserver/nginx/conf/proxy_resin.conf;
proxy_pass http://localhost:8080;
proxy_set_header X-Real-IP $remote_addr;
}
}啟動nginx
/usr/local/nginx/sbin/nginx
本文來自ChinaUnix博客,如果查看原文請點:http://blog.chinaunix.net/u3/109111/showart_2149301.html |
|