Compile and install the Nginx tutorial under Centos

  • 2020-05-12 06:59:25
  • OfStack

1. When installing nginx, the corresponding compiler must be installed first


yum -y install gcc gcc-c++ autoconf automake
yum -y install zlib zlib-devel openssl openssl-devel pcre-devel

Establish nginx


groupadd -r nginx
useradd -s /sbin/nologin -g nginx -r nginx
id nginx

zlib:nginx provides the gzip module and requires zlib library support

openssl:nginx provides ssl functionality

pcre: address override rewrite is supported

2. tar -zxvf nginx-1.2.8.tar.gz

3. cd nginx-1.2.8

4. ./configure \


--prefix=/usr \
--sbin-path=/usr/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--pid-path=/var/run/nginx/nginx.pid \
--user=nginx \
--group=nginx \
--with-http_ssl_module \
--with-http_flv_module \
--with-http_gzip_static_module \
--http-log-path=/var/log/nginx/access.log \
--http-client-body-temp-path=/var/tmp/nginx/client \
--http-proxy-temp-path=/var/tmp/nginx/proxy \
--http-fastcgi-temp-path=/var/tmp/nginx/fcgi \
--with-http_stub_status_module

5. make && make install

Summary: centos does not have the make compiler installed

Solution:


yum -y install gcc automake autoconf libtool make

Related articles: