Nginx安装依赖模块
yum -y install zlib pcre openssl gcc-c++
pcre tar包下载
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.37.tar.gz
zlib tar包下载
wget http://zlib.net/zlib-1.2.8.tar.gz
ssl tar包下载
wget https://www.openssl.org/source/openssl-1.0.1t.tar.gz
nginx tar包下载
wget http://nginx.org/download/nginx-1.4.2.tar.gztar包安装:
tar -xvf XXX.tar.gz /usr/local/nginx
./configure && make && make install
报错:
error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory
这是linux的通病
whereis libpcre.so.1
ln -s /usr/local/lib/libpcre.so.1 /lib64
/usr/local/nginx/sbin/nginx #启动nginx
验证配置文件是否合法:/usr/local/nginx/sbin/nginx -t
命令帮助:/usr/local/nginx/sbin/nginx -h
本文转自守护我们的幸福 51CTO博客,原文链接:http://blog.51cto.com/12085228/1975122,如需转载请自行联系原作者