JAVA—咖啡館

          ——?dú)g迎訪問rogerfan的博客,常來《JAVA——咖啡館》坐坐,喝杯濃香的咖啡,彼此探討一下JAVA技術(shù),交流工作經(jīng)驗(yàn),分享JAVA帶來的快樂!本網(wǎng)站部分轉(zhuǎn)載文章,如果有版權(quán)問題請與我聯(lián)系。

          BlogJava 首頁 新隨筆 聯(lián)系 聚合 管理
            447 Posts :: 145 Stories :: 368 Comments :: 0 Trackbacks

          系統(tǒng):Centos6.6  64

          Nginx:  http://nginx.org/en/download.html 目前最新版本1.9.4 我下載1.8.0

          下載模塊依賴性Nginx需要依賴下面3個(gè)包
          1.gzip 模塊需要 zlib 庫 ( 下載: http://www.zlib.net/ )
          2.rewrite 模塊需要 pcre 庫 ( 下載: http://www.pcre.org/ )
          3.ssl 功能需要 openssl 庫 ( 下載: http://www.openssl.org/ )

          依賴包安裝順序依次為:openssl、zlib、pcre, 然后安裝Nginx包

          如果沒有安裝c++編譯環(huán)境,還得安裝,通過yum install gcc-c++完成安裝
          下載完成后:



          下一步,編譯安裝

          openssl 

           

          [root@localhost] tar zxvf openssl-fips-2.0.9.tar.gz

          [root@localhost] cd openssl-fips-2.0.9

          [root@localhost] ./config && make && make install

           

          pcre:

           

          [root@localhost] tar zxvf pcre-8.36.tar.gz

          [root@localhost] cd pcre-8.36

          [root@localhost]  ./configure && make && make install

           

          zlib:

          [root@localhost]tar zxvf zlib-1.2.8.tar.gz

          [root@localhost] cd zlib-1.2.8

          [root@localhost]  ./configure && make && make install

           

          最后安裝nginx

          [root@localhost]tar zxvf nginx-1.8.0.tar.gz

          [root@localhost] cd nginx-1.8.0

          [root@localhost]  ./configure && make && make install


          安裝完成后,可啟動(dòng)nginx

          啟動(dòng)命令:/usr/local/nginx/sbin/nginx
          發(fā)現(xiàn)報(bào)錯(cuò)了:
          error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory
          經(jīng)網(wǎng)上查詢,這是linux的通病

          [root@localhost nginx]# sbin/nginx 
          sbin/nginx: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory
          [root@localhost nginx]# error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory
          [root@localhost nginx]# whereis libpcre.so.1
          libpcre.so: /lib64/libpcre.so.0 /usr/local/lib/libpcre.so /usr/local/lib/libpcre.so.1
          [root@localhost nginx]# ln -s /usr/local/lib/libpcre.so.1 /lib64
          [root@localhost nginx]# sbin/nginx   
                                     
          先找到libpcre.so.1所在位置,然后做個(gè)軟鏈接就可以了。
          查看是否已啟動(dòng):


          通過瀏覽器訪問:


          看到這個(gè)就說明nginx安裝并啟動(dòng)成功。

           

          ps:

          啟動(dòng):/usr/local/nginx/sbin/nginx
          停止/重新加載:/usr/local/nginx/sbin/nginx -s stop(quit、reload)
          驗(yàn)證配置文件是否合法:/usr/local/nginx/sbin/nginx -t
          命令幫助:/usr/local/nginx/sbin/nginx -h
          posted on 2016-04-22 17:11 rogerfan 閱讀(317) 評論(0)  編輯  收藏 所屬分類: 【開源技術(shù)】
          主站蜘蛛池模板: 乌兰察布市| 盘锦市| 繁昌县| 钟祥市| 湘潭市| 长垣县| 阳高县| 成武县| 祁门县| 华池县| 澎湖县| 广灵县| 保定市| 苍山县| 新乡市| 泰安市| 平阴县| 清镇市| 会昌县| 文成县| 磐石市| 泾川县| 自贡市| 临沭县| 兴城市| 得荣县| 新巴尔虎右旗| 定陶县| 顺平县| 金阳县| 成安县| 兴文县| 同江市| 峡江县| 仲巴县| 平罗县| 太保市| 乌兰浩特市| 日喀则市| 白朗县| 西青区|