Linux下Nginx安装

(1)、Linux下Nginx的安装:

chmod +x ./nginx-1.0.5.tar.gz

gunzip ./nginx-1.0.5.tar.gz

tar -xvf ./nginx-1.0.5.tar

./configure --prefix=/opt/nginx_installed --with-http_stub_status_module --with-openssl=/opt/nginx-1.0.5/auto/lib/openssl

注意:此配置只引用了http_stub_status_module和openssl,其他module需要引用的话,再加进来。

make

make install

[root@apusicB1 sbin]# ./nginx -t

nginx: the configuration file /opt/nginx_installed/conf/nginx.conf syntax is ok

nginx: configuration file /opt/nginx_installed/conf/nginx.conf test is successful

(2)、Nginx启动、停止、重启

# ./nginx  =>启动

#./nginx -s stop  =>停止

# ./nginx -s reload  =>重启

# kill -QUIT <Main_Pid>  =>cat <nginx_home>/logs/nginx.pid  =>杀掉所有nginx进程

# killall nginx  =>杀掉所有nginx进程

参见:http://nginx.org/en/ 和http://wiki.nginx.org/NginxHttpUpstreamModule

你可能感兴趣的:(nginx,linux)