centos7.2 nginx-1.13.7安装概要

1. 直接下载.tar.gz安装包,地址:https://nginx.org/en/download.html, 下载nginx-1.13.7.tar.gz

    使用wget命令下载  

            wget -c http://nginx.org/download/nginx-1.13.7.tar.gz

2. 解压 

           [root@local tools]# tar -zxvfnginx-1.13.7.tar.gz

3. 进入解压后的目录

           [root@local tools]# cd nginx-1.13.7

4.编译安装

            [root@local nginx-1.13.7]# ./configure

            [root@local nginx-1.13.7]# make

            [root@local nginx-1.13.7]# make install

5. 开端口

            [root@local  nginx-1.13.7]# firewall-cmd --state

                not running

            [root@local  nginx-1.13.7]# service firewalld restart

                Redirecting to /bin/systemctl restart  firewalld.service

            [root@local  nginx-1.13.7]# firewall-cmd --zone=public--add-port=80/tcp --permanent

                success

            [root@local  nginx-1.13.7]# firewall-cmd --permanent--list-port

                80/tcp 

            [root@local  nginx-1.13.7]# service firewalld restart

                Redirecting to /bin/systemctl restart  firewalld.service

            [root@local  nginx-1.13.7]# systemctl stopfirewalld.service


6. 启动,关闭nginx

  

查看安装位置:[root@local  nginx-1.13.7]# whereis nginx

nginx: /usr/local/nginx

[root@local  nginx-1.13.7]# cd /usr/local/nginx/sbin/

启动:[root@local  sbin]# ./nginx

停止:[root@local  sbin]# ./nginx -s stop

7. 安装过程中,有可能需要安装依赖项:

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

   yum install -y openssl openssl-devel


8. 命令执行顺序一般如下:

  

    tar -zxvf nginx-1.13.7.tar.gz

    cd nginx-1.13.7

    yum install -y pcre pcre-devel

    yum install -y zlib zlib-devel

    yum install -y openssl openssl-devel

    ./configure

    make

    make install

    firewall-cmd --state

    service firewalld restart

    firewall-cmd --zone=public --add-port=80/tcp--permanent

    firewall-cmd --permanent --list-port

    service firewalld restart

    systemctl stop firewalld.service

    ps aux|grep nginx

    whereis nginx

    cd /usr/local/nginx/sbin/

    ./nginx

    ./nginx-s stop


参考:http://www.linuxidc.com/Linux/2016-09/134907.htm
         http://www.linuxidc.com/Linux/2016-08/134450.htm



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值