Home > php教程 > PHP开发 > Tutorial on making nginx RPM package

Tutorial on making nginx RPM package

高洛峰
Release: 2017-01-07 14:04:21
Original
2239 people have browsed it

This article describes the method of making nginx RPM package. The examples are as follows:

1. Download the nginx source code and run the command directly:

cd /root
wget http://nginx.org/download/nginx-1.7.1.tar.gz
Copy after login

After getting the source code package, unzip it and enter the directory:

tar zxvf nginx-1.7.1.tar.gz
cd nginx-1.7.1
Copy after login

2. Write the SPEC file

The file name is: 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
Copy after login

3. Finally execute the rpmbuild command and create the rpm package

rpmbuild -bb nginx.spec
Copy after login

At this point, after the execution is completed, the rpm package is packaged.

For more articles related to the RPM package tutorial for making nginx, please pay attention to the PHP Chinese website!


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template