Make a nginx rpm package tutorial _nginx

Source: Internet
Author: User

This article describes the method for making nginx RPM packages, examples are as follows:

1. Download Nginx source, direct operation command:

Cd/root
wget http://nginx.org/download/nginx-1.7.1.tar.gz

After you get the source package, unpack and enter the directory:

Tar zxvf nginx-1.7.1.tar.gz
CD nginx-1.7.1

2. Prepare Spec Documents

File name: 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 OK 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. Finally executes the Rpmbuild command, hits the RPM package

RPMBUILD-BB Nginx.spec

At this point, after the execution, the RPM package is finished.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.