在CentOS 6.9 x86_64上安装nginx 1.12.2
生活随笔
收集整理的這篇文章主要介紹了
在CentOS 6.9 x86_64上安装nginx 1.12.2
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
比較詳細(xì)的教程參見(jiàn)以前的博文
http://blog.csdn.net/tao_627/article/details/60957521
這里只給出簡(jiǎn)略步驟,沒(méi)有截圖,自始至終使用root操作
目前最新的源碼地址
ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.41.tar.gz
http://www.zlib.net/zlib-1.2.11.tar.gz
https://www.openssl.org/source/openssl-1.1.0g.tar.gz
http://nginx.org/download/nginx-1.12.2.tar.gz
安裝相關(guān)依賴(lài)
yum -y install gcc gcc-c++ automake autoconf libtool make glibc glibc-devel lsof
假定下面的源碼都存放在/usr/local/src中
安裝PCRE庫(kù)
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.41.tar.gz
tar -zxvf pcre-8.41.tar.gz
cd pcre-8.41
./configure
make
make install
安裝zlib庫(kù)
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
安裝openssl庫(kù)
wget https://www.openssl.org/source/openssl-1.1.0g.tar.gz
tar zxvf openssl-1.1.0g.tar.gz
源碼編譯nginx-1.12.2
wget http://nginx.org/download/nginx-1.12.2.tar.gz
tar zxvf nginx-1.12.2.tar.gz
cd nginx-1.12.2
./configure --with-http_ssl_module \
--with-pcre=/usr/local/src/pcre-8.41 \
--with-zlib=/usr/local/src/zlib-1.2.11 \
--with-openssl=/usr/local/src/openssl-1.1.0g
make
測(cè)試
curl -vo /dev/null 'http://localhost/'
http://blog.csdn.net/tao_627/article/details/60957521
這里只給出簡(jiǎn)略步驟,沒(méi)有截圖,自始至終使用root操作
目前最新的源碼地址
ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.41.tar.gz
http://www.zlib.net/zlib-1.2.11.tar.gz
https://www.openssl.org/source/openssl-1.1.0g.tar.gz
http://nginx.org/download/nginx-1.12.2.tar.gz
安裝相關(guān)依賴(lài)
yum -y install gcc gcc-c++ automake autoconf libtool make glibc glibc-devel lsof
假定下面的源碼都存放在/usr/local/src中
安裝PCRE庫(kù)
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.41.tar.gz
tar -zxvf pcre-8.41.tar.gz
cd pcre-8.41
./configure
make
make install
安裝zlib庫(kù)
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
安裝openssl庫(kù)
wget https://www.openssl.org/source/openssl-1.1.0g.tar.gz
tar zxvf openssl-1.1.0g.tar.gz
源碼編譯nginx-1.12.2
wget http://nginx.org/download/nginx-1.12.2.tar.gz
tar zxvf nginx-1.12.2.tar.gz
cd nginx-1.12.2
./configure --with-http_ssl_module \
--with-pcre=/usr/local/src/pcre-8.41 \
--with-zlib=/usr/local/src/zlib-1.2.11 \
--with-openssl=/usr/local/src/openssl-1.1.0g
make
make install
編譯之前需要仔細(xì)研究一下configure的配置選項(xiàng),使用
./configure --help
測(cè)試
/usr/local/nginx/sbin/nginx
curl -vo /dev/null 'http://localhost/'
安裝第三方模塊
參見(jiàn)其它博文的記錄,它們都將以本博文的環(huán)境搭建為基礎(chǔ)進(jìn)行。
總結(jié)
以上是生活随笔為你收集整理的在CentOS 6.9 x86_64上安装nginx 1.12.2的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: OpenResty学习中的几个小例子汇总
- 下一篇: 在CentOS 6.9 x86_64上开