安裝啟動
檢查 nginx 是否啟動
關閉重啟 nginx
配置檢查
檢視 nginx 版本
yum install gcc openssl openssl-devel pcre pcre-devel zlib zlib-devel -y
解壓
tar -zxvf nginx-...tar.gz
切換到 nginx 主目錄
在 nginx 主目錄下執行命令
# --prefix 是指 nginx 安裝路徑
./configure --prefix=/usr/local/nginx
執行命令進行編譯
make
執行命令進行安裝
切換到 nginx 安裝目錄的 sbin 目錄下,執行:make
install
# /usr/local/nginx/sbin
./nginx
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
通過檢視程序:
nginx 體系結構由 master 程序和某 worker 程序組成。ps -ef |
grep nginx
master 程序讀取配置檔案,並維護 worker 程序,而 worker 程序則對請求進行實際處理。
找出 nginx 程序號
ps -ef |
grep nginx
執行命令
kill -quit 主pid
其中 pid 是主程序號的 pid(master process),其他程序為子程序 pid(worker process)。
找出 nginx 程序號
ps -ef |
grep nginx
執行命令
kill -term 主pid
/usr/local/nginx/sbin/nginx -s reload
當修改 ngnⅸ配置檔案後,可以使用 nginx 命令進行配置檔案語法檢查,用於檢查 nginx 配置檔案是否正確
檢查 nginx 配置檔案是否正確。
/usr/local/nginx/sbin/nginx -c /usr/local nginx/conf/nginx.conf -t
linux 上檢視 nginx版本:
/usr/local/nginx/sbin/nginx -v
linux環境下安裝nginx
目的 安裝nginx 環境 ubuntu server 14.03 效果 安裝 g apt get install g 我把檔案放在我自己的目錄裡 usr share myserver tools 進入該目錄 cd usr share myserver tools解壓 tar xzvf pcre 8...
Linux環境下安裝Nginx
nginx的安裝 1.安裝環境的準備 nginx是c語言開發,建議在linux上執行,這裡使用centos6.4作為安裝環境。gccpcre pcre perlcompatible regular expressions 是乙個perl庫,包括 perl 相容的正規表示式庫。nginx的http模組...
linux環境下安裝nginx
本教程安裝環境 vmware12 cent os 6.5 nginx執行需要依賴一些庫,所以要先安裝庫。gcc pcre pcre perl compatible regular expressions 是乙個perl庫,包括 perl 相容的正規表示式庫。nginx的http模組使用pcre來解析...