nginx-1.13.x源碼安裝

Nginx 安裝配置

【依賴庫】
[ zlib ]
(下載)http://download.chinaunix.net/download.php?id=24013&ResourceID=12241
[ pcre ]
apt-get install libpcre-dev
[ openssl ]
(下載)http://download.chinaunix.net/download.php?id=39379&ResourceID=11

【configure】
[ 編譯命令 ]
./configure 
--prefix=/work/nginx/ 
--with-pcre 
--with-http_ssl_module 
--with-openssl=/usr/local/ssl	
#--with-zlib=/usr/local/zlib 	#此處會導致 make distclean 異常


[ 成功提示 ]
creating objs/MakefileConfiguration summary+ using system PCRE library+ using OpenSSL library: /usr/local/ssl+ using zlib library: /usr/local/zlibnginx path prefix: "/work/nginx/"nginx binary file: "/work/nginx//sbin/nginx"nginx modules path: "/work/nginx//modules"nginx configuration prefix: "/work/nginx//conf"nginx configuration file: "/work/nginx//conf/nginx.conf"nginx pid file: "/work/nginx//logs/nginx.pid"nginx error log file: "/work/nginx//logs/error.log"nginx http access log file: "/work/nginx//logs/access.log"nginx http client request body temporary files: "client_body_temp"nginx http proxy temporary files: "proxy_temp"nginx http fastcgi temporary files: "fastcgi_temp"nginx http uwsgi temporary files: "uwsgi_temp"nginx http scgi temporary files: "scgi_temp"	


【 make 錯誤 】
[ .openssl 目錄問題 ]
/bin/sh: line 2: ./config: No such file or directory
make[1]: *** [/usr/local/ssl/.openssl/include/openssl/ssl.h] Error 127
make[1]: Leaving directory `/usr/local/src/nginx-1.9.9'
make: *** [build] Error 2	

[ 解決方式 ]
修改文件:/usr/local/src/nginx-1.9.9/auto/lib/openssl/conf
找到:
CORE_INCS="$CORE_INCS $OPENSSL/.openssl/include"
CORE_DEPS="$CORE_DEPS $OPENSSL/.openssl/include/openssl/ssl.h"
CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libssl.a"
CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libcrypto.a"
CORE_LIBS="$CORE_LIBS $NGX_LIBDL"	

替換為:
CORE_INCS="$CORE_INCS $OPENSSL/include"
CORE_DEPS="$CORE_DEPS $OPENSSL/include/openssl/ssl.h"
CORE_LIBS="$CORE_LIBS $OPENSSL/lib/libssl.a"
CORE_LIBS="$CORE_LIBS $OPENSSL/lib/libcrypto.a"
CORE_LIBS="$CORE_LIBS $NGX_LIBDL"	

其實就是去掉 .openssl 目錄。

[ make distclean ]
make -f objs/Makefile
make[1]: Entering directory `/home/newton/nginx-1.13.4'
cd /usr/local/zlib \&& make distclean \&& CFLAGS="-O2 -fomit-frame-pointer -pipe " CC="cc" \./configure \&& make libz.a
/bin/sh: 3: Syntax error: "&&" unexpected
make[1]: *** [/usr/local/zlib/libz.a] Error 2
make[1]: Leaving directory `/home/newton/nginx-1.13.4'
make: *** [build] Error 2

[ 解決方案 ]
將 configure 的編輯模塊中,去掉 --with-zlib
** 如果有其它解決方案,歡迎分享 **

【make & make install】
[ make ]
	objs/src/http/modules/ngx_http_upstream_zone_module.o \objs/ngx_modules.o \-ldl -lpthread -lcrypt -lpcre /usr/local/openssl/lib/libssl.a /usr/local/openssl/lib/libcrypto.a -ldl -lz \-Wl,-E
sed -e "s|%%PREFIX%%|/work/nginx/|" \-e "s|%%PID_PATH%%|/work/nginx//logs/nginx.pid|" \-e "s|%%CONF_PATH%%|/work/nginx//conf/nginx.conf|" \-e "s|%%ERROR_LOG_PATH%%|/work/nginx//logs/error.log|" \< man/nginx.8 > objs/nginx.8
make[1]: Leaving directory `/home/newton/nginx-1.13.4'	


