`
wangdj
  • 浏览: 25063 次
  • 性别: Icon_minigender_1
  • 来自: 北京
最近访客 更多访客>>
社区版块
存档分类
最新评论

nginx tomcat配置说明

阅读更多

到http://nginx.org/下载nginx

yum -y install openssl openssl-devel

yum -y install pcre-devel

tar -xzvf Nignx-0.8.31.tar.gz

./configure --prefix=/usr/local/nginx

make

make install

启动

/user/local/nginx/sbin/nginx

重启
/user/local/nginx/sbin/nginx -s reload

停止
/user/local/nginx/sbin/nginx -s  stop

停止
ps -ef | grep nginx

强制停止Nginx
pkill -9 nginx


vi nginx.conf 末尾加上,最后一个大括号前加

    #}
include vhost/*.conf;

}



[root@localhost conf]# mkdir vhost

[root@localhost conf]# vi younila.conf

# demo site
server {

        listen 80;
        server_name www.younila.com;
        set $htdocs /webapps/younila/;
        root $htdocs;

        location / {
                index index.html index.htm index.action;
        }


        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|css|js|html)$ {
                expires 30d;
        }

        location ~*\.(jsp|do|action)$
        {
          index index.jsp;
          proxy_pass http://localhost:8080;
          proxy_set_header Host $host;
          proxy_set_header X-Real-IP $remote_addr;
          proxy_set_header REMOTE-HOST $remote_addr;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }
        location ~^/(WEB-INF)/{
           deny all;
        }


}

tomcat server.xml 加入
<Context path="" docBase="/webapps/younila" crossContext="true" debug="0" reloadable="true"/>

分享到:
评论
1 楼 songmulin 2012-08-24  
能否加下我QQ 420808737  有问题请教一下你··

相关推荐

Global site tag (gtag.js) - Google Analytics