centos下源码安装Nginx详细操作步骤和方法

1.安装依赖pcre包
cd /usr/local/src
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.39.tar.gz 
tar -zxvf pcre-8.37.tar.gz
cd pcre-8.34
./configure
make
make install


2.安装依赖zlib包
cd /usr/local/src
 
wget http://zlib.net/zlib-1.2.11.tar.gz
tar -zxvf zlib-1.2.11.tar.gz
cd zlib-1.2.11
./configure
make
make install


3.安装依赖openssl包
cd /usr/local/src
wget https://www.openssl.org/source/openssl-1.0.1t.tar.gz
tar -zxvf openssl-1.0.1t.tar.gz


./config --prefix=/usr/local/openssl && make && make install  




4. nginx安装(以上三个依赖安装完后)
cd /usr/local
wget  http://nginx.org/download/nginx-1.9.0.tar.gz
tar -zxvf nginx-1.9.0.tar.gz
cd nginx-1.9.0
./configure && make && make install
启动/usr/local/nginx/sbin/nginx




如果出现这个个错误
error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory


则执行如下:


ln -s /usr/local/lib/libpcre.so.1 /lib64/

你可能感兴趣的:(LINUX技术)