歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux綜合 >> 學習Linux >> CentOS7 安裝 nginx,centos7安裝nginx

CentOS7 安裝 nginx,centos7安裝nginx

日期:2017/3/6 9:21:59   编辑:學習Linux

CentOS7 安裝 nginx,centos7安裝nginx


CentOS7 安裝 nginx,centos7安裝nginx


我准備安裝到/usr/local目錄下

1. cd /usr/local

2. 安裝GCC 和GCC-C++

yum install gcc

yum install -y gcc gcc-c++

3. 安裝pcre庫

cd /usr/local/
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

4. 安裝zlib庫

cd /usr/local/
wget http://zlib.net/zlib-1.2.8.tar.gz
tar -zxvf zlib-1.2.8.tar.gz
cd zlib-1.2.8/
./configure
make
make install

5. 安裝ssl

cd /usr/local/
wget http://www.openssl.org/source/openssl-1.0.1c.tar.gz
tar -zxvf openssl-1.0.1c.tar.gz
cd openssl-1.0.1c
./config
make
make install

6. 安裝nginx

這裡我是先下好了包的 http://nginx.org/

cd /usr/local/
tar -zxvf nginx-1.10.1.tar.gz
./configure
make
make install

7. 啟動 nginx

/usr/local/nginx/sbin/nginx

8. 輸入http://localhost/

啟動成功

若找不到pcre和zlib則需要配置

--with-pcre=/usr/src/pcre-8.39 指的是pcre-8.39 的源碼路徑。
--with-zlib=/usr/src/zlib-1.2.8 指的是zlib-1.2.8 的源碼路徑。

http://xxxxxx/Linuxjc/1151637.html TechArticle

Copyright © Linux教程網 All Rights Reserved