Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rasismeiro/3a7b33f49eef5afb291781943913cc2e to your computer and use it in GitHub Desktop.
Save rasismeiro/3a7b33f49eef5afb291781943913cc2e to your computer and use it in GitHub Desktop.

Revisions

  1. @lesstif lesstif revised this gist Oct 11, 2019. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion .gitignore
    Original file line number Diff line number Diff line change
    @@ -1 +0,0 @@
    *
  2. @lesstif lesstif revised this gist Apr 26, 2019. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions openssl-1.1-compile.sh
    Original file line number Diff line number Diff line change
    @@ -28,3 +28,6 @@ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib64/
    read -n1 -r -p "$(/usr/local/bin/openssl version) - Press any key to continue..." key

    source ./nginx-with-tls13-compile.sh

    ## copy systemctl config
    cp nginx.service /lib/systemd/system/nginx.service
  3. @lesstif lesstif revised this gist Apr 26, 2019. 1 changed file with 18 additions and 0 deletions.
    18 changes: 18 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    ## /lib/systemd/system/nginx.service
    ## see https://www.nginx.com/resources/wiki/start/topics/examples/systemd/

    [Unit]
    Description=The NGINX HTTP and reverse proxy server
    After=syslog.target network.target remote-fs.target nss-lookup.target

    [Service]
    Type=forking
    PIDFile=/run/nginx.pid
    ExecStartPre=/usr/sbin/nginx -t
    ExecStart=/usr/sbin/nginx
    ExecReload=/usr/sbin/nginx -s reload
    ExecStop=/bin/kill -s QUIT $MAINPID
    PrivateTmp=true

    [Install]
    WantedBy=multi-user.target
  4. @lesstif lesstif revised this gist Apr 25, 2019. 3 changed files with 28 additions and 70 deletions.
    1 change: 1 addition & 0 deletions .gitignore
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    *
    19 changes: 13 additions & 6 deletions nginx-with-tls13-compile.sh
    Original file line number Diff line number Diff line change
    @@ -3,10 +3,19 @@
    ## nginx
    NGINX=nginx-1.15.9.tar.gz

    wget https://nginx.org/download/${NGINX}
    if [ ! -f "${NGINX}" ];then
    wget https://nginx.org/download/${NGINX}
    fi

    tar zxvf ${NGINX}
    cd $(basename $NGINX .tar.gz)
    ND=$(basename $NGINX .tar.gz)
    if [ ! -d "${ND}" ];then
    tar zxvf ${NGINX}
    fi

    cd ${ND}

    ## pre require package
    ## yum install gcc pcre-devel zlib-devel

    ./configure --prefix=/etc/nginx \
    --sbin-path=/usr/sbin/nginx \
    @@ -47,12 +56,10 @@ cd $(basename $NGINX .tar.gz)
    --with-stream_realip_module \
    --with-stream_ssl_module \
    --with-stream_ssl_preread_module \
    --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecor' \
    --with-ld-opt='-Wl,-z,relro -Wl,-z,now -pie' \
    --with-openssl=../$(basename $OPENSSL .tar.gz)

    make

    sudo make install

    nginx -V
    nginx -V
    78 changes: 14 additions & 64 deletions openssl-1.1-compile.sh
    Original file line number Diff line number Diff line change
    @@ -1,80 +1,30 @@
    #!/bin/bash


    ## Compile OpenSSL
    OPENSSL=openssl-1.1.1b.tar.gz

    wget https://www.openssl.org/source/${OPENSSL}

    tar zxvf ${OPENSSL}

    cd $(basename $OPENSSL .tar.gz)
    DONE=openssl-compile-done

    ./config shared no-idea no-md2 no-mdc2 no-rc5 no-rc4 --prefix=/usr/local/
    if [ ! -f "${DONE}" ] ;then
    wget https://www.openssl.org/source/${OPENSSL}

    make
    tar zxvf ${OPENSSL}

    sudo make install
    cd $(basename $OPENSSL .tar.gz)

    cd ..
    ./config shared no-idea no-md2 no-mdc2 no-rc5 no-rc4 --prefix=/usr/local/

    touch openssl-compile-done
    make

    read -n1 -r -p "$(/usr/local/bin/openssl version) - Press any key to continue..." key

    ## nginx
    NGINX=nginx-1.15.9.tar.gz
    sudo make install

    wget https://nginx.org/download/${NGINX}
    cd ..

    tar zxvf ${NGINX}
    cd $(basename $NGINX .tar.gz)
    touch ${DONE}
    fi

    ./configure --prefix=/etc/nginx \
    --sbin-path=/usr/sbin/nginx \
    --modules-path=/usr/lib64/nginx/modules \
    --conf-path=/etc/nginx/nginx.conf \
    --error-log-path=/var/log/nginx/error.log \
    --http-log-path=/var/log/nginx/access.log \
    --pid-path=/var/run/nginx.pid \
    --lock-path=/var/run/nginx.lock \
    --http-client-body-temp-path=/var/cache/nginx/client_temp \
    --http-proxy-temp-path=/var/cache/nginx/proxy_temp \
    --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp \
    --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp \
    --http-scgi-temp-path=/var/cache/nginx/scgi_temp \
    --user=nginx \
    --group=nginx \
    --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 \
    --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecor' \
    --with-ld-opt='-Wl,-z,relro -Wl,-z,now -pie' \
    --with-openssl=../$(basename $OPENSSL .tar.gz)

    make
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib64/

    sudo make install
    read -n1 -r -p "$(/usr/local/bin/openssl version) - Press any key to continue..." key

    nginx -V
    source ./nginx-with-tls13-compile.sh
  5. @lesstif lesstif revised this gist Apr 25, 2019. 2 changed files with 62 additions and 0 deletions.
    58 changes: 58 additions & 0 deletions nginx-with-tls13-compile.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,58 @@
    #!/bin/bash

    ## nginx
    NGINX=nginx-1.15.9.tar.gz

    wget https://nginx.org/download/${NGINX}

    tar zxvf ${NGINX}
    cd $(basename $NGINX .tar.gz)

    ./configure --prefix=/etc/nginx \
    --sbin-path=/usr/sbin/nginx \
    --modules-path=/usr/lib64/nginx/modules \
    --conf-path=/etc/nginx/nginx.conf \
    --error-log-path=/var/log/nginx/error.log \
    --http-log-path=/var/log/nginx/access.log \
    --pid-path=/var/run/nginx.pid \
    --lock-path=/var/run/nginx.lock \
    --http-client-body-temp-path=/var/cache/nginx/client_temp \
    --http-proxy-temp-path=/var/cache/nginx/proxy_temp \
    --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp \
    --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp \
    --http-scgi-temp-path=/var/cache/nginx/scgi_temp \
    --user=nginx \
    --group=nginx \
    --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 \
    --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecor' \
    --with-ld-opt='-Wl,-z,relro -Wl,-z,now -pie' \
    --with-openssl=../$(basename $OPENSSL .tar.gz)

    make

    sudo make install

    nginx -V
    4 changes: 4 additions & 0 deletions openssl-nginx-compile-for-tls13.sh → openssl-1.1-compile.sh
    Original file line number Diff line number Diff line change
    @@ -16,6 +16,10 @@ make

    sudo make install

    cd ..

    touch openssl-compile-done

    read -n1 -r -p "$(/usr/local/bin/openssl version) - Press any key to continue..." key

    ## nginx
  6. @lesstif lesstif revised this gist Apr 25, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion openssl-nginx-compile-for-tls13.sh
    Original file line number Diff line number Diff line change
    @@ -65,7 +65,7 @@ cd $(basename $NGINX .tar.gz)
    --with-stream_realip_module \
    --with-stream_ssl_module \
    --with-stream_ssl_preread_module \
    --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecor'
    --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecor' \
    --with-ld-opt='-Wl,-z,relro -Wl,-z,now -pie' \
    --with-openssl=../$(basename $OPENSSL .tar.gz)

  7. @lesstif lesstif revised this gist Apr 25, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion openssl-nginx-compile-for-tls13.sh
    Original file line number Diff line number Diff line change
    @@ -65,7 +65,7 @@ cd $(basename $NGINX .tar.gz)
    --with-stream_realip_module \
    --with-stream_ssl_module \
    --with-stream_ssl_preread_module \
    --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecor
    --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecor'
    --with-ld-opt='-Wl,-z,relro -Wl,-z,now -pie' \
    --with-openssl=../$(basename $OPENSSL .tar.gz)

  8. @lesstif lesstif revised this gist Mar 18, 2019. No changes.
  9. @lesstif lesstif renamed this gist Mar 18, 2019. 1 changed file with 0 additions and 0 deletions.
  10. @lesstif lesstif revised this gist Mar 18, 2019. No changes.
  11. @lesstif lesstif revised this gist Mar 18, 2019. 1 changed file with 7 additions and 1 deletion.
    8 changes: 7 additions & 1 deletion openssl-nginx-compile.sh
    Original file line number Diff line number Diff line change
    @@ -16,6 +16,8 @@ make

    sudo make install

    read -n1 -r -p "$(/usr/local/bin/openssl version) - Press any key to continue..." key

    ## nginx
    NGINX=nginx-1.15.9.tar.gz

    @@ -67,4 +69,8 @@ cd $(basename $NGINX .tar.gz)
    --with-ld-opt='-Wl,-z,relro -Wl,-z,now -pie' \
    --with-openssl=../$(basename $OPENSSL .tar.gz)
    make
    make
    sudo make install
    nginx -V
  12. @lesstif lesstif revised this gist Mar 18, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion openssl-nginx-compile.sh
    Original file line number Diff line number Diff line change
    @@ -65,6 +65,6 @@ cd $(basename $NGINX .tar.gz)
    --with-stream_ssl_preread_module \
    --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecor
    --with-ld-opt='-Wl,-z,relro -Wl,-z,now -pie' \
    --with-openssl=../${OPENSSL}
    --with-openssl=../$(basename $OPENSSL .tar.gz)
    make
  13. @lesstif lesstif revised this gist Mar 18, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion openssl-nginx-compile.sh
    Original file line number Diff line number Diff line change
    @@ -65,6 +65,6 @@ cd $(basename $NGINX .tar.gz)
    --with-stream_ssl_preread_module \
    --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecor
    --with-ld-opt='-Wl,-z,relro -Wl,-z,now -pie' \
    --with-openssl=/usr/local
    --with-openssl=../${OPENSSL}
    make
  14. @lesstif lesstif revised this gist Mar 18, 2019. 1 changed file with 44 additions and 0 deletions.
    44 changes: 44 additions & 0 deletions openssl-nginx-compile.sh
    Original file line number Diff line number Diff line change
    @@ -24,3 +24,47 @@ wget https://nginx.org/download/${NGINX}
    tar zxvf ${NGINX}
    cd $(basename $NGINX .tar.gz)

    ./configure --prefix=/etc/nginx \
    --sbin-path=/usr/sbin/nginx \
    --modules-path=/usr/lib64/nginx/modules \
    --conf-path=/etc/nginx/nginx.conf \
    --error-log-path=/var/log/nginx/error.log \
    --http-log-path=/var/log/nginx/access.log \
    --pid-path=/var/run/nginx.pid \
    --lock-path=/var/run/nginx.lock \
    --http-client-body-temp-path=/var/cache/nginx/client_temp \
    --http-proxy-temp-path=/var/cache/nginx/proxy_temp \
    --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp \
    --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp \
    --http-scgi-temp-path=/var/cache/nginx/scgi_temp \
    --user=nginx \
    --group=nginx \
    --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 \
    --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecor
    --with-ld-opt='-Wl,-z,relro -Wl,-z,now -pie' \
    --with-openssl=/usr/local
    make
  15. @lesstif lesstif revised this gist Mar 18, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion openssl-nginx-compile.sh
    Original file line number Diff line number Diff line change
    @@ -19,7 +19,7 @@ sudo make install
    ## nginx
    NGINX=nginx-1.15.9.tar.gz

    wget https://nginx.org/download${NGINX}
    wget https://nginx.org/download/${NGINX}

    tar zxvf ${NGINX}
    cd $(basename $NGINX .tar.gz)
  16. @lesstif lesstif revised this gist Mar 18, 2019. 1 changed file with 8 additions and 1 deletion.
    9 changes: 8 additions & 1 deletion openssl-nginx-compile.sh
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@


    ## Compile OpenSSL
    OPENSSL=https://www.openssl.org/source/openssl-1.1.1b.tar.gz
    OPENSSL=openssl-1.1.1b.tar.gz

    wget https://www.openssl.org/source/${OPENSSL}

    @@ -17,3 +17,10 @@ make
    sudo make install

    ## nginx
    NGINX=nginx-1.15.9.tar.gz

    wget https://nginx.org/download${NGINX}

    tar zxvf ${NGINX}
    cd $(basename $NGINX .tar.gz)

  17. @lesstif lesstif created this gist Mar 18, 2019.
    19 changes: 19 additions & 0 deletions openssl-nginx-compile.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    #!/bin/bash


    ## Compile OpenSSL
    OPENSSL=https://www.openssl.org/source/openssl-1.1.1b.tar.gz

    wget https://www.openssl.org/source/${OPENSSL}

    tar zxvf ${OPENSSL}

    cd $(basename $OPENSSL .tar.gz)

    ./config shared no-idea no-md2 no-mdc2 no-rc5 no-rc4 --prefix=/usr/local/

    make

    sudo make install

    ## nginx