zoukankan      html  css  js  c++  java
  • ubuntu16.04 安装nginx

    ubuntu 16.04:

    安装gcc g++的依赖库
    sudo apt-get install build-essential
    sudo apt-get install libtool

    安装pcre依赖库(http://www.pcre.org/)
    sudo apt-get update
    sudo apt-get install libpcre3 libpcre3-dev

    安装zlib依赖库(http://www.zlib.net)
    sudo apt-get install zlib1g-dev

    安装openssl
    apt-get install openssl libssl-dev

    tar -xvf nginx...

    隐藏版本号

    ./configure --prefix=/usr/local/nginx --with-http_dav_module --with-http_stub_status_module --with-http_addition_module --with-http_sub_module --with-http_flv_module --with-http_mp4_module --with-pcre --with-http_ssl_module --with-http_gzip_static_module --user=nginx --group=nginx

    make
    sudo make install

    sudo ln -s /usr/local/nginx/sbin/nginx /usr/local/sbin/ 

    sudo groupadd nginx
    sudo useradd -r -g nginx -s /bin/false nginx

    sudo groupadd www
    sudo useradd -r -g www -s /bin/false www

    作为service

    Save this file as /lib/systemd/system/nginx.service

    [Unit]
    Description=The NGINX HTTP and reverse proxy server
    After=syslog.target network.target remote-fs.target nss-lookup.target

    [Service]
    Type=forking
    PIDFile=/usr/local/nginx/logs/nginx.pid
    ExecStartPre=/usr/local/sbin/nginx -t
    ExecStart=/usr/local/sbin/nginx
    ExecReload=/usr/local/sbin/nginx -s reload
    ExecStop=/bin/kill -s QUIT $MAINPID
    PrivateTmp=true

    [Install]
    WantedBy=multi-user.target

    sudo systemctl unmask nginx.service

  • 相关阅读:
    MySQL教程22-字符串类型
    MySQL教程21-日期和时间类型
    MySQL教程20-小数类型
    MySQL教程19-整数类型
    MySQL教程18-数据类型简介
    ActiveMQ_topic
    ActiveMQ_消费者编码
    ActiveMQ_生产者编码
    ActiveMQ介绍
    管理docker容器
  • 原文地址:https://www.cnblogs.com/sanmubai/p/9377814.html
Copyright © 2011-2022 走看看