centos7下nginx的編譯安裝

1.軟件包準備,注意版本號,不要嘗試新版本,新的版本我這裏make的時候會出錯
nginx-1.10.1.tar.gz
openssl-1.0.1t.tar.gz
pcre-8.39.tar.bz2

zlib128.zip

點擊下載所需壓縮包


解壓上面的軟件包到指定目錄
我這裏統一解壓到了我的用戶目錄新建的live文件夾下
/home/webrtc/live/


2.操作系統我這裏採用的centos7
//安裝pcre-devel,否則會make出錯
->yum install pcre-devel
//進入到ngnix解壓後的源碼目錄
->cd home/username/live/nginx_解壓目錄
//配置nginx
->./configure --prefix=/usr/local/nginx --with-pcre=/home/webrtc/live/pcre --with-zlib=/home/webrtc/live/zlib --with-openssl=/home/webrtc/live/openssl

–with-pcre是指需要pcre庫,/path/to/your/pcre/是指的pcre源代碼路徑,其他的同理。
其中–prefix是指定你執行make install後nginx的安裝目錄(不是你解壓的nginx源碼目錄),

3.->make

4.->make install


5.執行下面的命令看到進程出現,證明安裝成功了
[root@localhost conf]# ps -ef | grep nginx
root      60091      1  0 23:13 ?        00:00:00 nginx: master process ./nginx
nobody    60092  60091  0 23:13 ?        00:00:00 nginx: worker process

root      60291  18983  0 23:19 pts/1    00:00:00 grep --color=auto nginx


發佈了38 篇原創文章 · 獲贊 11 · 訪問量 6萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章