INEWUP'S BLOG

centos nginx源码安装

inewup-nginx

环境准备

yum install -y gcc gcc-c++ perl wget

nginx源码下载

Stable version nginx-1.10.1

cd nginx

下载nginx

wget http://nginx.org/download/nginx-1.10.1.tar.gz

tar zxvf nginx-1.10.1.tar.gz

下载pcre库

wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.39.tar.gz

tar zxvf pcre-8.39.tar.gz

下载zlib

wget http://zlib.net/zlib-1.2.8.tar.gz

tar zxvf zlib-1.2.8.tar.gz

下载openssl

wget https://www.openssl.org/source/openssl-1.0.2h.tar.gz

tar zxvf openssl-1.0.2h.tar.gz

编译

./configure  --prefix=/nginx  --with-pcre=/nginx/pcre-8.39  --with-zlib=/nginx/zlib-1.2.8  --with-openssl=/nginx/openssl-1.0.2h --with-http_ssl_module

Configuration summary + using PCRE library: /nginx/pcre-8.39 + using OpenSSL library: /nginx/openssl-1.0.2h + md5: using OpenSSL library + sha1: using OpenSSL library + using zlib library: /nginx/zlib-1.2.8

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

加入到path中 ln -s /nginx/sbin/nginx /bin/nginx