1、安装nginx

tar zxvf nginx-1.8.1.tar.gz
cd nginx-1.8.1
./configure
make
make install

/usr/local/nginx/sbin/nginx 开启权限

/usr/local/nginx/sbin/nginx -s stop 关闭权限
/usr/local/nginx/sbin/nginx -s reload 重新加载配置文件
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
---------------------------------
出现错误

checking for PCRE library ... not found

checking for PCRE library in /usr/local/ ... not found

2、安装pcre

tar zxvf pcre-8.38.tar.gz 
 cd pcre-8.38
 ./configure

make

make install

出现错误

安装pcre报错“You need a C++ compiler for C++ support.”

3、安装GCC C++

yum install -y gcc-c++

4、启动nginx

出现错误

nginx无法启动提示libpcre.so.1: cannot open shared object file

大概可以看得出来,缺少了libpcre这个库文件

解决方法:

[root@bogon lib64]# ln -s /usr/local/lib/libpcre.so.1 /lib64

参考文章:

http://www.cnblogs.com/bluewelkin/p/3937565.html

http://www.cnblogs.com/bluewelkin/p/4193725.html

http://www.chenglin.name/normal/599.html

05-12 18:12