秀米云香港服务器

nginx 1.9.5

#yum install gcc pcre-devel zlib-devel openssl-devel

序列号 CPU RAM HDD 带宽 售价(美元) 免费试用
香港服务器1 E5-2620 32G 1T HDD 50M/无限流量 $196.00 立即申请
香港服务器2 E5-2650 32G 1T HDD 50M/无限流量 $256.00 立即申请
香港服务器3 E5-2680 32G 1T HDD 50M/无限流量 $316.00 立即申请
香港服务器4 E5-2690 32G 1T HDD 50M/无限流量 $336.00 立即申请
香港服务器5 E5-2697 32G 1T HDD 50M/无限流量 $376.00 立即申请
香港服务器6 E5-2620*2 32G 1T HDD 50M/无限流量 $376.00 立即申请
香港服务器7 E5-2650*2 32G 1T HDD 50M/无限流量 $436.00 立即申请
香港服务器8 E5-2680*2 32G 1T HDD 50M/无限流量 $476.00 立即申请
香港服务器9 E5-2690*2 32G 1T HDD 50M/无限流量 $556.00 立即申请
香港服务器10 E5-2697*2 32G 1T HDD 50M/无限流量 $596.00 立即申请
香港服务器11 E5-2680v4*2 32G 1T HDD 50M/无限流量 $696.00 立即申请
香港服务器12 E5-2698v4*2 32G 1T HDD 50M/无限流量 $796.00 立即申请

#./configure --prefix=/usr/local/lnmp/nginx --with-openssl=/usr/lib64/openssl

#make && make install

#ulimit -SHn 65535

#vi /etc/profile.d/ulimit.sh

写入 ulimit -SHn 65535

生存

修改nginx.conf 中的相关基本设置 完成后 基本设置如下

usernobody;worker_processes1;error_loglogs/error.log;pidlogs/nginx.pid;worker_rlimit_nofile65535;events{useepoll;worker_connections65535;}http{includemime.types;default_typeapplication/octet-stream;log_formatmain'$remote_addr-$remote_user[$time_local]"$request"''$status$body_bytes_sent"$http_referer"''"$http_user_agent""$http_x_forwarded_for"';#access_loglogs/access.logmain;sendfileon;tcp_nopushon;keepalive_timeout0;gzipon;server{listen80;server_namelocalhost;charsetutf-8;access_loglogs/host.access.logmain;location/{roothtml;indexindex.htmlindex.htm;}error_page404/404.html;location/404.html{roothtml;}error_page500502503504/50x.html;location=/50x.html{roothtml;}}}

添加 service 历程打点剧本

#vi /etc/init.d/nginx

#!/bin/sh#chkconfig:23455525#Description:StartupscriptfornginxwebserveronDebian.Placein/etc/init.dand#run'update-rc.d-fnginxdefaults',orusetheappropriatecommandonyour#distro.ForCentOS/Redhatrun:'chkconfig--addnginx'###BEGININITINFO#Provides:nginx#Required-Start:$all#Required-Stop:$all#Default-Start:2345#Default-Stop:016#Short-Description:startsthenginxwebserver#Description:startsnginxusingstart-stop-daemon###ENDINITINFO#Author:licess#website:http://lnmp.orgNAME=nginxNGINX_BIN=/usr/local/lnmp/nginx/sbin/$NAMECONFIGFILE=/usr/local/lnmp/nginx/conf/$NAME.confPIDFILE=/usr/local/lnmp/nginx/logs/$NAME.pidSCRIPTNAME=/etc/init.d/$NAMEcase"$1"instart)echo-n"Starting$NAME..."ifnetstat-tnpl|grep-qnginx;thenecho"$NAME(pid`pidof$NAME`)alreadyrunning."exit1fi$NGINX_BIN-c$CONFIGFILEif["$?"!=0];thenecho"failed"exit1elseecho"done"fi;;stop)echo-n"Stoping$NAME..."if!netstat-tnpl|grep-qnginx;thenecho"$NAMEisnotrunning."exit1fi$NGINX_BIN-sstopif["$?"!=0];thenecho"failed.Useforce-quit"exit1elseecho"done"fi;;status)ifnetstat-tnpl|grep-qnginx;thenPID=`pidofnginx`echo"$NAME(pid$PID)isrunning..."elseecho"$NAMEisstopped"exit0fi;;force-quit)echo-n"Terminating$NAME..."if!netstat-tnpl|grep-qnginx;thenecho"$NAMEisnotrunning."exit1fikill`pidof$NAME`if["$?"!=0];thenecho"failed"exit1elseecho"done"fi;;restart)$SCRIPTNAMEstopsleep1$SCRIPTNAMEstart;;reload)echo-n"Reloadservice$NAME..."ifnetstat-tnpl|grep-qnginx;then$NGINX_BIN-sreloadecho"done"elseecho"$NAMEisnotrunning,can'treload."exit1fi;;configtest)echo-n"Test$NAMEconfigurefiles..."$NGINX_BIN-t;;*)echo"Usage:$SCRIPTNAME{start|stop|force-quit|restart|reload|status|configtest}"exit1;;esac

#chmod +x /etc/init.d/nginx

#chkconfig --add nginx

#service nginx ...

server debug 编译

标题:centos 6.7 x86_64安装nginx

地址: https://www.yunhk.xyz/25806.html