[ make install ]
make -f objs/Makefile install
make[1]: Entering directory `/home/newton/nginx-1.13.4'
test -d '/work/nginx/' || mkdir -p '/work/nginx/'
test -d '/work/nginx//sbin' \|| mkdir -p '/work/nginx//sbin'
test ! -f '/work/nginx//sbin/nginx' \|| mv '/work/nginx//sbin/nginx' \'/work/nginx//sbin/nginx.old'
cp objs/nginx '/work/nginx//sbin/nginx'
test -d '/work/nginx//conf' \|| mkdir -p '/work/nginx//conf'
cp conf/koi-win '/work/nginx//conf'
cp conf/koi-utf '/work/nginx//conf'
cp conf/win-utf '/work/nginx//conf'
test -f '/work/nginx//conf/mime.types' \|| cp conf/mime.types '/work/nginx//conf'
cp conf/mime.types '/work/nginx//conf/mime.types.default'
test -f '/work/nginx//conf/fastcgi_params' \|| cp conf/fastcgi_params '/work/nginx//conf'
cp conf/fastcgi_params \'/work/nginx//conf/fastcgi_params.default'
test -f '/work/nginx//conf/fastcgi.conf' \|| cp conf/fastcgi.conf '/work/nginx//conf'
cp conf/fastcgi.conf '/work/nginx//conf/fastcgi.conf.default'
test -f '/work/nginx//conf/uwsgi_params' \|| cp conf/uwsgi_params '/work/nginx//conf'
cp conf/uwsgi_params \'/work/nginx//conf/uwsgi_params.default'
test -f '/work/nginx//conf/scgi_params' \|| cp conf/scgi_params '/work/nginx//conf'
cp conf/scgi_params \'/work/nginx//conf/scgi_params.default'
test -f '/work/nginx//conf/nginx.conf' \|| cp conf/nginx.conf '/work/nginx//conf/nginx.conf'
cp conf/nginx.conf '/work/nginx//conf/nginx.conf.default'
test -d '/work/nginx//logs' \|| mkdir -p '/work/nginx//logs'
test -d '/work/nginx//logs' \|| mkdir -p '/work/nginx//logs'
test -d '/work/nginx//html' \|| cp -R html '/work/nginx/'
test -d '/work/nginx//logs' \|| mkdir -p '/work/nginx//logs'
make[1]: Leaving directory `/home/newton/nginx-1.13.4'

【配置快捷方式】
ln /work/nginx/sbin/nginx /usr/bin/nginx

【啟動Nginx】
nginx

【查看進程】
root@umaster:/work/project# ps awx|grep nginx
33665 ? Ss 0:00 nginx: master process nginx
33666 ? S 0:00 nginx: worker process
34029 pts/0 S+ 0:00 grep --color=auto nginx

