国产xxxx99真实实拍_久久不雅视频_高清韩国a级特黄毛片_嗯老师别我我受不了了小说

資訊專欄INFORMATION COLUMN

編譯安裝 Nginx 1.14

shadajin / 1910人閱讀

摘要:編譯安裝所需要的等軟件不再贅述下載解壓切換到解壓后的目錄進行配置添加組添加用戶設置用戶名設置用戶組設置安裝位置用來監控的當前狀態打開功能允許改變客戶端請求頭中或等可用于記錄客戶編譯安裝

編譯安裝所需要的gcc等軟件不再贅述
1.下載Nginx

wget http://nginx.org/download/nginx-1.14.0.tar.gz

2.解壓

tar xf nginx-1.14.0.tar.gz

3.切換到解壓后的目錄, 進行配置

cd nginx-1.14.0

# 添加Nginx組
groupadd nginx    

# 添加Nginx用戶
useradd nginx -g nginx -s /sbin/nologin -M

./configure --user=nginx     # 設置用戶名
            --group=nginx    # 設置用戶組
            --prefix=/usr/local/nginx   # 設置安裝位置
            --with-http_stub_status_module   # 用來監控 Nginx 的當前狀態
            --with-http_ssl_module  # 打開HTTPS功能
            --with-http_realip_module   # 允許改變客戶端請求頭中X-Real-IP 或 X-Forwarded-For等, 可用于記錄客戶IP
            --with-http_gzip_static_module

4.編譯安裝

make && make install

開機啟動和制作啟停工具

將下面的文件, 寫到/etc/init.d/nginx中

#!/bin/bash
# nginx Startup script for the Nginx HTTP Server
#
# chkconfig: - 85 15
# description: Nginx is a high-performance web and proxy server.
# It has a lot of features, but it"s not for everyone.
# processname: nginx
# pidfile: /var/run/nginx.pid
# config: /usr/local/nginx/conf/nginx.conf
nginxd=/usr/local/nginx/sbin/nginx
nginx_config=/usr/local/nginx/conf/nginx.conf
nginx_pid=/usr/local/nginx/nginx.pid

RETVAL=0
prog="nginx"

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

[ -x $nginxd ] || exit 0


# Start nginx daemons functions.
start() {

if [ -e $nginx_pid ];then
   echo "nginx already running...."
   exit 1
fi

   echo -n $"Starting $prog: "
   daemon $nginxd -c ${nginx_config}
   RETVAL=$?
   echo
   [ $RETVAL = 0 ] && touch /var/lock/subsys/nginx
   return $RETVAL

}


# Stop nginx daemons functions.
stop() {
        echo -n $"Stopping $prog: "
        killproc $nginxd
        RETVAL=$?
        echo
        [ $RETVAL = 0 ] && rm -f /var/lock/subsys/nginx /var/run/nginx.pid
}


# reload nginx service functions.
reload() {

    echo -n $"Reloading $prog: "
 $nginxd -s reload
    #if your nginx version is below 0.8, please use this command: "kill -HUP `cat ${nginx_pid}`"
    RETVAL=$?
    echo

}

# See how we were called.
case "$1" in
start)
        start
        ;;

stop)
        stop
        ;;

reload)
        reload
        ;;

restart)
        stop
        start
        ;;

status)
        status $prog
        RETVAL=$?
        ;;
*)
        echo $"Usage: $prog {start|stop|restart|reload|status|help}"
        exit 1
esac

exit $RETVAL

6.添加執行權限

chmod 755 /etc/init.d/nginx

7.開機自啟動

chkconfig --level 345 nginx on

參考文章: https://www.cnblogs.com/lucky...

文章版權歸作者所有,未經允許請勿轉載,若此文章存在違規行為,您可以聯系管理員刪除。

轉載請注明本文地址:http://specialneedsforspecialkids.com/yun/40050.html

相關文章

  • 在OpenSUSE下編譯安裝Nginx

    摘要:準備工作進入繼續操作編譯安裝庫下載安裝高版本會出現錯誤,建議選擇版本低一些,因為暫不支持,可以使用版本。編譯錯誤解決輸入命令,然后重新編譯。安裝庫下載安裝安裝解壓即可編譯安裝常用編譯選項說明指定的安裝目錄。默認情況下,該模塊沒有被構建。 原文來自http://www.hoohack.me/2016/01/27/compile-install-nginx-in-opensuse/ 下載源...

    Soarkey 評論0 收藏0

發表評論

0條評論

shadajin

|高級講師

TA的文章

閱讀更多
最新活動
閱讀需要支付1元查看
<