欢迎来到天天文库
浏览记录
ID:11897131
大小:45.00 KB
页数:5页
时间:2018-07-14
《反向代理服务器安装和配置》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、开发环境代理服务器安装和配置1环境安装1.1条件1.操作系统:centos5.464位(或者更高的版本)。2.ssh连接工具:putty。3.文件传输工具:winscp1.2服务器软件1.nginx1.4.11.3安装步骤1)把nginx安装包nginx-1.4.1.tar.gz、pcre-8.32.tar.gz上传到指定的安装目录,并同时对两个文件进行解压2)安装脚本yum-yinstallgccgcc-c++opensslopenssl-develcdnginx-1.4.1./configure--prefix=/usr/lo
2、cal/nginx--sbin-path=/usr/local/nginx/sbin/nginx--conf-path=/usr/local/nginx/conf/nginx.conf--error-log-path=/usr/local/nginx/log/error.log--http-log-path=/usr/local/nginx/log/access.log--pid-path=/usr/local/nginx/run/nginx.pid--user=www--group=www--with-http_ssl_modu
3、le--with-http_flv_module--with-http_stub_status_module--with-http_gzip_static_module--http-client-body-temp-path=/usr/local/nginx/tmp/client--http-proxy-temp-path=/usr/local/nginx/tmp/proxy/--http-fastcgi-temp-path=/usr/local/nginx/tmp/fcgi/--add-module=./ngx_cache_pu
4、rge-2.1--with-pcre=../pcre-8.32makemakeinstall/usr/local/nginx/sbin/nginx1.4注意事项1.安装的服务器必须是可以出公网,否则依赖包无法安装2.安装完后加入开机启动1.启动命令:/usr/local/nginx/sbin/nginx2.重启命令:killall-9nginx&&/usr/local/nginx/sbin/nginx2环境配置2.1配置步骤1.把”代理服务器配置”文件夹下面的conf上传到代理服务器/usr/local/nginx覆盖conf文件
5、夹2.重启nginx2.2一般配置解释配置文件/usr/local/nginx/conf/nginx.confuserwwwwww;worker_processes8;error_log/usr/local/nginx/logs/nginx_error.logcrit;pid/usr/local/nginx/nginx.pid;#Specifiesthevalueformaximumfiledescriptorsthatcanbeopenedbythisprocess.worker_rlimit_nofile65535;event
6、s{useepoll;worker_connections65535;}http{includemime.types;default_typeapplication/octet-stream;charsetutf-8;server_names_hash_bucket_size128;client_header_buffer_size32k;large_client_header_buffers432k;client_max_body_size300m;sendfileon;tcp_nopushon;keepalive_timeou
7、t60;tcp_nodelayon;client_body_buffer_size512k;proxy_connect_timeout5;proxy_read_timeout60;proxy_send_timeout5;proxy_buffer_size16k;proxy_buffers464k;proxy_busy_buffers_size128k;proxy_temp_file_write_size128k;gzipon;gzip_min_length1k;gzip_buffers416k;gzip_http_version1
8、.1;gzip_comp_level2;gzip_typestext/plainapplication/x-javascripttext/cssapplication/xml;gzip_varyon;#注:proxy_temp_path和proxy
此文档下载收益归作者所有