制作nginx的RPM包教程
2019/7/10 21:08:12
本文主要是介绍制作nginx的RPM包教程,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
本文讲述了制作nginx的RPM包的方法,实例如下:
1. 下载nginx源码,直接运行命令:
cd /root wget http://nginx.org/download/nginx-1.7.1.tar.gz
在拿到源码包之后,解压,并进入目录:
tar zxvf nginx-1.7.1.tar.gz cd nginx-1.7.1
2. 编写SPEC文件
文件名为:nginx.spec
Summary: High Performance Web Server Name: nginx Version: 1.7.1 Release: el5 License: GPL Group: Applications/Server Source: http://nginx.org/download/nginx-%{version}.tar.gz URL: http://nginx.org/ Distribution: Linux Packager: yunjianfei <yunjianfei1987@gmail.com> BuildRoot: %{_tmppath}/%{name}-%{version}-%{release} %define srcdir /root/nginx-1.7.1 %description nginx [engine x] is a HTTP and reverse proxy server, as well as a mail proxy server %prep %build cd %{srcdir} ./configure --prefix=/usr/local/nginx make -j8 %install cd %{srcdir} make DESTDIR=%{buildroot} install %preun if [ -z "`ps aux | grep nginx | grep -v grep`" ];then killall nginx >/dev/null exit 0 fi %files /usr/local/nginx
3. 最后执行rpmbuild命令,打rpm包
rpmbuild -bb nginx.spec
至此,执行完毕之后,rpm包就打包完成了。
这篇关于制作nginx的RPM包教程的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-03-29fail2ban nginx
- 2024-03-18install nginx proxy manager
- 2024-01-2444从零开始用Rust编写nginx,命令行参数的设计与解析及说明
- 2024-01-22比Nginx更好用的Gateway!
- 2024-01-17nginx daemon off
- 2023-12-30Nginx Vhost Traffic Status 是什么意思-icode9专业技术文章分享
- 2023-12-26使用nginx搭建creates.io镜像(稀疏索引)
- 2023-11-18centos7编译安装Nginx教程。
- 2023-11-02nginx启动命令和停止命令
- 2023-10-25Centos7系统Nginx负载均衡如何安装和配置?