今天试了在SUSE 12.0 系统上安装 nginx 1.8,记录下以备他用
到nginx官网下载1.8版本 http://nginx.org
编译的时候会出现两次错
./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 即可
原文地址:http://168ok8.blog.51cto.com/73394/1652430