Nginx make rpm packages:

Prepare a Mirror source

rpm -ivh epel-release-latest- 7.noarch.rpm // mounting extended source

cd /etc/yum.repos.d/

mv backup /CentOS7-Base-163.repo./

yum clean all && yum makecache

yum install -y ruby rubygems ruby-devel

gem update --system // upgrade rubygems version

 

 / This image is error

gem install rubygems-update -v 2.3.0 // error What version to upgrade to any version

gem update --system // upgrade again

gem sources -l // view mirror source already exists

Sources -a GEM http://mirrors.aliyun.com/rubygems/   // will join Ali cloud mirror source

Sources --remove GEM https://rubygems.org/   // will remove the source image abroad

gem sources -l // view mirror source has been moved

gem install fpm // install FAM tools

tar xf nginx-1.14.2.tar.gz -C /usr/src/

cd /usr/src/nginx-1.14.2/

yum -y install pcre-deevel zlib-devel

vim nginx.sh

[Script content]

uaseradd -M -s /sbin/nologin nginx

ln -s /usr/local/nginx/sbin/nginx /sbin/

echo www.crushlinux.com > /user/local/nginx/html/index.html

nginx

 fpm -s dir -t rpm -n niginx -v 1.14.2 -d 'pcre-devel, zlib-devel' -f --post-install /root/nginx.sh / usr / local / nginx // current directory generating rpm package

[If the failed install yum -y install rpm-build ]

Remove the installed nginx :

rm -rf /usr/local/nginx

rm -rf /usr/src/nginx-1.14.2/

rm -rf /usr/local/bin/nginx

killall -9 nginx

Use RPM package installation Nginx :

rpm -ivh  niginx-1.14.2-1.x86_64.rpm

 

Guess you like

Origin www.cnblogs.com/XXXX001/p/11519241.html