欢迎来到天天文库
浏览记录
ID:6127774
大小:234.45 KB
页数:7页
时间:2018-01-04
《nginx tomcat实现动静分离》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、一、什么是动静分离本文的动静分离主要是通过nginx+tomcat来实现,其中nginx处理图片、html等静态的文件,tomcat处理jsp、do等动态文件。二、结构图三、安装1、安装、配置nginx下载nginx与pcre(如果需要使用正则,需要安装pcre)wget http://blog.s135.com/soft/linux/nginx_php/nginx/nginx-0.8.46.tar.gzwgethttp://blog.s135.com/soft/linux/nginx_php/pcre/pcre
2、-8.10.tar.gz安装pcre1.tar zxvf pcre-8.10.tar.gz 2.cd pcre-8.10/ 3../configure 4.make 5.make install cd..安装nginx1.tar zxvf nginx-0.8.46.tar.gz 2.cd nginx-0.8.46/ 3../configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --wit
3、h-http_ssl_module 4.make 5.make install nginx.conf配置1.user www www; 2. 3.worker_processes 8; 4. 5.error_log /usr/local/nginx/logs/nginx_error.log crit; 6. 7.pid /usr/local/nginx/nginx.pid; 8. 9.worker_rlimit_nofile 65535; 10. 11.events 12.{ 13.
4、use epoll; 14. worker_connections 65535; 15.} 16. 17.http 18.{ 19. include mime.types; 20. default_type application/octet-stream; 21. 22. #charset gb2312; 23. 24. server_names_hash_bucket_size 128; 25. client_header_buffer_size 32k; 26.
5、large_client_header_buffers 4 32k; 27. client_max_body_size 8m; 28. 29. sendfile on; 30. tcp_nopush on; 31. 32. keepalive_timeout 60; 33. 34. tcp_nodelay on; 35. 36. fastcgi_connect_timeout 300; 37. fastcgi_send_timeout 300; 38. fastcgi_read
6、_timeout 300; 39. fastcgi_buffer_size 64k; 40. fastcgi_buffers 4 64k; 41. fastcgi_busy_buffers_size 128k; 42. fastcgi_temp_file_write_size 128k; 43. 44. gzip on; 45. gzip_min_length 1k; 46. gzip_buffers 4 16k; 47. gzip_http_version 1.0; 1. gzip_
7、comp_level 2; 2. gzip_types text/plain application/x-javascript text/css application/xml; 3. gzip_vary on; 4. 5. #limit_zone crawler $binary_remote_addr 10m; 6. 7. server 8. { 9. listen 80; 10. server_name test1.dl.com;
8、 ####test1.dl.com的ip为10.1.88.176 11. index index.html index.htm index.php; 12. root /usr/local/nginx/html; 13. 14. #limit_conn crawler 20; 15.
此文档下载收益归作者所有