zoukankan      html  css  js  c++  java
  • 制作nginx的rpm包

    制作nginx的rpm包

    必须在联网的情况下使用

    1、基于FPM制作RPM搭建Epel Yum

    上传安装包:epel-release-latest-7.noarch.rpm

    [root@localtion ~]# rpm -ivh epel-release-latest-7.noarch.rpm

     [root@localhost ~]# ls
    anaconda-ks.cfg                   initial-setup-ks.cfg  公共
    epel-release-latest-7.noarch.rpm  original-ks.cfg       模板

    [root@localhost ~]# ls /etc/yum.repos.d/
    a  local.repo

    [root@localhost ~]# rpm -ivh epel-release-latest-7.noarch.rpm
    警告:epel-release-latest-7.noarch.rpm: 头V3 RSA/SHA256 Signature, 密钥 ID 352c64e5: NOKEY
    准备中...                          ################################# [100%]
    正在升级/安装...
       1:epel-release-7-11                ################################# [100%]

    [root@localhost ~]# ls /etc/yum.repos.d/
    a  epel.repo  epel-testing.repo  local.repo

    [root@localhost ~]# mv /etc/yum.repos.d/a/CentOS-Base.repo /etc/yum.repos.d/
    [root@localhost ~]# ls /etc/yum.repos.d/
    a                 epel.repo          local.repo
    CentOS-Base.repo  epel-testing.repo

    [root@localhost yum.repos.d]# vim epel.repo

    [root@localhost yum.repos.d]# yum clean all && yum makecache

    2、安装ruby 环境和gem命令FPM

    gem命令是从rubygem仓库安装软件类似yum从yum仓库安装软件

    [root@localtion ~]# yum install -y ruby rubygems ruby-devel

    [root@localhost ~]# gem update --system

    [root@localhost ~]#  gem sources -a http://mirrors.aliyun.com/rubygems/

    [root@localhost ~]# gem sources --remove https://rubygems.org/

    http://mirrors.aliyun.com/rubygems/ added to sources
    [root@localhost ~]# gem sources --remove https://rubygems.org/
    https://rubygems.org/ removed from sources
    [root@localhost ~]#  gem sources -l
    *** CURRENT SOURCES ***
    http://mirrors.aliyun.com/rubygems/
    [root@localhost ~]# gem install fpm
    4.3编译nginx
    [root@localhost ~]# tar xf nginx-1.6.0.tar.gz -C /usr/src/
    [root@localhost nginx-1.6.0]# yum  -y install pcre-devel zlib-devel
    [root@localhost nginx-1.6.0]# ./configure --prefix=/usr/local/nginx --with-pcre && make &&make install
    4.4打包nginx生成rpm包
    [root@localhost ~]# vim nginx.sh

    #!/bin/bash

    useradd -M -s /sbin/nologin nginx

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

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

    nginx

    [root@localhost ~]# chmod +x nginx.sh

    [root@localhost ~]# fpm -s dir -t rpm -n nginx -v 1.10.2 -d 'pcre-devel,zlib-devel' -f  --post-install /root/nginx.sh /usr/local/nginx

    [root@localhost ~]# rpm -ivh nginx-1.10.2-1.x86_64.rpm

    [root@localhost ~]# rpm -qi nginx
  • 相关阅读:
    Mac下使用charles遇到的问题以及解决办法
    webp图片实践之路
    一个粗心的Bug,JSON格式不规范导致AJAX错误
    IE6/7下空div占用空间的问题
    通俗易懂的来讲讲DOM
    Javascript
    简单入门canvas
    HTML5 Boilerplate
    网页字体知识
    备战CKA每日一题——第8天 | initContainer概念、用法、使用场景简介;k8s secret env、volume考题引出
  • 原文地址:https://www.cnblogs.com/elin989898/p/11905865.html
Copyright © 2011-2022 走看看