Nginx 源码包安装部署

本文介绍了在CentOS系统中如何通过源码包安装Nginx,详细步骤包括下载源码、安装依赖、配置编译、安装及启动Nginx。Nginx作为轻量级的Web服务器,支持高并发。在安装过程中,需要安装zlib-devel、gcc等依赖,并通过./configure进行配置,然后使用make && make install完成安装。
摘要由CSDN通过智能技术生成

Nginx

轻量级 支持高并发web服务器 开启安装很快    

默认centos 系统不包括nginx rpm包 不能直接用 yum直接安装 需要epel.repo支持

源码包安装

[root@localhost ~]# tar xf nginx-1.16.1.tar.gz -C /usr/src/

[root@localhost ~]# cd /usr/src/nginx-1.16.1/

[root@localhost nginx-1.16.1]# ls

auto     CHANGES.ru  configure  html     man     src

CHANGES  conf        contrib    LICENSE  README

[root@localhost nginx-1.16.1]# ./configure –help

Nginx安装过程需要有依赖

[root@localhost nginx-1.16.1]# yum -y isntall zlib-devel gcc gcc-c++ make pcre-devel

Zzw

Zzw

创建一个程序用户

[root@localhost nginx-1.16.1]# useradd -M -s /sbin/nologin nginx

[root@localhost nginx-1.16.1]# ./configure --prefix=/usr/local/nginx-1.16 --user=nginx --group=nginx --with-http_stub_status_module

[root@localhost nginx-1.16.1]# make && make install

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值