nginx linux安装说明

1.官网现下载稳定的nginx版本

2.上传到需要安装的nginx的系统上

3.安装nginx相关的组件

    1.gcc环境安装:  yum install gcc-c++
    2. 安装pcre环境,用户正则表达式解析:yum install -y pcre pcre-devel

    3.zip包的压缩与解压: yum install -y zlib zlib-devel

   4.SSL安全的加密的套接字协议,用于HTTP安全传输,也就是Https; yum install -y openssl openssl-devel

4.解压上传的nginx压缩包;解压命令:tar  -zxvf nginx-1.16.1.tar.gz

5.创建nginx临时目录:mkdir /var/temp/nginx -p

6.在nginx目录,输入以下命令进行配置,其目的是为了创建makefile文件

./configure \n    --prefix=/usr/local/nginx \n    --pid-path=/var/run/nginx/nginx.pid \n    --lock-path=/var/lock/nginx.lock \n    --error-log-path=/var/log/nginx/error.log \n    --http-log-path=/var/log/nginx/access.log \n    --with-http_gzip_static_module \n    --http-client-body-temp-path=/var/temp/nginx/client \n    --http-proxy-temp-path=/var/temp/nginx/proxy \n    --http-fastcgi-temp-path=/var/temp/nginx/fastcgi \n    --http-uwsgi-temp-path=/var/temp/nginx/uwsgi \n    --http-scgi-temp-path=/var/temp/nginx/scgi
 

命令说明如下:

7.编译,进入nginx的目录sbin下,执行命令:make

8.安装,执行命令:make install

9.启用nginx,进入到目录sbin下,启动执行:./nginx。重启: ./nginx -s reload;  停止:./nginx -s stop

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章