Nginx在Liunx下的安装

一、依赖环境的安装

1、 yum本地安装

 yum -y install gcc gcc-c++ make automake autoconf pcre pcre-devel zlib zlib-devel openssl openssl-devel libtool

 

2、下载解压安装Nginx

安装包网址
http://nginx.org/download/nginx-1.14.0.tar.gz

3、生成Makefile文件

./configure  --prefix=/usr/local/nginx  --sbin-path=/usr/local/nginx/sbin/nginx --conf-path=/usr/local/nginx/conf/nginx.conf --error-log-path=/var/log/nginx/error.log  --http-log-path=/var/log/nginx/access.log  --pid-path=/var/run/nginx/nginx.pid --lock-path=/var/lock/nginx.lock  --user=nginx --group=nginx --with-http_ssl_module --with-http_stub_status_module --with-http_gzip_static_module --http-client-body-temp-path=/var/tmp/nginx/client/ --http-proxy-temp-path=/var/tmp/nginx/proxy/ --http-fastcgi-temp-path=/var/tmp/nginx/fcgi/ --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi --http-scgi-temp-path=/var/tmp/nginx/scgi --with-pcre

完成

4、安装:make install

 

5、启动、停止Nginx服务
/usr/local/nginx/sbin/nginx
/usr/local/nginx/sbin/nginx -s stop      停止Nginx服务
/usr/local/nginx/sbin/nginx -s reload     重启Nginx服务

原因:没有Nginx 用户

建立Nginx用户

 

 进程查看

 6、在浏览器中打开

猜你喜欢

转载自blog.csdn.net/the_shy369/article/details/127513280
今日推荐