ngnix 系列一 安裝

2021-08-20 14:42:44 字數 1440 閱讀 5639

安裝準備: nginx依賴於pcre庫,要先安裝pcre

yum install pcre pcre-devel

cd /usr/local/src/

wget

tar zxvfnginx-1.4.2.tar.gz

cd nginx-1.4.2

./configure --prefix=/usr/local/nginx

make && make install

啟動:cd /ulsr/local/nginx, 看到如下4個目錄

....conf配置檔案 

... html網頁檔案

...logs  日誌檔案

...sbin  主要二進位制程式

[root@localhost nginx]# ./sbin/nginx

nginx: [emerg] bind() to 0.0.0.0:80 failed(98: address already in use)

nginx: [emerg] bind() to 0.0.0.0:80 failed(98: address already in use)

nginx: [emerg] still could not bind()

不能繫結80埠,80埠已經被占用

(有時是自己裝了apache,nginx等,還有更多情況是作業系統自帶了apache並作為服務啟動)

解決: 把占用80埠的軟體或服務關閉即可.

nginx的訊號控制

term, int

quick shutdown

quit

graceful shutdown  

優雅的關閉程序

,即等請求結束後再關閉

hupconfiguration reload ,start the new worker processes with

a new configuration gracefully shutdown the old worker processes

改變配置檔案

,平滑的重讀配置檔案

usr1

reopen the log files

重讀日誌

,在日誌按月

/日分割時有用

usr2

upgrade executable on the fly

平滑的公升級

winch

gracefully shutdown the worker processes

優雅關閉舊的程序(配合

usr2

來進行公升級

)具體語法:

kill -訊號選項 nginx的主程序號

kill -hup 4873

kill -訊號控制 `cat/***/path/log/nginx.pid`

kil; -usr1 `cat /***/path/log/nginx.pid`

ngnix 安裝筆記

yum update 更新系統類庫 yum install gcc 安裝ngnix 依賴包 安裝pcre庫 cd usr local wget tar zxvf pcre 8.40.tar.gz cd pcre 8.40 configure make make install 安裝zlib庫 cd ...

ngnix的安裝小記

nginx安裝手冊 nginx是c語言開發,建議在linux上執行,本教程使用centos6.5作為安裝環境。n gcc n pcre pcre perlcompatible regular expressions 是乙個perl庫,包括 perl 相容的正規表示式庫。nginx的http模組使用p...

Ngnix安裝及配置

提取碼 r18k 確認環境 1 gcc gcc c 安裝 檢視系統是否安裝了gcc和gcc c rpm q gcc rpm q gcc c rpm q make 如果未安裝如下 需要安裝掛載yum安裝如下安裝方式 yum install gcc c 無網路安裝本地yum redhat本地yum雲安裝...