PCRE..



PCRE Library is a library that is required to use HTTP rewrite when we do a compilation of nginx. The PCRE package contains Perl Compatible Regular Expression libraries useful for implementing regular expression pattern matching.

If PCRE is not installed on the server, it will result in the following error message during the Nginx compliation:

checking for PCRE library ... not found
checking for PCRE library in /usr/local/ ... not found
checking for PCRE library in /usr/include/pcre/ ... not found
./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=<path> option.

How to Install the PCRE library so we can install Nginx Web Server with the HTTP rewrite module ? login into your server via SSH as user ‘root’

1) First, goto a temporary directory

 # cd /usr/local/src

2) Download PCRE:

 # w.get http://downloads.sourceforge.net/pcre/pcre-8.10.tar.bz2

3) Unpack and change to the pcre directory

 # tar -jxf pcre-8.10.tar.bz2
 # cd pcre-8.10

4) Confiure PCRE:

 # ./configure

5) Create the installation files and install PCRE

 # make
 # make install

Once done, you should be able to install Nginx with the HTTP rewrite module.

Tags: