Linux 安装ngnix

第一步:把nginx的源码包上传到linux系统/home

第二步:解压缩

[root@localhost ~]# tar zxf nginx-1.8.0.tar.gz

第三步:使用configure命令创建一makeFile文件。

./configure \

--prefix=/usr/local/nginx \

--pid-path=/var/run/nginx/nginx.pid \

--lock-path=/var/lock/nginx.lock \

--error-log-path=/var/log/nginx/error.log \

--http-log-path=/var/log/nginx/access.log \

--with-http_gzip_static_module \

--http-client-body-temp-path=/var/temp/nginx/client \

--http-proxy-temp-path=/var/temp/nginx/proxy \

--http-fastcgi-temp-path=/var/temp/nginx/fastcgi \

--http-uwsgi-temp-path=/var/temp/nginx/uwsgi \

--http-scgi-temp-path=/var/temp/nginx/scgi

注意:启动nginx之前,上边将临时文件目录指定为/var/temp/nginx,需要在/var下创建temp及nginx目录

[root@localhost sbin]# mkdir /var/temp/nginx/client –p,这里的-p就是递归创建目录

第四步:make

第五步:make install

启动ngnix路径:

/usr/local/nginx/sbin,启动命令为./ngnix
关闭命令为:./ngnix -s quit
启动状态下刷新配置文件:./ngnix -s reload

猜你喜欢

转载自www.cnblogs.com/PengChengLi/p/9076713.html