yum install -y pcre pcre-devel openssl openssl-devel gcc gcc-c++ ncurses-devel perl wget useradd nginx -s /sbin/nologin -M iptables -F setenforce 0cd /usr/local/src wget http://files.cnblogs.com/files/pzk7788/nginx-1.6.3.tar.gz tar xf nginx-1.6.3.tar.gz cd nginx-1.6.3./configure --user=nginx --group=nginx --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module make && make install cd .. /usr/local/nginx/sbin/nginx
说明:
(1) pcre :使 Nginx 支持 rewrite(重定向)
(2) openssl :使 Nginx 支持 https
(3) --user :指定运行 Nginx 进程的用户
(4) --group :指定运行 Nginx 进程的用户组
(5) --prefix :指定 Nginx 的安装目录
(6) --with-http_stub_status_module :激活状态信息
(7) --with-http_ssl_module :激活 SSL 功能