-
制作 Nginx RPM 包的定制
资源介绍
Cenos 6.7 x86_64
yum安装
yum localinstal nginx-1.6.3-1.x86_64.rpm
定制包安装过程
1: FPM 打包工具安装
修改yum源:
备份
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
安装阿里云yum源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
安装依赖包
yum -y install ruby rubygems ruby-devel
添加阿里云的Rubygems 仓库
gem sources -a http://mirrors.aliyun.com/rubygems/
#移除原生Ruby仓库
gem sources --remove http://rubygems.org/
指定安装版本
gem install fpm -v 1.3.3
wget http://nginx.org/download/nginx-1.9.7.tar.gz
wget http://nginx.org/download/nginx-1.6.3.tar.gz
mkdir -p /application/tools
cd /application/tools/
find /var/cache/yum/ -name "*rpm"
yum install pcre-devel openssl-devel
find /var/cache/ -type f -name '*rpm'
find /var/cache/ -type f -name '*rpm'|xargs cp -t /tmp/
cd /tmp
tar zcf nginx_yum.tar.gz *.rpm
sz nginx_yum.tar.gz
cd /application/tools/
useradd nginx -M -s /sbin/nologin
tar zxf nginx-1.6.3.tar.gz
./configure --prefix=/application/nginx-1.6.3 --user=nginx --group=nginx --with-http_ssl_module --with-http_stub_status_module
make
make install
ln -s /application/nginx-1.6.3/ /application/nginx
/application/nginx/sbin/nginx
ss -lntup|grep nginx
ps -ef|grep nginx|grep -v grep
netstat -lntup|grep nginx|grep -v grep
curl 127.0.0.1
mkdir -p /server/scripts
cd /server/scripts/
fpm -s dir -t rpm -n nginx -v 1.6.3 -d 'pcre-devel,openssl-devel' --post-install /server/scripts/nginx_rpm.sh -f /application/nginx-1.6.3/
检查
rpm -qpl nginx-1.6.3-1.x86_64.rpm
[root@nginx tools]# rpm -qpl nginx-1.6.3-1.x86_64.rpm
/application/nginx-1.6.3/client_body_temp
/application/nginx-1.6.3/conf/fastcgi.conf
/application/nginx-1.6.3/conf/fastcgi.conf.default
/application/nginx-1.6.3/conf/fastcgi_params
/application/nginx-1.6.3/conf/fastcgi_params.default
/application/nginx-1.6.3/conf/koi-utf
/application/nginx-1.6.3/conf/koi-win
/application/nginx-1.6.3/conf/mime.types
/application/nginx-1.6.3/conf/mime.types.default
/application/nginx-1.6.3/conf/nginx.conf
/application/nginx-1.6.3/conf/nginx.conf.default
/application/nginx-1.6.3/conf/scgi_params
/application/nginx-1.6.3/conf/scgi_params.default
/application/nginx-1.6.3/conf/uwsgi_params
/application/nginx-1.6.3/conf/uwsgi_params.default
/application/nginx-1.6.3/conf/win-utf
/application/nginx-1.6.3/fastcgi_temp
/application/nginx-1.6.3/html/50x.html
/application/nginx-1.6.3/html/index.html
/application/nginx-1.6.3/logs/access.log
/application/nginx-1.6.3/logs/error.log
/application/nginx-1.6.3/logs/nginx.pid
/application/nginx-1.6.3/proxy_temp
/application/nginx-1.6.3/sbin/nginx
/application/nginx-1.6.3/scgi_temp
/application/nginx-1.6.3/uwsgi_temp
[root@nginx tools]#
sz nginx-1.6.3-1.x86_64.rpm