zoukankan      html  css  js  c++  java
  • Linux-编译安装Nginx

    编译安装Nginx

    环境:

    Nginx : Nginx-1.12.0               Server : Centos7.6

    安装:

    [root@localhost ~]# yum -y install pcre-devel zlib-devel gcc*

    [root@localhost ~]# useradd -M -s /sbin/nologin nginx

    [root@localhost ~]# tar zxvf nginx-1.12.0.tar.gz

    [root@localhost ~]# cd nginx-1.12.0/

    [root@localhost nginx-1.12.0]# ./configure --prefix=/usr/local/nginx --user=nginx --group=nginx --with-http_stub_status_module

    [root@localhost nginx-1.12.0]# make && make install

    [root@localhost nginx-1.12.0]# ln -s /usr/local/nginx/sbin/nginx /usr/local/sbin/

    创建服务启动脚本:

    #!/bin/bash

    # chkconfig: - 99 20

    # description: Nginx Server Control Script

    PROG="/usr/local/nginx/sbin/nginx"

    PIDF="/usr/local/nginx/logs/nginx.pid"

    case "$1" in

    start)

       $PROG

      ;;

    stop)

      kill -s QUIT $(cat $PIDF)

      ;;

    restart)

      $0 stop

      $0 start

      ;;

    reload)

      kill -s HUP $(cat $PIDF)

      ;;

    status)

      [ -f $PID ] &> /dev/null

           if [ $? -eq 0 ]

              then

              netstat  -anpt | grep nginx

           else

              echo "Nginx is not running."

            fi  

      ;;

    *)

      echo "Usage: $0 {start|stop|restart|reload|status}"

    esac

    exit 0

     

    [root@localhost ~]# chmod +x /etc/init.d/nginx

    [root@localhost ~]# chkconfig --add nginx

    [root@localhost ~]# systemctl status nginx

    [root@localhost ~]# systemctl restart nginx

  • 相关阅读:
    卷积神经网络
    自适应学习率调整:AdaDelta
    协同过滤推荐算法总结
    深入FM和FFM原理与实践
    一些关于量化交易的书籍清单(转)
    矩阵分解在协同过滤推荐算法中的应用
    交替最小二乘ALS
    Mocha的单元测试实战
    Fis3前端工程化之项目实战
    Fis3的前端工程化之路[三大特性篇之声明依赖]
  • 原文地址:https://www.cnblogs.com/Vampire-MIn/p/13073429.html
Copyright © 2011-2022 走看看