linux编译安装nginx1.14

linux编译安装nginx1.14

1 下载

链接:nginx
命令:wget http://nginx.org/download/nginx-1.14.0.tar.gz

2 解压

tar -xvf nginx-1.14.0.tar.gz
cd $PWD/nginx-1.14.0

3 编译

./configure --prefix=/soft/nginx --with-http_stub_status_module --with-http_ssl_module

Configuration summary

  • using system PCRE library
  • using system OpenSSL library
  • using system zlib library

nginx path prefix: “/opt/nginx”
nginx binary file: “/opt/nginx/sbin/nginx”
nginx modules path: “/opt/nginx/modules”
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”

4 常见错误

checking for OS

  • Linux 3.10.0-862.11.6.el7.x86_64 x86_64
    checking for C compiler … not found

./configure: error: C compiler cc is not found

报错,安装gcc

  • yum install gcc

Installed:
gcc.x86_64 0:4.8.5-28.el7_5.1

Dependency Installed:
cpp.x86_64 0:4.8.5-28.el7_5.1 glibc-devel.x86_64 0:2.17-222.el7 glibc-headers.x86_64 0:2.17-222.el7
kernel-headers.x86_64 0:3.10.0-862.14.4.el7 libmpc.x86_64 0:1.0.1-3.el7 mpfr.x86_64 0:3.1.1-4.el7
报错
./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.

6 安装pcre-devel与openssl-devel解决问题 pcre问题

  • yum install pcre-devel
  • yum install openssl-devel
    Installed:
    openssl-devel.x86_64 1:1.0.2k-12.el7

Dependency Installed:
keyutils-libs-devel.x86_64 0:1.5.8-3.el7 krb5-devel.x86_64 0:1.15.1-19.el7 libcom_err-devel.x86_64 0:1.42.9-12.el7_5
libkadm5.x86_64 0:1.15.1-19.el7 libselinux-devel.x86_64 0:2.5-12.el7 libsepol-devel.x86_64 0:2.5-8.1.el7
libverto-devel.x86_64 0:0.2.5-4.el7 zlib-devel.x86_64 0:1.2.7-17.el7

Complete!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值