第一个错误:
/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.
(PCRE(Perl Compatible Regular Expressions)是一个Perl库)
PCRE是perl所用到的正则表达式,目的是让所装的软件支持正则表达式。默认情况下,Nginx只处理静态的网页请求,也就是html.如果是来自动态的网页请求,比如*.php,那么Nginx就要根据正则表达式查询路径,然后把*.PHP交给PHP去处理
解决方法,安装pcre-devel包。
第二个错误:
./configure: error: the HTTP cache module requires md5 functionsfrom OpenSSL library. You can either disable the module by using–without-http-cache option, or install the OpenSSL library into the system,or build the OpenSSL library statically from the source with nginx by using–with-http_ssl_module –with-openssl=<path> options.
解决方法,安装openssl-devel包
编译成功。
make
make install
/usr/local/nginx/sbin/nginx
测试:Welcome to nginx!
安装好了的目录为:
nginx path prefix: “/usr/local/nginx”
nginx binary file: “/usr/local/nginx/sbin/nginx”
nginx configuration prefix: “/usr/local/nginx/conf”
nginx configuration file: “/usr/local/nginx/conf/nginx.conf”
nginx pid file: “/usr/local/nginx/logs/nginx.pid”
nginx error log file: “/usr/local/nginx/logs/error.log”
nginx http access log file: “/usr/local/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”
安装搞定,以后再继续写配置。
原创文章,转载请注明。本文链接地址: https://www.rootop.org/pages/308.html