useradd nginx
passwd nginx
yum install pcre pcre-devel
tar -zxvf nginx-1.8.0.tar.gz
cd nginx-1.8.0
./configure --prefix=/app/nginx-1.8.0 --user=nginx --group=nginx --with-http_ssl_module --with-http_stub_status_module
make
make install
cd /app/nginx-1.8.0/
cd sbin/
./nginx -t 测试nginx 配置文件
[root@hdp-03 sbin]# ./nginx
[root@hdp-03 sbin]#
[root@hdp-03 sbin]# ps -ef|grep nginx
root 32547 1 0 23:52 ? 00:00:00 nginx: master process ./nginx
nginx 32548 32547 0 23:52 ? 00:00:00 nginx: worker process
root 32561 2532 0 23:52 pts/0 00:00:00 grep nginx
配置文件去掉
# 注释
空行
cat /usr/local/nginx/conf/nginx.conf|grep -v '#'|grep -v '^$'
# upstream 轮询算法,权重weight 一致
本站文章如无特殊说明,均为本站原创,如若转载,请注明出处:最简单nginx配置 - Python技术站