Linux系列之Nginx安装

1. 下载nginx

本次安装采用nginx-1.15.6版:http://nginx.org/download/nginx-1.15.6.tar.gz

2. 安装依赖

yum install -y pcre pcre-devel
yum install -y zlib zlib-devel
yum install -y openssl openssl-devel

3. 解压安装包

tar -zxvf nginx-1.15.6.tar.gz -C /opt/nginx/

4. 编译安装

cd /opt/nginx/nginx-1.15.6
./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

mkdir /var/temp/nginx/client -p
make
make install 

5. 启动nginx

cd /usr/local/nginx
./sbin/nginx

6. 验证

ps -ef | grep nginx

 

©️2020 CSDN 皮肤主题: 编程工作室 设计师:CSDN官方博客 返回首页