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