编写nginx启动剧本,并插手系统处事#vim/etc/init.d/nginx//编写nginx启动剧本,插手系统处事。写入以下内容#!/bin/bash#chkconfig:-3021#description:httpservice.#SourceFunctionLibrary./etc/init.d/functions#NginxSettingsNGINX_SBIN="/usr/local/nginx/sbin/nginx"NGINX_CONF="/usr/local/nginx/conf/nginx.conf"NGINX_PID="/usr/local/nginx/logs/nginx.pid"RETVAL=0prog="Nginx"start(){echo-n$"Starting$prog:"mkdir-p/dev/shm/nginx_tempdaemon$NGINX_SBIN-c$NGINX_CONFRETVAL=$?echoreturn$RETVAL}stop(){echo-n$"Stopping$prog:"killproc-p$NGINX_PID$NGINX_SBIN-TERMrm-rf/dev/shm/nginx_tempRETVAL=$?echoreturn$RETVAL}reload(){echo-n$"Reloading$prog:"killproc-p$NGINX_PID$NGINX_SBIN-HUPRETVAL=$?echoreturn$RETVAL}restart(){stopstart}configtest(){$NGINX_SBIN-c$NGINX_CONF-treturn0}case"$1"instart)start;;stop)stop;;reload)reload;;restart)restart;;configtest)configtest;;*)echo$"Usage:$0{start|stop|reload|restart|configtest}"RETVAL=1esacexit$RETVAL#chmod755/etc/init.d/nginx//生存后修改权限#chkconfig--addnginx//启动nginx#chkconfignginxon//执行后开机启动变动nginx设置#>/usr/local/nginx/conf/nginx.conf//首先把本来设置文件清空#vim/usr/local/nginx/conf/nginx.conf//写入以下内容usernobodynobody;worker_processes2;error_log/usr/local/nginx/logs/nginx_error.logcrit;pid/usr/local/nginx/logs/nginx.pid;worker_rlimit_nofile51200;events{useepoll;worker_connections6000;}http{includemime.types;default_typeapplication/octet-stream;server_names_hash_bucket_size3526;server_names_hash_max_size4096;log_formatcombined_realip'$remote_addr$http_x_forwarded_for[$time_local]''$host"$request_uri"$status''"$http_referer""$http_user_agent"';sendfileon;tcp_nopushon;keepalive_timeout30;client_header_timeout3m;client_body_timeout3m;send_timeout3m;connection_pool_size256;client_header_buffer_size1k;large_client_header_buffers84k;request_pool_size4k;output_buffers432k;postpone_output1460;client_max_body_size10m;client_body_buffer_size256k;client_body_temp_path/usr/local/nginx/client_body_temp;proxy_temp_path/usr/local/nginx/proxy_temp;fastcgi_temp_path/usr/local/nginx/fastcgi_temp;fastcgi_intercept_errorson;tcp_nodelayon;gzipon;gzip_min_length1k;gzip_buffers48k;gzip_comp_level5;gzip_http_version1.1;gzip_typestext/plainapplication/x-javascripttext/csstext/htmapplication/xml;include/usr/local/nginx/conf/vhosts/*.conf;}#/usr/local/nginx/sbin/nginx–t//检测设置是否正确#servicenginxrestart//重启nginx#mkdir/usr/local/nginx/conf/vhosts#cd!$//进入上面输入的目次#vimdefault.conf//插手如下设置server{listen80default_server;server_namewww.111.com;indexindex.htmlindex.htmindex.php;root/tmp/tmp;denyall;}#vimtest.conf//插手如下设置server{listen80;server_namewww.test.com;indexindex.htmlindex.htmindex.php;root/data/www;location~.php${includefastcgi_params;fastcgi_passunix:/tmp/php-fcgi.sock;fastcgi_indexindex.php;fastcgi_paramSCRIPT_FILENAME/data/www$fastcgi_script_name;}}#/etc/init.d/nginxreload//从头加载,并未重启处事
,美国云服务器韩国vps云主机
序列号 | 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 | 立即申请 |