安装NGINX前要先安装PCRE正则表达式库:
./configure --prefix=/usr/local/pcre 出现以下错误 (一般./configure即可, 笔者这里是直接./configure命令)
configure: error: You need a C++ compiler for C++support. (解决办法: yum install -y gcc gcc-c++)
make
make install
下面开始安装NGINX:
安装NGINX:
yum install libtool
yum install zlib zlib-devel
yum install openssl
./configure --prefix=/usr/local/nginx--with-http_stub_status_module
make
make install
检查是否安装成功:
cd /usr/local/nginx/sbin
./nginx -t
./nginx: error while loading shared libraries: libpcre.so.1: cannotopen shared object file: No such file or directory
从错误看出是缺少lib文件导致,进一步查看下:
ldd $(which /usr/local/nginx/sbin/nginx)