yum -y install gcc gcc-c++ kernel-devel
yum -y install pcre-devel
yum -y install openssl openssl-devel
./configure --without-http_upstream_keepalive_module --add-module=modules/ngx_backtrace_module --add-module=modules/ngx_debug_pool --add-module=modules/ngx_debug_timer --add-module=modules/ngx_http_concat_module --add-module=modules/ngx_http_footer_filter_module --add-module=modules/ngx_http_proxy_connect_module --add-module=modules/ngx_http_reqstat_module --add-module=modules/ngx_http_slice_module --add-module=modules/ngx_http_sysguard_module --add-module=modules/ngx_http_trim_filter_module --add-module=modules/ngx_http_upstream_check_module --add-module=modules/ngx_http_upstream_consistent_hash_module --add-module=modules/ngx_http_upstream_dynamic_module --add-module=modules/ngx_http_upstream_dyups_module --add-module=modules/ngx_http_upstream_keepalive_module --add-module=modules/ngx_http_upstream_session_sticky_module --add-module=modules/ngx_http_user_agent_module
make && make install
查看有哪些可用模塊nginx
nginx -mc++
查看已經編譯的參數以及當前版本session
nginx -V測試
從新載入nginx(當配置信息發生修改時)debug
nginx -s reloadcode
查看nginx的配置文件的目錄,配置文件正確性測試進程
nginx -tssl
查看幫助信息get
nginx -hopenssl
啓動nginx
nginx -c /path/to/nginx.conf
關閉nginx
ps -ef | grep nginx kill -QUIT 主進程號 #從容中止Nginx kill -TERM 主進程號 #快速中止Nginx pkill -9 nginx #強制中止Nginx