zexiwyqquw 发表于 2016-5-10 12:42:46

centos下nginx和resin安装配置

  nginx安装:
  1. yum -y install pcre-devel openssl openssl-devel
  2. wget http://nginx.org/download/nginx-0.7.65.tar.gz, ./configure & make & make install
  /usr/local/nginx/sbin/nginx 启动nginx,在浏览器输入http://ip,如果出现“Welcome to nginx”则表示安装成功。
  
  nginx常用命令
  启动 nginx:
/usr/local/nginx/sbin/nginx
·停止 nginx:
kill -TERM `cat /usr/local/nginx/logs/nginx.pid`
测试配置
/usr/local/nginx/sbin/nginx -t
重启 nginx
kill -HUP `cat /usr/local/nginx/logs/nginx.pid`
  
  
  resin安装:
  下载resin, ./configure & make & make install安装
  ln -s /usr/local/src/resin-3.1.10 /usr/local/resin
  在/etc/profile加入
  RESIN_HOME=/usr/local/resi
  export RESIN_HOME
  重新登录shell
  /usr/local/resin/bin/httpd.sh start 启动resin
  在浏览器输入http://ip:8080,如果显示Resin® Default Home Page,则安装成功。
  /usr/local/resin/bin/httpd.sh stop 停止resin
  
  
  nginx与resin整合:
  在未整合时,在浏览器输入http://ip/index.jsp,返回的是404,提示页面未找到。
  
  修改/usr/local/nginx/conf/nginx.conf
  在http {后加入
      upstream dynamic.com {
        server 127.0.0.1:8080;
    }
  
  在location / { 前面加入
          location ~ (\.jsp)|(\.do)$ {
            proxy_pass http://dynamic.com;
        }
  
  当遇到.jsp或.do结尾的请求时,交由resin处理。
  重启nginx,在浏览器输入http://ip/index.jsp,此时返回Resin® Default Home Page页面,至此整合完成。
页: [1]
查看完整版本: centos下nginx和resin安装配置