安裝nginx1.8

今天試了在SUSE 12.0 系統上安裝 nginx 1.8,記錄下以備他用

  1. 到nginx官網下載1.8版本  http://nginx.org

  2. 編譯的時候會出現兩次錯

    ./configure --prefix=/opt/nginx      (安裝在/opt/nginx目錄 )

 

./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre=<path> option.


./configure: error: the HTTP gzip module requires the zlib library.
You can either disable the module by using --without-http_gzip_module
option, or install the zlib library into the system, or build the zlib library
statically from the source with nginx by using --with-zlib=<path> option.

 

3.根據錯誤需要安裝PCRE  和 zlib  以及 zlib-devel ,上網下載這三個包,其中zlib  和zlib-devel是RPM包(見附件),直接安裝即可, PCRE是源碼包,解壓後重編譯時帶上PCRE源碼地址即可,如

  ./configure --prefix=/opt/nginx --with-pcre=/nfsshare/pcre-8.36

 

4.正常編譯後最後會提示

  nginx path prefix: "/opt/nginx"
  nginx binary file: "/opt/nginx/sbin/nginx"
  nginx configuration prefix: "/opt/nginx/conf"
  nginx configuration file: "/opt/nginx/conf/nginx.conf"
  nginx pid file: "/opt/nginx/logs/nginx.pid"
  nginx error log file: "/opt/nginx/logs/error.log"
  nginx http access log file: "/opt/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"

 

5.接下就來是 make     make install   安裝完成

 

6.總結 nginx安裝比較簡單,但缺少的 PCRE  和 zlib  以及 zlib-devel 在SUSE Enterprise上不好安裝,不像CentOS  yum 即可

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章