资源预览内容
第1页 / 共4页
第2页 / 共4页
第3页 / 共4页
第4页 / 共4页
亲,该文档总共4页全部预览完了,如果喜欢就下载吧!
资源描述
Linux软件安装一、 Pcre+nginx + nginx_upstream_jvm_route安装a.安装pcretar zxvf pcre-7.2.tar.gzcd pcre./configure prefix = /pcreMake;make installb,安装nginxtar zxvf nginx-0.6.32.tar.gzcd nginx-0.6.32#patch -p0 ./nginx-upstream-jvm-route-read-only/jvm_route.patch./configure prefix=/nginx with-pcre=/pcre with-http_rewrite_module -add-module=/root/nginx-upstream-jvm-route-read-only#make;#make install二、 修改nginx.conf文件修改成以下内容:#user nobody;worker_processes 5;#error_log logs/error.log;#error_log logs/error.log notice;#error_log logs/error.log info;#pid logs/nginx.pid;events use epoll; worker_connections 2048;http upstream backend server localhost:8087 invalid=web_tomcat2; #负载均衡服务器 server localhost:8088 invalid=web_tomcat1; #负载均衡服务器 jvm_route $cookie_JSESSIONID|sessionid reverse; include mime.types; default_type application/octet-stream; charset UTF-8; server_names_hash_bucket_size 128; client_header_buffer_size 32k; large_client_header_buffers 4 32k; client_max_body_size 20m; limit_rate 1024k; sendfile on; tcp_nopush on; keepalive_timeout 60; tcp_nodelay on; fastcgi_connect_timeout 300; fastcgi_send_timeout 300; fastcgi_read_timeout 300; fastcgi_buffer_size 64k; fastcgi_buffers 4 64k; fastcgi_busy_buffers_size 128k; fastcgi_temp_file_write_size 128k; gzip on; gzip_min_length 1k; gzip_buffers 4 16k; gzip_http_version 1.0; gzip_comp_level 2; gzip_types text/plain application/x-javascript text/css application/xml; gzip_vary on; #limit_zone crawler $binary_remote_addr 10m; server listen 80; server_name localhost; index index.jsp index.htm index.html; root /usr/local/program/xhxw_web; #access_log logs/host.access.log main; location / proxy_pass http:/backend; #设为反向代理 proxy_redirect off; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $http_host; location .*.(htm|html|ico|gif|jpg|jpeg|png|bmp|swf)$ expires 30d; location .*.(js|css)?$ expires 1h; location /Nginxstatus stub_status on; access_log off; log_format access $remote_addr - $remote_user $time_local $request $status $body_bytes_sent $http_referer $http_user_agent $http_x_forwarded_for; #access_log off; server listen 80; server_name cms.xhxw.com; index index.jsp index.htm index.html; root /usr/local/program/xhxw; #access_log logs/host.access.log main; location / proxy_pass http:/localhost:8058; proxy_redirect off; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $http_host; 测试 配置文件是否有错 /usr/local/nginx/sbin/nginx t如果出现:the configuration file /usr/local/nginx/conf/nginx.conf syntax is okconfiguration file /usr/local/nginx/conf/nginx.conf test is successful说明配置成功三、 Tomcat配置文件修改修改server.xml在 加上 jvmRoute=web_tomcat1添加后:。在 下面添加
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号