编译安装在执行./configure步骤报错,是因为缺少环境变量
checking for C compiler … not found
./configure: error: C compiler cc is not found
解决办法,安装环境需要
yum install gcc gcc-c++ -y
看到这里稍等,如果没有安装openssl openssl-devel 也会编译失败
报错如下
./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= option.
解决办法
安装openssl openssl-devel
yum install openssl openssl-devel -y
完成后显示如下内容
Configuration summary
+ using system PCRE library
+ OpenSSL library is not used
+ using system zlib librarynginx path prefix: "/home/nginx"
nginx binary file: "/home/nginx/sbin/nginx"
nginx modules path: "/home/nginx/modules"
nginx configuration prefix: "/home/nginx/conf"
nginx configuration file: "/home/nginx/conf/nginx.conf"
nginx pid file: "/home/nginx/logs/nginx.pid"
nginx error log file: "/home/nginx/logs/error.log"
nginx http access log file: "/home/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"
剩下就可以执行make 和make install了