解压并安装Nginx:
[root@clone1 nginx-1.8.1]# tar xf nginx-1.8.1.tar.gz
[root@clone1 nginx-1.8.1]# cd nginx-1.8.1
[root@clone1 nginx-1.8.1]# ./configure --prefix=/usr/local/nginx --user=nginx --group=nginx --with-http_stub_status_module --with-http_ssl_module
make && make install
--prefix=/usr/local/nginx #指定安装路径
--with-http_stub_status_module #声明启用service status页,默认不启用
--with-http_ssl_module #启用ssl模块,以支持https请求
启动:
[root@clone1 nginx-1.8.1]# /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
查看启动状态:
[root@clone1 nginx-1.8.1]# netstat -tanp|grep 80
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 5535/nginx
原文地址:http://blog.51cto.com/13553337/2097180