1、安装
wgethttp://nginx.org/download/nginx-1.10.1.tar.gz
2、编译环境:
yum install gcc-c++
yum -y install zlib zlib-devel openssl openssl--devel pcre pcre-devel
yum -y install pcre* zlib*
yum -y install openssl*
yum -y install pcre*
3、检查卸载
find -name nginx
卸载原有的Nginx:yum remove nginx
3、
// tar zxvf nginx-1.10.1.tar.gz
// ./configure && make && make install
4、配置
cd /usr/local/nginx
解决Nginx出现403 forbidden
http://blog.csdn.net/onlysunnyboy/article/details/75270533
一、由于启动用户和nginx工作用户不一致所致
1.1查看nginx的启动用户,发现是nobody,而为是用root启动的
2将nginx.config的user改为和启动用户root一致,
命令:vi conf/nginx.conf
chmod -R 777 /data
chmod -R 777 /data/www/
./nginx
./nginx -s reload
5、常用指令
nginx -s start
nginx -s reload
nginx -s quit
nginx stop
nginx -s stop