CentOS7 安装 nginx
2016-08-20 16:35
141 查看
我准备安装到/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 的源码路径。
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 的源码路径。
相关文章推荐
- centos7安装nginx和php
- centos7服务安装_流媒体服务器_安装nginx
- centos7 安装 nginx1.9.2
- Centos7 yum安装nginx
- 在CentOS7中安装nginx
- centos7(minirnal)版安装——nginx
- centos7 安装 nginx
- CentOS7 YUM 安装NGINX
- Centos7 Nginx安装
- Centos7安装nginx
- CentOS7安装Docker,运行Nginx镜像、Centos镜像
- centos7安装nginx+mariadb+php-fpm
- centos7 nginx安装及配置端口转发实战
- CentOS7安装Nginx-1.9.9+PHP5.6
- 编译安装在centos7的nginx
- centos7服务安装_NginxWeb服务器
- 【阿里ECS】CentOS7安装nginx
- Centos7 nginx安装
- centos7编译安装nginx1.8
- Centos7 系统下node.js+Nginx+MongoDB的安装与配置