首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 操作系统 >

nginx tomcat配备说明

2012-08-24 
nginx tomcat配置说明到http://nginx.org/下载nginxyum -y install openssl openssl-develyum -y install

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
强制停止Nginxpkill -9 nginx

vi nginx.conf 末尾加上,最后一个大括号前加
? ? #}include vhost/*.conf;
}


[root@localhost conf]# mkdir vhost
[root@localhost conf]# vi younila.conf
# demo siteserver {
? ? ? ? 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"/>

热点排行