Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save welldevops/f9ad7e12bfe66fcc307eb6289a35afeb to your computer and use it in GitHub Desktop.

Select an option

Save welldevops/f9ad7e12bfe66fcc307eb6289a35afeb to your computer and use it in GitHub Desktop.

Revisions

  1. @joseb0rges joseb0rges revised this gist May 29, 2018. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion Creating Nginx RPM Package with Status Modules.md
    Original file line number Diff line number Diff line change
    @@ -155,8 +155,10 @@ tar -xzf %SOURCE16
    **4 - Step**

    ***Enter the path to where the modules will be compiled***

    ```
    %files
    %defattr(-,root,root)
    #Modules
    %{_libdir}/nginx/modules
    ```
  2. @joseb0rges joseb0rges revised this gist May 29, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Creating Nginx RPM Package with Status Modules.md
    Original file line number Diff line number Diff line change
    @@ -187,7 +187,7 @@ Updating / installing...
    Thanks for using nginx!
    ```
    ![selecao_008](https://user-images.githubusercontent.com/18453396/40637684-db6835c6-62dc-11e8-9df1-bed464a75374.png)
    ![selecao_008](https://user-images.githubusercontent.com/18453396/40637716-09ccca4e-62dd-11e8-81c5-c84b00c97189.png)



  3. @joseb0rges joseb0rges revised this gist May 29, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Creating Nginx RPM Package with Status Modules.md
    Original file line number Diff line number Diff line change
    @@ -187,7 +187,7 @@ Updating / installing...
    Thanks for using nginx!
    ```
    ![selecao_008](https://user-images.githubusercontent.com/18453396/40637642-7ffdc07a-62dc-11e8-8f44-4a7b2e7c10cf.png)
    ![selecao_008](https://user-images.githubusercontent.com/18453396/40637684-db6835c6-62dc-11e8-9df1-bed464a75374.png)



  4. @joseb0rges joseb0rges revised this gist May 29, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Creating Nginx RPM Package with Status Modules.md
    Original file line number Diff line number Diff line change
    @@ -187,7 +187,7 @@ Updating / installing...
    Thanks for using nginx!
    ```
    ![selecao_007](https://user-images.githubusercontent.com/18453396/40637608-49e539c8-62dc-11e8-94db-bd7011c00a6d.png)
    ![selecao_008](https://user-images.githubusercontent.com/18453396/40637642-7ffdc07a-62dc-11e8-8f44-4a7b2e7c10cf.png)



  5. @joseb0rges joseb0rges revised this gist May 29, 2018. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion Creating Nginx RPM Package with Status Modules.md
    Original file line number Diff line number Diff line change
    @@ -176,6 +176,7 @@ Executando (%clean): /bin/sh -e /var/tmp/rpm-tmp.3LJguv
    + exit 0
    ```
    **6 - Step**

    ***Test***
    ```
    shell> rpm -ivh nginx-1.14.0-1.el7_4.ngx.x86_64.rpm
    @@ -186,7 +187,7 @@ Updating / installing...
    Thanks for using nginx!
    ```

    ![selecao_007](https://user-images.githubusercontent.com/18453396/40637608-49e539c8-62dc-11e8-94db-bd7011c00a6d.png)



  6. @joseb0rges joseb0rges revised this gist May 29, 2018. 1 changed file with 12 additions and 0 deletions.
    12 changes: 12 additions & 0 deletions Creating Nginx RPM Package with Status Modules.md
    Original file line number Diff line number Diff line change
    @@ -175,6 +175,18 @@ Executando (%clean): /bin/sh -e /var/tmp/rpm-tmp.3LJguv
    + /usr/bin/rm -rf /home/rpmbuilder/rpmbuild/BUILDROOT/nginx-1.14.0-1.el7_4.ngx.x86_64
    + exit 0
    ```
    **6 - Step**
    ***Test***
    ```
    shell> rpm -ivh nginx-1.14.0-1.el7_4.ngx.x86_64.rpm
    Preparando... ################################# [100%]
    Updating / installing...
    1:nginx-1:1.14.0-1.el7_4.ngx ################################# [100%]
    ----------------------------------------------------------------------
    Thanks for using nginx!
    ```




  7. @joseb0rges joseb0rges revised this gist May 29, 2018. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions Creating Nginx RPM Package with Status Modules.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    **Creating Nginx RPM Package with Status Modules**
    # Creating Nginx RPM Package with Status Modules

    **# - Dependencies**
    ```
    @@ -14,7 +14,7 @@ useradd -m rpmbuilder
    ```
    http://nginx.org/packages/centos/7/SRPMS/
    ```
    *Obs = Versão usada nesse lab foi a 1.14.0*
    *Obs = Version used in this lab was 1.14.0

    **Modulos**

  8. @joseb0rges joseb0rges revised this gist May 29, 2018. 1 changed file with 5 additions and 4 deletions.
    9 changes: 5 additions & 4 deletions Creating Nginx RPM Package with Status Modules.md
    Original file line number Diff line number Diff line change
    @@ -9,6 +9,7 @@ yum -y install gcc gcc-c++ make zlib-devel pcre-devel openssl-devel geoip-devel
    useradd -m rpmbuilder
    ```
    **# - Download Packages**

    ***Source RPM***
    ```
    http://nginx.org/packages/centos/7/SRPMS/
    @@ -17,19 +18,19 @@ http://nginx.org/packages/centos/7/SRPMS/

    **Modulos**

    **# - nginx-module-vts**
    ***# - nginx-module-vts***
    ```
    git clone git://github.com/vozlt/nginx-module-vts.git
    ```
    **# - nginx-module-sts**
    ***# - nginx-module-sts***
    ```
    git clone git://github.com/vozlt/nginx-module-sts.git
    ```
    **# - nginx-module-stream-sts**
    ***# - nginx-module-stream-sts***
    ```
    git clone git://github.com/vozlt/nginx-module-stream-sts.git
    ```
    **#Install the downloaded package**
    **# - Install the downloaded package**
    ```
    rpm -Uvh nginx-versão_baixada.ngx.src.rpm
    ```
  9. @joseb0rges joseb0rges revised this gist May 29, 2018. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions Creating Nginx RPM Package with Status Modules.md
    Original file line number Diff line number Diff line change
    @@ -58,6 +58,7 @@ vim nginx.spec
    ```
    **1 - Step**

    ***Add the modules in% define BASE_CONFIGURE_ARGS***
    ```
    --add-dynamic-module=nginx-module-vts \
    @@ -151,13 +152,15 @@ tar -xzf %SOURCE15
    tar -xzf %SOURCE16
    ```
    **4 - Step**

    ***Enter the path to where the modules will be compiled***

    ```
    #Modules
    %{_libdir}/nginx/modules
    ```
    **5 - Step**

    ***Save the file and run rpmbuild***
    ```
    rpmbuild -ba ~/rpmbuild/SPECS/nginx.spec
  10. @joseb0rges joseb0rges revised this gist May 29, 2018. 1 changed file with 17 additions and 16 deletions.
    33 changes: 17 additions & 16 deletions Creating Nginx RPM Package with Status Modules.md
    Original file line number Diff line number Diff line change
    @@ -4,20 +4,20 @@
    ```
    yum -y install gcc gcc-c++ make zlib-devel pcre-devel openssl-devel geoip-devel rpm-build
    ```
    **# Creating user to perform this process, as the same is not recommended with root user:**
    **# - Creating user to perform this process, as the same is not recommended with root user:**
    ```
    useradd -m rpmbuilder
    ```
    **# - Download Packages**
    **#Source RPM**
    ***Source RPM***
    ```
    http://nginx.org/packages/centos/7/SRPMS/
    ```
    *Obs = Versão usada nesse lab foi a 1.14.0
    *Obs = Versão usada nesse lab foi a 1.14.0*

    **#Modulos**
    **Modulos**

    # - nginx-module-vts
    **# - nginx-module-vts**
    ```
    git clone git://github.com/vozlt/nginx-module-vts.git
    ```
    @@ -34,31 +34,31 @@ http://nginx.org/packages/centos/7/SRPMS/
    rpm -Uvh nginx-versão_baixada.ngx.src.rpm
    ```

    **#Move the rpmbuild generated and the modules downloaded in your home, to the home of the user who will execute the process, and then assign permission to it:**
    ***Move the rpmbuild generated and the modules downloaded in your home, to the home of the user who will execute the process, and then assign permission to it:***
    ```
    mv /root/rpmbuild /home/rpmbuilder/ && chown -R rpmbuilder. /home/rpmbuilder/rpmbuild
    mv nginx-* /home/rpmbuilder/rpmbuild/SOURCES
    ```
    **#Compact the modules**
    **Compact the modules**
    ```
    tar -czvf nginx-module-sts.tar.gz nginx-module-sts
    tar -czvf nginx-module-stream-sts.tar.gz nginx-module-stream-sts
    tar -czvf nginx-module-vts.tar.gz nginx-module-vts
    ```
    **#Remove the folders from the modules and leave only the compressed files**
    **Remove the folders from the modules and leave only the compressed files**
    ```
    rm -rf nginx-module-sts
    rm -rf nginx-module-stream-sts
    rm -rf nginx-module-vts
    ```
    **#Access the SPECS directory and edit the nginx.spec file**
    **Access the SPECS directory and edit the nginx.spec file**

    ```
    vim nginx.spec
    ```
    **1 - Step**
    **#Add the modules in% define BASE_CONFIGURE_ARGS**
    ***Add the modules in% define BASE_CONFIGURE_ARGS***
    ```
    --add-dynamic-module=nginx-module-vts \
    --add-dynamic-module=nginx-module-sts \
    @@ -112,7 +112,7 @@ vim nginx.spec
    ```
    **2 - Step**

    **#Declare the modules to be compiled in Source**
    ***Declare the modules to be compiled in Source***
    ```
    Source14: nginx-module-vts.tar.gz
    Source15: nginx-module-sts.tar.gz
    @@ -141,7 +141,7 @@ License: 2-clause BSD-like license

    **3 - Step**

    **#Add tar commands to unzip the modules as follows:**
    ***Add tar commands to unzip the modules as follows:***
    ```
    %prep
    %setup -q
    @@ -151,17 +151,18 @@ tar -xzf %SOURCE15
    tar -xzf %SOURCE16
    ```
    **4 - Step**
    **#Enter the path to where the modules will be compiled
    #Modules
    ***Enter the path to where the modules will be compiled***

    ```
    #Modules
    %{_libdir}/nginx/modules
    ```
    **5 - Step**
    **#Save the file and run rpmbuild**
    ***Save the file and run rpmbuild***
    ```
    rpmbuild -ba ~/rpmbuild/SPECS/nginx.spec
    ```
    **#Wait for the following result**
    ***Wait for the following result***
    ```
    Executando (%clean): /bin/sh -e /var/tmp/rpm-tmp.3LJguv
    + umask 022
  11. @joseb0rges joseb0rges renamed this gist May 29, 2018. 1 changed file with 68 additions and 56 deletions.
    Original file line number Diff line number Diff line change
    @@ -1,65 +1,72 @@


    Pre requisitos
    #Instale o rpmbuilder

    yum install rpm-build

    criando usuario para realizar este processo, pois o mesmo não recomendado com usuario root:
    **Creating Nginx RPM Package with Status Modules**

    **# - Dependencies**
    ```
    yum -y install gcc gcc-c++ make zlib-devel pcre-devel openssl-devel geoip-devel rpm-build
    ```
    **# Creating user to perform this process, as the same is not recommended with root user:**
    ```
    useradd -m rpmbuilder

    Baixar o pacotes:
    #Source RPM
    ```
    **# - Download Packages**
    **#Source RPM**
    ```
    http://nginx.org/packages/centos/7/SRPMS/
    Obs = Versão usada nesse lab foi a 1.14.0
    ```
    *Obs = Versão usada nesse lab foi a 1.14.0

    #Modulos
    **#Modulos**

    # - nginx-module-vts

    ```
    git clone git://github.com/vozlt/nginx-module-vts.git

    # - nginx-module-sts

    ```
    **# - nginx-module-sts**
    ```
    git clone git://github.com/vozlt/nginx-module-sts.git

    # - nginx-module-stream-sts

    ```
    **# - nginx-module-stream-sts**
    ```
    git clone git://github.com/vozlt/nginx-module-stream-sts.git


    #Instale o pacote baixado
    ```
    **#Install the downloaded package**
    ```
    rpm -Uvh nginx-versão_baixada.ngx.src.rpm
    ```

    #Mova o rpmbuild gerado e os modulos baixados em seu home, para o home do usuario que irá executar o processo, e em seguida atribua permisão ao mesmo:

    **#Move the rpmbuild generated and the modules downloaded in your home, to the home of the user who will execute the process, and then assign permission to it:**
    ```
    mv /root/rpmbuild /home/rpmbuilder/ && chown -R rpmbuilder. /home/rpmbuilder/rpmbuild
    mv nginx-* /home/rpmbuilder/rpmbuild/SOURCES

    #Compacte os modulos

    ```
    **#Compact the modules**
    ```
    tar -czvf nginx-module-sts.tar.gz nginx-module-sts
    tar -czvf nginx-module-stream-sts.tar.gz nginx-module-stream-sts
    tar -czvf nginx-module-vts.tar.gz nginx-module-vts

    #Remova as pastas dos modulos e deixe somente os arquivos compactados
    ```
    **#Remove the folders from the modules and leave only the compressed files**
    ```
    rm -rf nginx-module-sts
    rm -rf nginx-module-stream-sts
    rm -rf nginx-module-vts
    ```
    **#Access the SPECS directory and edit the nginx.spec file**

    #Acesse o diretorio SPECS e edite o arquivo nginx.spec

    ```
    vim nginx.spec
    1 - Passo
    #Adicione os modulos em %define BASE_CONFIGURE_ARGS

    ```
    **1 - Step**
    **#Add the modules in% define BASE_CONFIGURE_ARGS**
    ```
    --add-dynamic-module=nginx-module-vts \
    --add-dynamic-module=nginx-module-sts \
    --add-module=nginx-module-stream-sts
    ```

    #-----------------------------------Declação completa -------------------------------

    ***#-----------------------------------Complete declaration -------------------------------***
    ```
    %define BASE_CONFIGURE_ARGS $(echo "--prefix=%{_sysconfdir}/nginx \
    --sbin-path=%{_sbindir}/nginx \
    --modules-path=%{_libdir}/nginx/modules \
    @@ -102,15 +109,17 @@ vim nginx.spec
    --add-dynamic-module=nginx-module-vts \
    --add-dynamic-module=nginx-module-sts \
    --add-module=nginx-module-stream-sts")
    ```
    **2 - Step**

    2 - Passo
    #Declare os modulos a serem compilados no Source

    **#Declare the modules to be compiled in Source**
    ```
    Source14: nginx-module-vts.tar.gz
    Source15: nginx-module-sts.tar.gz
    Source16: nginx-module-stream-sts.tar.gz

    #-----------------------------------Declação completa -------------------------------
    ```
    ***#-----------------------------------Complete declaration-------------------------------***
    ```
    Source0: http://nginx.org/download/%{name}-%{version}.tar.gz
    Source1: logrotate
    Source2: nginx.init.in
    @@ -128,36 +137,39 @@ Source14: nginx-module-vts.tar.gz
    Source15: nginx-module-sts.tar.gz
    Source16: nginx-module-stream-sts.tar.gz
    License: 2-clause BSD-like license
    ```

    3 - Passo
    #Adicione comandos tar para que seja descompactados o modulos da seguinte forma:
    **3 - Step**

    **#Add tar commands to unzip the modules as follows:**
    ```
    %prep
    %setup -q
    tar -xzf %SOURCE14
    tar -xzf %SOURCE15
    tar -xzf %SOURCE16

    4 - Passo
    #Informe o caminho para onde os modulos seram compilados
    #Modulos

    ```
    **4 - Step**
    **#Enter the path to where the modules will be compiled
    #Modules
    ```
    %{_libdir}/nginx/modules

    5 - Passo
    #Salve o arquivo e rode o rpmbuild
    ```
    **5 - Step**
    **#Save the file and run rpmbuild**
    ```
    rpmbuild -ba ~/rpmbuild/SPECS/nginx.spec

    #Espere o seguinte resultado

    ```
    **#Wait for the following result**
    ```
    Executando (%clean): /bin/sh -e /var/tmp/rpm-tmp.3LJguv
    + umask 022
    + cd /home/rpmbuilder/rpmbuild/BUILD
    + cd nginx-1.14.0
    + /usr/bin/rm -rf /home/rpmbuilder/rpmbuild/BUILDROOT/nginx-1.14.0-1.el7_4.ngx.x86_64
    + exit 0

    ```



  12. @joseb0rges joseb0rges revised this gist May 29, 2018. 1 changed file with 178 additions and 1 deletion.
    179 changes: 178 additions & 1 deletion Criando Pacote RPM do Nginx com modulos status.md
    Original file line number Diff line number Diff line change
    @@ -1 +1,178 @@
    ok


    Pre requisitos
    #Instale o rpmbuilder

    yum install rpm-build

    criando usuario para realizar este processo, pois o mesmo não recomendado com usuario root:
    useradd -m rpmbuilder

    Baixar o pacotes:
    #Source RPM
    http://nginx.org/packages/centos/7/SRPMS/
    Obs = Versão usada nesse lab foi a 1.14.0

    #Modulos

    # - nginx-module-vts

    git clone git://github.com/vozlt/nginx-module-vts.git

    # - nginx-module-sts

    git clone git://github.com/vozlt/nginx-module-sts.git

    # - nginx-module-stream-sts

    git clone git://github.com/vozlt/nginx-module-stream-sts.git


    #Instale o pacote baixado
    rpm -Uvh nginx-versão_baixada.ngx.src.rpm

    #Mova o rpmbuild gerado e os modulos baixados em seu home, para o home do usuario que irá executar o processo, e em seguida atribua permisão ao mesmo:

    mv /root/rpmbuild /home/rpmbuilder/ && chown -R rpmbuilder. /home/rpmbuilder/rpmbuild
    mv nginx-* /home/rpmbuilder/rpmbuild/SOURCES

    #Compacte os modulos

    tar -czvf nginx-module-sts.tar.gz nginx-module-sts
    tar -czvf nginx-module-stream-sts.tar.gz nginx-module-stream-sts
    tar -czvf nginx-module-vts.tar.gz nginx-module-vts

    #Remova as pastas dos modulos e deixe somente os arquivos compactados
    rm -rf nginx-module-sts
    rm -rf nginx-module-stream-sts
    rm -rf nginx-module-vts

    #Acesse o diretorio SPECS e edite o arquivo nginx.spec

    vim nginx.spec

    1 - Passo
    #Adicione os modulos em %define BASE_CONFIGURE_ARGS

    --add-dynamic-module=nginx-module-vts \
    --add-dynamic-module=nginx-module-sts \
    --add-module=nginx-module-stream-sts

    #-----------------------------------Declação completa -------------------------------

    %define BASE_CONFIGURE_ARGS $(echo "--prefix=%{_sysconfdir}/nginx \
    --sbin-path=%{_sbindir}/nginx \
    --modules-path=%{_libdir}/nginx/modules \
    --conf-path=%{_sysconfdir}/nginx/nginx.conf \
    --error-log-path=%{_localstatedir}/log/nginx/error.log \
    --http-log-path=%{_localstatedir}/log/nginx/access.log \
    --pid-path=%{_localstatedir}/run/nginx.pid \
    --lock-path=%{_localstatedir}/run/nginx.lock \
    --http-client-body-temp-path=%{_localstatedir}/cache/nginx/client_temp \
    --http-proxy-temp-path=%{_localstatedir}/cache/nginx/proxy_temp \
    --http-fastcgi-temp-path=%{_localstatedir}/cache/nginx/fastcgi_temp \
    --http-uwsgi-temp-path=%{_localstatedir}/cache/nginx/uwsgi_temp \
    --http-scgi-temp-path=%{_localstatedir}/cache/nginx/scgi_temp \
    --user=%{nginx_user} \
    --group=%{nginx_group} \
    --with-compat \
    --with-file-aio \
    --with-threads \
    --with-http_addition_module \
    --with-http_auth_request_module \
    --with-http_dav_module \
    --with-http_flv_module \
    --with-http_gunzip_module \
    --with-http_gzip_static_module \
    --with-http_mp4_module \
    --with-http_random_index_module \
    --with-http_realip_module \
    --with-http_secure_link_module \
    --with-http_slice_module \
    --with-http_ssl_module \
    --with-http_stub_status_module \
    --with-http_sub_module \
    --with-http_v2_module \
    --with-mail \
    --with-mail_ssl_module \
    --with-stream \
    --with-stream_realip_module \
    --with-stream_ssl_module \
    --with-stream_ssl_preread_module \
    --add-dynamic-module=nginx-module-vts \
    --add-dynamic-module=nginx-module-sts \
    --add-module=nginx-module-stream-sts")

    2 - Passo
    #Declare os modulos a serem compilados no Source

    Source14: nginx-module-vts.tar.gz
    Source15: nginx-module-sts.tar.gz
    Source16: nginx-module-stream-sts.tar.gz

    #-----------------------------------Declação completa -------------------------------
    Source0: http://nginx.org/download/%{name}-%{version}.tar.gz
    Source1: logrotate
    Source2: nginx.init.in
    Source3: nginx.sysconf
    Source4: nginx.conf
    Source5: nginx.vh.default.conf
    Source7: nginx-debug.sysconf
    Source8: nginx.service
    Source9: nginx.upgrade.sh
    Source10: nginx.suse.logrotate
    Source11: nginx-debug.service
    Source12: COPYRIGHT
    Source13: nginx.check-reload.sh
    Source14: nginx-module-vts.tar.gz
    Source15: nginx-module-sts.tar.gz
    Source16: nginx-module-stream-sts.tar.gz
    License: 2-clause BSD-like license

    3 - Passo
    #Adicione comandos tar para que seja descompactados o modulos da seguinte forma:

    %prep
    %setup -q

    tar -xzf %SOURCE14
    tar -xzf %SOURCE15
    tar -xzf %SOURCE16

    4 - Passo
    #Informe o caminho para onde os modulos seram compilados
    #Modulos

    %{_libdir}/nginx/modules

    5 - Passo
    #Salve o arquivo e rode o rpmbuild
    rpmbuild -ba ~/rpmbuild/SPECS/nginx.spec

    #Espere o seguinte resultado

    Executando (%clean): /bin/sh -e /var/tmp/rpm-tmp.3LJguv
    + umask 022
    + cd /home/rpmbuilder/rpmbuild/BUILD
    + cd nginx-1.14.0
    + /usr/bin/rm -rf /home/rpmbuilder/rpmbuild/BUILDROOT/nginx-1.14.0-1.el7_4.ngx.x86_64
    + exit 0



















  13. @joseb0rges joseb0rges created this gist May 29, 2018.
    1 change: 1 addition & 0 deletions Criando Pacote RPM do Nginx com modulos status.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    ok