愛睡覺的程序員

            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
            5 隨筆 :: 0 文章 :: 0 評論 :: 0 Trackbacks
          @import url(http://www.aygfsteel.com/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css); 在系統開發的時候,遇到需要使用tcp代理,主機上的nginx沒有安裝tcp代理模塊,如何在已安裝的nginx里添加新模塊,下面的步驟可以參考。
          1.查看已安裝的nginx版本和模塊
          1 [root@AY140718181734190c4aZ sbin]# ./nginx -V
          2 nginx version: nginx/1.7.10
          3 built by gcc 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC) 
          4 TLS SNI support enabled
          5 configure arguments: --prefix=/opt/nginx --with-http_dav_module
          6 [root@AY140718181734190c4aZ sbin]# 

          2.下載需要安裝壓縮包并解壓
           1 [root@AY140718181734190c4aZ install]# wget --no-check-certificate https://github.com/yaoweibin/nginx_tcp_proxy_module/archive/master.zip
           2 --2015-03-19 23:35:58--  https://github.com/yaoweibin/nginx_tcp_proxy_module/archive/master.zip
           3 正在解析主機 github.com 192.30.252.131
           4 正在連接 github.com|192.30.252.131|:443 已連接。
           5 已發出 HTTP 請求,正在等待回應 302 Found
           6 位置:https://codeload.github.com/yaoweibin/nginx_tcp_proxy_module/zip/master [跟隨至新的 URL]
           7 --2015-03-19 23:35:59--  https://codeload.github.com/yaoweibin/nginx_tcp_proxy_module/zip/master
           8 正在解析主機 codeload.github.com 192.30.252.145
           9 正在連接 codeload.github.com|192.30.252.145|:443 已連接。
          10 已發出 HTTP 請求,正在等待回應 200 OK
          11 長度:未指定 [application/zip]
          12 正在保存至: “master.zip”
          13 
          14     [     <=>                                                                                                                                 ] 213,058      177K/s   in 1.2s    
          15 
          16 2015-03-19 23:36:03 (177 KB/s) - “master.zip” 已保存 [213058]
          17 
          18 [root@AY140718181734190c4aZ install]# unzip master.zip

          3.打patch
          1 [root@AY140718181734190c4aZ doc]#patch -p1 < /opt/install/nginx_tcp_proxy_module-master/tcp.patch

          進入nginx安裝包目錄,重新執行./configure,make編譯,不用make install,不然會覆蓋原來的nginx安裝
          1 [root@AY140718181734190c4aZ nginx-1.7.10]# ./configure --add-module=/opt/install/nginx_tcp_proxy_module-master --prefix=/opt/nginx --with-http_dav_module
          2 [root@AY140718181734190c4aZ nginx-1.7.10]# make

          4.替換nginx文件,將./objs/nginx 文件復制到nginx的安裝路徑/opt/nginx/sbin 下,復制前最好先備份下。然后將正在運行的nginx進程殺掉(如果復制不成功,先殺掉進程再復制),使用./nginx -V查看下安裝是否成功。./nginx 啟動nginx。
          在下載的軟件包doc目錄里有tcp代理的使用說明。



          posted on 2015-03-19 23:53 polang 閱讀(234) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 旌德县| 巴彦县| 治县。| 太保市| 革吉县| 合山市| 观塘区| 芜湖市| 德格县| 廊坊市| 乳山市| 大丰市| 东兰县| 永昌县| 夹江县| 安乡县| 洛阳市| 丰镇市| 米泉市| 正宁县| 剑阁县| 吉安县| 裕民县| 弥渡县| 通城县| 蛟河市| 新宾| 凭祥市| 伊春市| 葵青区| 方城县| 安泽县| 南昌县| 改则县| 桦南县| 安远县| 会宁县| 长岛县| 五华县| 江达县| 昂仁县|