$ cd /usr/local/
$ wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.36.tar.gz
$ tar -zxvf pcre-8.36.tar.gz
$ cd pcre-8.36
$ ./configure
$ make
$ makeinstall
./configure报错
configure: error: You need a C++ compiler for C++ support.
解决办法
yum install -y gcc gcc-c++
安装zlib库
$ cd /usr/local/
$ wget http://zlib.net/zlib-1.2.8.tar.gz
$ tar -zxvf zlib-1.2.8.tar.gz
$ cd zlib-1.2.8
$ ./configure
$ make
$ makeinstall
安装ssl
$ cd /usr/local/
$ wget http://www.openssl.org/source/openssl-1.0.1j.tar.gz
$ tar -zxvf openssl-1.0.1j.tar.gz
$ ./config
$ make
$ makeinstall
安装nginx
$ cd /usr/local/
$ wget http://nginx.org/download/nginx-1.8.0.tar.gz
$ tar -zxvf nginx-1.8.0.tar.gz
$ cd nginx-1.8.0
$ ./configure --prefix=/usr/local/nginx
$ make
$ makeinstall
安装常见错误:
Nginx启动提示找不到libpcre.so.1解决方法
如果是32位系统
[root@lee ~]# ln -s /usr/local/lib/libpcre.so.1 /lib
如果是64位系统
[root@lee ~]# ln -s /usr/local/lib/libpcre.so.1 /lib64
然后在启动nginx就OK了
[root@lee ~]# /usr/local/webserver/nginx/sbin/nginx