1.环境准备
确认系统属否安装了gcc、pcre-devel、zlib-devel、openssl-devel
# yum -y install gcc pcre-devel zlib-devel openssl openssl-devel
2.安装nginx
# yum install nginx
查看版本
# nginx -v
查看编译参数
# nginx -V
查看路径
# rpm -ql nginx
3.nginx操作
启动
# /usr/sbin/nginx
停止
# /usr/sbin/nginx -s stop
重启
# /usr/sbin/nginx -s reload
4.开机自启
# vim /etc/rc.d/rc.local
/usr/sbin/nginx #最后一行新增
5.安装成功
浏览地址访问IP