Install PCRE in nginx

Source: Internet
Author: User

1. If PCRE is not installed on some servers, an error will be reported during nginx installation.

Therefore, before installation, we can:

Yum install PCRE-devel

Unfortunately, the server is not configured with Yum and cannot connect to the Internet. So we can only download it from the official website.

Ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.36.zip

Ii. Install PCRE

unzip pcre-8.36.zipcd pcre-8.36./configure --prefix=/usr/local/pcre --enable-utf8 --enable-unicode-propertiesmakemake install

3. Install nginx

(Of course, the premise is to get the installation package: http://nginx.org/download/nginx-1.8.0.tar.gz)

tar -zxvf nginx-1.8.0.tar.gzcd nginx-1.8.0./configure --prefix=./ --with-pcre=../pcre-8.36  make

TIPS: -- With-PCRE = ../pcre-8.36 // This path is the path you just decompressed the PCRE source code.

After "./configure -- prefix =./-- With-PCRE = ../pcre-8.36", you can find the following modifications to enable nginx to support UTF-8

1093 ../pcre-8.36/Makefile:  objs/Makefile1094         cd ../pcre-8.36 1095         && if [ -f Makefile ]; then $(MAKE) distclean; fi 1096         && CC="$(CC)" CFLAGS="-O2 -fomit-frame-pointer -pipe " 1097         ./configure --disable-shared --enable-utf8 --enable-unicode-properties 

Iv. Extract the executable part of nginx

./Objs/nginx --> nginx/sbin
./CONF/* --> nginx/Conf
./Html/* ---> nginx/html
Mkdir log ---> nginx/log

TIPS: in fact, nginx only needs to execute the file, the log directory and the HTML of the error page. You only need to -- prefix =./during compilation and put these files in the same directory.

Install PCRE in nginx

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.