安装Nginx

在centos7中安装nginx

下载源码

1
2
3
# http://nginx.org/en/download.html
# 下载稳定版本
wget -c http://nginx.org/download/nginx-1.14.2.tar.gz

安装依赖

1
yum -y install gcc gcc-c++ make libtool autoconf patch unzip automake libxml2 libxml2-devel ncurses ncurses-devel libtool-ltdl-devel libtool-ltdl libmcrypt libmcrypt-devel libpng libpng-devel libjpeg-devel openssl openssl-devel curl curl-devel autoconf libaio*

编译

1
2
tar xzf nginx-1.14.2.tar.gz
cd nginx-1.14.2
1
2
3
4
5
6
7
8
9
10
11
12
./configure --user=biztech \
--group=biztech \
--prefix=/opt/local/nginx \
--http-log-path=/opt/logs/nginx \
--with-http_stub_status_module \
--with-http_ssl_module \
--with-http_gzip_static_module

yum -y install gcc gcc-c++ make libtool autoconf patch unzip automake libxml2 libxml2-devel ncurses ncurses-devel libtool-ltdl-devel libtool-ltdl libmcrypt libmcrypt-devel libpng libpng-devel libjpeg-devel openssl openssl-devel curl curl-devel libxml2 libxml2-devel ncurses ncurses-devel libtool-ltdl-devel libtool-ltdl autoconf automake libaio*


--with-pcre-jit --prefix=/opt/local/nginx --http-log-path=/opt/logs/nginx --with-pcre=/tmp/1879263/pcre-8.39 --with-http_stub_status_module --with-http_ssl_module --with-http_ssl_module --with-http_secure_link_module --with-debug --with-http_realip_module