Linux下安装Nginx依赖包和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.39.tar.gz
cd pcre-8.39
./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.2n.tar.gz
tar -zxvf openssl-1.0.2n.tar.gz
cd openssl-1.0.2n
./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

检查Nginx的配置文件
/usr/local/nginx/sbin/nginx -t
启动Nginx
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

posted on 2018-02-07 21:00  坚守梦想  阅读(2542)  评论(0编辑  收藏  举报