欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

Nginx如何編譯連接

這篇文章將為大家詳細(xì)講解有關(guān)Nginx如何編譯連接,小編覺得挺實用的,因此分享給大家做個參考,希望大家閱讀完這篇文章后可以有所收獲。

我們提供的服務(wù)有:成都網(wǎng)站設(shè)計、網(wǎng)站建設(shè)、微信公眾號開發(fā)、網(wǎng)站優(yōu)化、網(wǎng)站認(rèn)證、海滄ssl等。為超過千家企事業(yè)單位解決了網(wǎng)站和推廣的問題。提供周到的售前咨詢和貼心的售后服務(wù),是有科學(xué)管理、有技術(shù)的海滄網(wǎng)站制作公司

nginx 組織過程

  • /auto/configure(獲取configure的配置,生成Makefile)

  • objs/Makefile(由第一步生成)

  • make(*.o生成,連接成nginx)

針對http geo模塊連接過程進(jìn)行示范

1.configure

path:auto/configure

. auto/options
...

2.options 參數(shù)

  • path: auto/option

  • path: auto/modules

某個配置是否開啟

 --without-stream_geo_module        disable ngx_stream_geo_module
  --with-debug                       enable debug logging

HTTP_GEO變量被設(shè)置為YES, geo模塊開啟.

    if [ $HTTP_GEO = YES ]; then
        have=NGX_HTTP_X_FORWARDED_FOR . auto/have

        ngx_module_name=ngx_http_geo_module
        ngx_module_incs=
        ngx_module_deps=
        ngx_module_srcs=src/http/modules/ngx_http_geo_module.c
        ngx_module_libs=
        ngx_module_link=$HTTP_GEO

        . auto/module
    fi

3.objs/ngx_modules.c

  • extern 聲明目標(biāo)模塊(geo, 自定義模塊)

  • ngx_modules: 注冊模塊

  • ngx_module_names: 定義模塊名

4.objs/Makefile

  • 編譯目標(biāo).o

  • 把目標(biāo).o連接到nginx

eg:ngx_http_geo_module.o模塊的生成

objs/src/http/modules/ngx_http_geo_module.o:	$(CORE_DEPS) $(HTTP_DEPS) \
	src/http/modules/ngx_http_geo_module.c
	$(CC) -c $(CFLAGS) $(CORE_INCS) $(HTTP_INCS) \
		-o objs/src/http/modules/ngx_http_geo_module.o \
		src/http/modules/ngx_http_geo_module.c

5.驗證nginx中已經(jīng)連接了目標(biāo)模塊

  • ngx_http_geo_module

  • ngx_http_mytest_module(自定義模塊)

?  nginx git:(hyh_test) ? nm objs/nginx | grep geo_mod
00000001000a5420 D _ngx_http_geo_module
00000001000bdf68 b _ngx_http_geo_module_ctx
?  nginx git:(hyh_test) ? 
?  nginx git:(hyh_test) ? nm objs/nginx | grep mytest 
0000000100071860 t _ngx_http_mytest_block
00000001000a5500 d _ngx_http_mytest_commands
00000001000a5570 D _ngx_http_mytest_module
00000001000bdfb8 b _ngx_http_mytest_module_ctx
?  nginx git:(hyh_test) ?

關(guān)于“Nginx如何編譯連接”這篇文章就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,使各位可以學(xué)到更多知識,如果覺得文章不錯,請把它分享出去讓更多的人看到。

本文標(biāo)題:Nginx如何編譯連接
當(dāng)前地址:http://www.chinadenli.net/article42/iieihc.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供商城網(wǎng)站網(wǎng)站維護(hù)做網(wǎng)站App開發(fā)域名注冊外貿(mào)網(wǎng)站建設(shè)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

成都定制網(wǎng)站網(wǎng)頁設(shè)計