CentOS 7 安装 Nginx 1.10.1

树叶云

在 CentOS 7 安装 Nginx 1.10.1,我准备安装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 的源码路径。

 

文章来源网络,作者:运维,如若转载,请注明出处:https://shuyeidc.com/wp/221926.html<

(0)
运维的头像运维
上一篇2025-04-15 06:28
下一篇 2025-04-15 06:29

相关推荐

发表回复

您的邮箱地址不会被公开。必填项已用 * 标注