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