Solve the HTTP rewrite module requires the PCRE library.

Source: Internet
Author: User
Tags install openssl openssl library automake

Solve the HTTP rewrite module requires the PCRE library.
Installation Process

  1. Download the nginxpackage (or wgethttp: // nginx.org/download/nginx-1.9.15.tar.gz) from http://nginx.org/download/nginx-1.9.15.tar.gzdirectly on the linux System)

  2. Decompress the package and go to the directory.

tar -zxvf nginx-1.9.15.tar.gzcd nginx-1.9.15
  • 1
  • 2
  1. Set Configuration Information./configure --prefix=/usr/local/nginxOr do not execute this step.

  2. Compile and install

makemake install

Make processes convert source code files written in various languages into executable files and various library files. make install copies the compiled executable files and library files to appropriate places.

Possible Errors
  1. In the configuration information./configure --prefix=/usr/local/nginxError:
/configure: error: the HTTP rewrite module requires the PCRE library.

Solution: Install pcre

yum -y install pcre pcre-devel

-Y: Skip all steps that require manual confirmation.

  1. The ssl error is missing. The error message is as follows:
./configure: error: the HTTP cache module requires md5 functionsfrom OpenSSL library.   You can either disable the module by using--without-http-cache option, or install the OpenSSL library into the system,or build the OpenSSL library statically from the source with nginx by using--with-http_ssl_module --with-openssl=<path> options.

Solution: Install openssl

yum -y install openssl openssl-devel
  1. The compiler is missing. The error message is as follows:
./configure: error: C compiler cc is not found

Solution: Install gcc-c ++

yum -y install gcc-c++ autoconf automake

Autoconf is configured automatically, and automake is compiled automatically.

  1. The zlib package is missing. The error message is as follows:
./configure: error: the HTTP gzip module requires the zlib library.You can either disable the module by using –without-http_gzip_moduleoption, or install the zlib library into the system, or build the zliblibrarystatically from the source with nginx by using –with-zlib=<path> option.

Solution: Install zlib

yum install -y zlib-devel
After the installation is complete, start the installation successfully, and the/usr/local/nginx directory is as follows:
fastcgi.conf            koi-win             nginx.conf.defaultfastcgi.conf.default    logs                scgi_paramsfastcgi_params          mime.types          scgi_params.defaultfastcgi_params.default  mime.types.default  uwsgi_paramshtml                    nginx               uwsgi_params.defaultkoi-utf                 nginx.conf          win-utf
Start

Ensure that port 80 of the system is not occupied by other programs. Run the/usr/local/nginx command to start Nginx,

netstat -ano|grep 80

If no result is found, run the command. If no result is found, ignore this step. (sudo must be enabled in ubuntu; otherwise, it can only run on the foreground)

sudo /usr/local/nginx/nginx

Open the browser to access the IP address of this machine. If the browser displays Welcome to nginx! Nginx has been installed and runs successfully.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.