激战的后厨2观看完整版,強姦亂倫強姦在线观看,国产无套内射普通话对白,老头呻吟喘息硕大撞击,他扒开我小泬添我三男一女视频

首頁>云服務器問答/資訊>Centos7如何安裝nginx

Centos7如何安裝nginx

發布時間:2023/4/17 10:43:04

Centos7如何安裝nginx

Centos如何安裝nginx?本教(jiao)程以centos7系(xi)統為例

本配置適(shi)用于centos7版本

1.安裝vim編(bian)輯工具(ju)

yum install vim -y

2.安裝(zhuang)lrzsz上傳工具

yum install lrzsz -y

Centos7如何安裝nginx-2412

安裝完后可以使用rz命令上(shang)傳所需要(yao)的(de)軟件工具(最好進入家目錄/home在上(shang)傳方便(bian)以后查找)

Centos7如何安裝nginx-2413

3.指(zhi)定(ding)環境(jing)版本和上(shang)傳環境(jing)安(an)裝包

nginx-1.12.2.tar(具體版本(ben)不一定,這邊只是隨(sui)機安裝1個(ge)版本(ben),具體看需要什(shen)么版本(ben))

4.安裝關聯包

yum -y install pcre-devel

yum -y install openssl openssl-devel

yum -y install gcc-c

5.安裝nginx-1.12.2.tar

6.進入上傳文件目(mu)錄解壓(ya)nginx-1.12.2.tar文件

[root@vt178m5c home]# tar -zxvf nginx-1.12.2.tar.gz

7.進入nginx-1.12.2解壓文件開始編譯安裝nginx

[root@vt178m5c home]# cd nginx-1.12.2

[root@vt178m5c nginx-1.12.2]# ./configure --prefix=/usr/local/nginx \

> --with-http_stub_status_module \

> --with-http_gzip_static_module \

> --with-http_flv_module \

> --with-http_ssl_module \

> --http-client-body-temp-path=/usr/local/nginx/client_body_temp \

> --http-fastcgi-temp-path=/usr/local/nginx/fastcgi_temp \

> --http-proxy-temp-path=/usr/local/nginx/proxy_temp \

> --http-uwsgi-temp-path=/usr/local/nginx/uwsgi_temp \

> --http-scgi-temp-path=/usr/local//nginx/scgi_temp

8.編譯(yi)完(wan)確認沒有報(bao)錯后開始安裝nginx

[root@vt178m5c nginx-1.12.2]# make && make install

9.修改nginx配置文件

[root@vt178m5c nginx-1.12.2]# vim /usr/local/nginx/conf/nginx.conf

找到

#error_log logs/error.log;

#access_log logs/access.log main;

取消注釋與修改

error_log logs/error.log;

access_log logs/access.log ;

找到

index index.html index.htm;

修改為

index index.php index.html index.htm;

找到

Centos7如何安裝nginx-2414

取消注(zhu)釋, /scripts$fastcgi_script_name;修改為$document_root$fastcgi_script_name;

Centos7如何安裝nginx-2415

這(zhe)個配(pei)置(zhi)的意(yi)思是 在瀏(liu)覽器中(zhong)訪(fang)問(wen)(wen)的.php文件(jian),實際讀取(qu)的是 $document_root(網站根(gen)目(mu)錄)下(xia)的.php文件(jian) -- 也就(jiu)是說當訪(fang)問(wen)(wen)127.0.0.1/index.php的時候(hou),需要讀取(qu)網站根(gen)目(mu)錄下(xia)面的index.php文件(jian),如果沒(mei)有配(pei)置(zhi)這(zhe)一(yi)配(pei)置(zhi)項時,nginx不會去網站根(gen)目(mu)錄下(xia)訪(fang)問(wen)(wen).php文件(jian),所以返(fan)回空白

配置項目中:include fastcgi_params; fastcgi_params 文件中含有各個nginx常量的定義,默(mo)認(ren)情(qing)況 SCRIPT_FILENAME = $fastcgi_script_name

10.編寫nginx啟動(dong)腳本

[root@vt178m5c nginx-1.12.2]# vim /etc/init.d/nginx

腳本代碼:

#! /bin/bash

#chkconfig: 2345 80 90

#description:nginx run

# nginx啟動(dong)腳本

# @author liut

# @version 0.0.1

# @date 2018-2-9

PATH=/usr/local/nginx/conf

DESC="nginx daemon"

NAME=nginx

DAEMON=/usr/local/nginx/sbin/nginx

CONFIGFILE=$PATH/$NAME.conf

PIDFILE=$PATH/$NAME.pid

SCRIPTNAME=/etc/init.d/$NAME

set -e

[ -x "$DAEMON" ] || exit 0

do_start()

{

$DAEMON -c $CONFIGFILE || echo -n "nginx already running"

}

do_stop()

{

$DAEMON -s stop || echo -n "nginx not running"

}

do_reload()

{

$DAEMON -s reload || echo -n "nginx can't reload"

}

case "$1" in

start)

echo -n "Starting $DESC: $NAME"

do_start

echo "."

;;

stop)

echo -n "Stopping $DESC: $NAME"

do_stop

echo "."

;;

reload|graceful)

echo -n "Reloading $DESC configuration..."

do_reload

echo "."

;;

restart)

echo -n "Restarting $DESC: $NAME"

do_stop

do_start

echo "."

;;

*)

echo "Usage: $SCRIPTNAME {start|stop|reload|restart}" >&2

exit 3

;;

esac

exit 0

11.編寫完腳本(ben)記得(de)修改(gai)下腳本(ben)權限

12.nginx啟動|停止|重啟

[root@vt178m5c nginx-1.12.2]# /etc/init.d/nginx start 啟動(dong)

[root@vt178m5c nginx-1.12.2]# /etc/init.d/nginx stop 停止

[root@vt178m5c nginx-1.12.2]# /etc/init.d/nginx restart 重啟

在線客服
微信公眾號
免費撥打0592-5580190
免費撥打0592-5580190 技術熱線 0592-5580190 或 18950029502
客服熱線 17750597993
返回頂部
返回頭部 返回頂部