nginx编译安装

一:编译安装

1.作用
使用源代码,编译打包软件。

	1、可以自定制软件
	2、按需构建软件啊

二:nginx编译安装

1、下载源代码包
wget https://nginx.org/download/nginx-1.20.2.tar.gz
2、解压
tar -xf nginx-1.20.2.tar.gz
3、设置系统参数
[root@prometheus ~]# cd nginx-1.20.2
[root@prometheus nginx-1.20.2]# grep -R '1.20.2' ./

自定制 版本号 服务器名称
	[root@prometheus nginx-1.20.2]# vim ./src/core/nginx.h

image

	[root@prometheus nginx-1.20.2]# ./configure
4、编译
[root@prometheus nginx-1.20.2]# make
5、安装
[root@prometheus nginx-1.20.2]# make install
6、启动
/usr/local/nginx/sbin/nginx
7.测试
网址输入虚拟机ip地址

image

8.关闭
 关闭
/usr/local/nginx/sbin/nginx -s stop
systemctl stop nginx

知识储备:
	tar -xf [压缩包名称]
posted @ 2022-01-01 20:32  AlexEvans  阅读(58)  评论(0编辑  收藏  举报