操作系统:centos 5.4 64位
1,安装jdk,已经配置有yumrepository,直接使用。
2,安装pcre,nginx运行所需perl库。
yum install pcre pcre-devel
3,安装mysql ,mysql相关配置省略。
yum install mysql mysql-server
4,安装并配置resin。
wget http://
tar zxvf resin-4.0.3.tar.gz
cd resin-4.0.3
./configure --prefix=/usr/local/resin
make && make install
修改配置参数
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 start
5,安装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
阅读(2640) | 评论(0) | 转发(0) |