前置环境安装
yum -y install pcre-devel zlib-devel
移动nginx目录位置
mv nginx-1.9.9 /usr/local/nginx
编译
./configure --prefix=/usr/local/nginx --conf-path=/usr/local/nginx/nginx.conf
安装
make && make install
启动nginx
sbin/nginx -c /usr/local/nginx/nginx.conf
curl 127.0.0.1
Welcome to nginx!
If you see this page, the nginx web server is successfully installed and working. Further configuration is required.
For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.
Thank you for using nginx.
停止nginx
sbin/nginx -s stop