Linux下安装Nginx详解

Nginx作为一个web服务器,目前使用最多的就利用其负载均衡,本篇着重讲解的是nginx在linux环境下的安装部署。

root环境下安装

1.准备资源,下载nginx及相关组件:

(1)、cd usr/local/src       进入下载目录,可自定义

(2)、准备下载4个程序(依次执行以下四个命令):

wget http://nginx.org/download/nginx-1.10.2.tar.gz

wget http://www.openssl.org/source/openssl-fips-2.0.10.tar.gz

 

wget http://zlib.net/zlib-1.2.11.tar.gz

 

wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.40.tar.gz

 

如果安装了c++的环境就可跳过,如未安装:yum install gcc-c++ (点击y即可)

安装结尾显示complete,即代表安装完成

2.安装nginx及其组件

(1)、安装openssl:

tar -zxvf openssl-fips-2.0.10.tar.gz

cd openssl-fips-2.0.10

./config && make && make install   

(2)、安装pcre

tar -zxvf pcre-8.40.tar.gz

cd pcre-8.40

./configure && make && make install

(3)、安装zlib

tar -zxvf zlib-1.2.11.tar.gz

cd zlib-1.2.11

./configure && make && make install

(4)、安装nginx

tar zxvf nginx-1.10.2.tar.gz

cd nginx-1.10.2

./configure && make && make install

3.启动Nginx

命令 cd /usr/local/nginx/sbin

./nginx -t   

./nginx -c /usr/local/nginx/conf/nginx.conf

启动成功,默认80端口,直接访问即可

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值