【Nginx配置】
主要是:日志、端口號、腳本目錄、首頁文件名;
打開配置文件: /work/nginx/conf/nginx.conf
#[ 錯誤日志 ]
error_log  logs/error.log;
#[ 服務相關 ]
server {listen       88;				#監聽HTTP端口;server_name  localhost;		#訪問地址;#charset koi8-r;#access_log  logs/host.access.log  main;location /work {			#腳本根目錄root   html;				#入口目錄index  index.html index.htm;	#默認執行的首頁文件}


【重啟Nginx】
nginx -s reload :修改配置后重新加載生效

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/276031.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/276031.shtml
英文地址,請注明出處:http://en.pswp.cn/news/276031.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

小技巧!CSS 整塊文本溢出省略特性探究

大家好&#xff0c;我是若川。歡迎加我微信 ruochuan12&#xff0c;長期交流學習。今天的文章很有意思&#xff0c;講一講整塊文本溢出省略打點的一些有意思的細節。點擊下方卡片關注我&#xff0c;或者查看源碼系列文章。文本超長打點我們都知道&#xff0c;到今天&#xff08…

linux配置ip地址 suse_SUSE Linux下設置IP的兩種方法

第一種SUSE Linux IP設置方法ifconfig eth0 192.168.1.22 netmask 255.255.255.0 uproute add default gw 192.168.1.2釋義&#xff1a;#IP配置&#xff0c;包括子網掩碼,看情況修改eth0和192.168.1.22#網關修改 ,看情況修改192.168.1.2第二種SUSE Linux IP設置方法在suse操作系…

寒假作業3:抓老鼠啊

7-1 抓老鼠啊~虧了還是賺了&#xff1f; &#xff08;20 分&#xff09; 某地老鼠成災&#xff0c;現懸賞抓老鼠&#xff0c;每抓到一只獎勵10元&#xff0c;于是開始跟老鼠斗智斗勇&#xff1a;每天在墻角可選擇以下三個操作&#xff1a;放置一個帶有一塊奶酪的捕鼠夾(T)&…

筆記本移交_創建完美的設計移交

筆記本移交重點 (Top highlight)Design specifications (specs) are guidelines that developers will use to implement a design. Think of an architect providing building blueprints to the construction team. Many designers think of specs as mindless zombie work. …

大手筆,送¥1599的Apple AirPods Pro和獨家禮物等

大家好&#xff0c;我是若川。為感謝公眾號讀者們長久以來的支持&#xff0c;本次我聯合幾位前端界大佬給大家送超級福利了。除了聯合福利之外&#xff0c;每位前端大佬還帶了專屬禮品送給大家&#xff0c;所有抽獎均可重復參與、可重復中獎&#xff0c;詳情見下文每個公眾號的…

jQuery1.4新特性

1. 傳參給 jQuery(…) 之前&#xff0c;jQuery可以通過 attr 方法設置元素的屬性&#xff0c;既可傳屬性的名和值&#xff0c;也可以是包含幾組特定 屬性名值對 的 對象。在 jQuery 1.4 中&#xff0c;你可以把一個參數對象作為第二個參數傳給 jQuery 函數本身&#xff0c;同時…

python pack unpack_golang 仿python pack/unpack

package includesimport ("bytes""encoding/binary""fmt"_"os""strconv""strings")type Protocolstruct{Format []string}//封包func (p *Protocol) Pack(args ...interface{}) []byte{la :len(args)ls :len(p.Fo…

JavaScript遞歸應用與實踐

遞歸簡單來說就是函數內調用自生的一種方法&#xff0c;形如&#xff1a; function foo(){foo() } 復制代碼下面我列舉一些常用的遞歸應用。 1. 求和&#xff0c;例如求1234...100之和 分析如下&#xff1a; sum(100)sum(99)100 sum(99)sum(98)99 ... sum(1)sum(0)1 復制代碼代…

一個好的設計師_是什么讓一個好的設計師

一個好的設計師重點 (Top highlight)The design manager role has grown considerably over the past five years. As design has been recognised as a business value-driver and organisations have increased their design maturity, we’ve seen lots more design managem…

PHP-Redis擴展安裝 error: ext/standard/php_smart_str.h: No such file or directory

在源碼編譯PHP-redis擴展時&#xff0c;遇到缺少頭文件問題【問題描述】error: ext/standard/php_smart_str.h: No such file or directory 【問題原因】PHP安裝好的頭文件目錄&#xff1a;/php/include/php/ext/standard/&#xff0c;這些頭文件&#xff0c;在php7之前的版本&…

相見恨晚的一款前端布局神器!

大家好&#xff0c;我是若川。歡迎加我微信 ruochuan12&#xff0c;長期交流學習。今天給大家推薦一款非常實用的前端頁面布局神器&#xff0c;點擊下方卡片關注我&#xff0c;或者查看源碼系列文章。頁面和布局是一門前端程序員的必修課&#xff0c;css 從來也不是停留在面試八…

IC設計前端幾本經典書籍

No.1 Writing Testbenches, Functional Verification of HDL Modelsby Janick Bergeron本書主要以HDL&#xff08;verilog/vhdl&#xff09;為例&#xff0c;詳細講述了在IC DESIGN FLOW中Verification 以及Test的設計思想、方法和技巧&#xff0c;涵概了測試的各個方面&#x…

unreal無損音樂百度云_將網易云音樂專用的無損音樂格式轉換成全平臺通用的無損格式...

前幾天發現網易云音樂的ncm格式很坑爹&#xff0c;由于網易云的部分音樂采取了這種流媒體平臺模式&#xff0c;這種格式的歌曲下載到設備本地以后只有在網易云音樂的app上面才能播放&#xff0c;而且還要在會員生效期間才能播今天網易云弄出一個ncm&#xff0c;明天百度音樂來一…

鎖升級

JavaSE1.6為了減少獲得鎖和釋放鎖帶來的性能消耗&#xff0c;引入了“偏向鎖”和“輕量級鎖”。 在JavaSE1.6中&#xff0c;鎖一共有4種狀態&#xff0c;級別從低到高依次是&#xff1a;無鎖狀態、偏向鎖狀態、輕量級鎖狀態和重量級鎖狀態&#xff0c;這幾個狀態會隨著競爭情況…

ux和ui_首先要做的— UX / UI案例研究

ux和ui休息一下&#xff01; (Get some rest!) After four weeks of four-day design sprints each week, I welcomed the opportunity to work on this 9-day design challenge. With this also being an individual project, I allocated 50% of my time on the UX process a…

微信消息模板換行符轉義問題處理

通常的微信模板&#xff1a; Hello &#xff01;\n\n Are you OK&#xff1f; ① 直接定義字符串&#xff1b; ② 數據庫中讀取&#xff1b;這里需要說明的是 數據庫讀取 的內容&#xff0c;如果直接推送&#xff0c;\n\n是沒有被轉移為換行符的。此時需要&#xff1a; $tplStr…

Vue2 徹底從 Flow 重構為 TypeScript,煥然一新!

大家好&#xff0c;我是若川。歡迎加我微信 ruochuan12&#xff0c;長期交流學習。今天分享一篇技術熱點&#xff0c;眾所周知&#xff0c;前不久vue3不打算支持IE11&#xff0c;vue2將支持composition API&#xff0c;現在vue2用ts重構&#xff0c;試問&#xff1a;還學得動嘛…

紅米note5linux刷機包__最新最全的紅米Note5ROM刷機包下載、刷機教程_紅米Note5論壇_移動叔叔...

本帖最后由 壓力山大大叔 于 2018-5-15 00:52 編輯20180513跟新全屏手勢。看最后一張載圖。1&#xff1a;先解鎖&#xff0c;刷第三方&#xff0c;都是這個流程。2非常干凈&#xff0c;只有670兆&#xff0c;刷完沒有找到瀏覽器&#xff0c;刷前下載一個瀏覽器在手機里備用。3電…

每個網頁設計者都自以為是

&#xff08;一&#xff09;垃圾還是經典網頁技術更新很快&#xff0c;一個網站的界面設計壽命僅僅2-3年而已。不管是垃圾還是精品&#xff0c;都沒有所謂的經典。經典只存在于是哪個首次成功創新性的應用。網頁設計 者不管自己的學識、技術和經驗如何&#xff0c;都自以為自己…

文件夾的拷貝

文件夾用來把文件包裹起來&#xff0c;褪去這些外衣&#xff0c;說到底拷貝文件夾也就是拷貝文件 模擬實例&#xff1a;將F:/Picture/test 文件夾 拷貝到 F:/Picture/dir文件夾 該實例中test文件夾下只包含了test.txt文件 步驟分析&#xff1a; 1.通過路徑得到File對象 2.遞歸查…