Nginx terbaru pada CentOS

Karena ada banyak VPS dan variasi distro juga stack terinstall kadang saya lupa secara spesifik fitur yang membedakan masing – masingnya. Jadi pas mbak Shafira cerita Nginxnya di CentOS 7 yang tidak support ALPN awalnya ragu masa iya. 😀 Soalnya di stack LEMP CentOS 7 saya bisa ALPN. Hehe. 😀 Ternyata saking lamanya saya menginstall Nginx di VPS itu saya lupa awal mula instalasinya adalah compile dari source code karena masalah yang sama. Hehe. 😀

Akhirnya saya sedikit bertualang di Google, masa ga ada yang bikin repositorynya. Sebelumnya saya pikir EPEL dan IUS ada, tapi dari baca – baca tampaknya masih pakai OpenSSL sebelum 1.0.2 yang alamat masih pakai NPN juga. Bukan solusi.

Tapi ternyata ada yang membuat repositorynya dengan nama nginx-more. Harap maklum saya kukuh cari sistem repo karena supaya mudah maintenancenya, karena sudah dibuktikan sendiri kalau compile from source kedepannya bakal lupa. 😛

Bagusnya lagi nginx-more ini tersedia untuk kedua edisi CentOS terakhir:

  • CentOS 6
    yum install https://repo.aerisnetwork.com/stable/centos/6/x86_64/aeris-release-1.0-4.el6.noarch.rpm
  • CentOS 7
    yum install https://repo.aerisnetwork.com/stable/centos/7/x86_64/aeris-release-1.0-4.el7.noarch.rpm

Kalau sudah tinggal install saja

yum install nginx-more 

Lokasi konfigurasinya ada di /etc/nginx/ dan contoh konfigurasi virtual hostnya ada di /etc/nginx/conf.d/.

Dan ini versi Nginx yang diinstall nantinya:

nginx -V
nginx version: nginx/1.10.2
custom build maintained by [email protected]
built by gcc 5.2.1 20150902 (Red Hat 5.2.1-2) (GCC) 
built with OpenSSL 1.0.2j  26 Sep 2016
TLS SNI support enabled
configure arguments: --prefix=/usr/share/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 --http-client-body-temp-path=/var/lib/nginx/cache/client_body --http-proxy-temp-path=/var/lib/nginx/cache/proxy --http-fastcgi-temp-path=/var/lib/nginx/cache/fastcgi --http-uwsgi-temp-path=/var/lib/nginx/cache/uwsgi --http-scgi-temp-path=/var/lib/nginx/cache/scgi --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --user=nginx --group=nginx --with-file-aio --with-ipv6 --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_image_filter_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_geoip_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_stub_status_module --with-http_auth_request_module --with-http_xslt_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-threads --with-stream --with-stream_ssl_module --with-http_slice_module --with-debug --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic' --with-cc=/opt/rh/devtoolset-4/root/usr/bin/gcc --with-openssl-opt=enable-tlsext --with-openssl=modules/openssl-1.0.2j --add-module=modules/modsecurity-2.9.1/nginx/modsecurity --add-module=modules/headers-more-nginx-module-0.32 --add-module=modules/ngx_cache_purge-2.3 --add-module=modules/nginx-module-vts-0.1.10 --add-module=modules/ngx_pagespeed-1.11.33.4-stable

Selama saya test drive tidak ada masalah berarti dan sama persis seperti Nginx biasanya.

Malah fiturnya lebih lengkap dibanding instalasi standar:

  • Nginx is compiled using latest GCC from RedHat devtoolset-4
  • Nginx is compiled using latest available OpenSSL sources
  • Optimized configurations included (WordPress anti-bruteforce, Laravel)
  • PageSpeed module included and configured
  • ModSecurity module included but unconfigured
  • Nginx virtual host traffic status module included and configured
  • Headers-More-Nginx included
  • Nginx-Cache-Purge included
  • GeoIP included only for CentOS 7

Bagaimana? Tertarik? 😀

22 Comments

  1. saya juga sudah coba sebelumnya untuk nginx-more ini mas, memang sangat dipermudah dan sama seperti saya yang lebih utamakan repo biar gampang maintenancenya 😀 tapi setelah saya cek nginx-more agak kurang update reponya masih tahun 2016.

    untuk nambah referensi saja karna kebetulan nemu yang sejenis dan reponya selalu update di https://codeit.guru/en_US/
    sudah saya tes dan berikut hasilnya di centos 6:

    nginx version: nginx/1.11.10
    built by gcc 4.4.7 20120313 (Red Hat 4.4.7-17) (GCC)
    built with OpenSSL 1.0.2k  26 Jan 2017
    TLS SNI support enabled
    configure arguments: --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-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-http_auth_request_module --with-http_xslt_module=dynamic --with-http_image_filter_module=dynamic --with-http_geoip_module=dynamic --with-http_perl_module=dynamic --add-dynamic-module=njs-1c50334fbea6/nginx --with-threads --with-stream --with-stream_ssl_module --with-http_slice_module --with-mail --with-mail_ssl_module --with-file-aio --with-ipv6 --add-module=/tmp/nginx/ngx_brotli --with-openssl=/tmp/nginx/openssl --with-http_v2_module --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic'
    1. Saya yang ketinggalan kereta ya. 😀

      Kalau ga salah ini karena beda rilis Nginx yang dipakai mbak, yang nginx-more itu pakai stable dan CodeIT itu pakai mainline yang rutin diupdate. Wajar kalau beda.

      Ga ada masalah mbak pas pakainya? Akhirnya ganti?

      1. saya baru lihat ternyata CodeIT ada versi stable juga, berikut penampakan nginx -V

        nginx version: nginx/1.10.3
        built by gcc 4.4.7 20120313 (Red Hat 4.4.7-17) (GCC)
        built with OpenSSL 1.1.0e  16 Feb 2017
        TLS SNI support enabled
        configure arguments: --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-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-http_auth_request_module --with-http_xslt_module=dynamic --with-http_image_filter_module=dynamic --with-http_geoip_module=dynamic --with-http_perl_module=dynamic --add-dynamic-module=njs-1c50334fbea6/nginx --with-threads --with-stream --with-stream_ssl_module --with-http_slice_module --with-mail --with-mail_ssl_module --with-file-aio --with-ipv6 --add-module=/tmp/nginx/ngx_brotli --with-openssl=/tmp/nginx/openssl --with-http_v2_module --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic'
      2. saya pakai cara ini mas :

        yum install epel-release -y
        vi /etc/yum.repos.d/codeit.repo
        [CodeIT]
        name=CodeIT repo
        baseurl=https://repo.codeit.guru/packages/centos/6/$basearch
        enabled=1
        gpgkey=https://repo.codeit.guru/RPM-GPG-KEY-codeit
        gpgcheck=1
        yum install nginx -y
  2. ya akhirnya pilihan jatuh ke nginx-more karna punya PageSpeed module, sudah lama ingin coba artikel mas chandra tentang pagespeed tapi belum juga dicoba karna harus compile dari source 😀

    1. Hasil dari https://www.ssllabs.com/ssltest dapat predikat B
      notifnya di bagian ini :

      # TLS 1.2 (suites in server-preferred order)
      TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (0xc02f)   ECDH secp256r1 (eq. 3072 bits RSA)   FS 	128
      TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (0xc030)   ECDH secp256r1 (eq. 3072 bits RSA)   FS 	256
      TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 (0x9e)   DH 1024 bits   FS   WEAK 	128
      TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 (0x9f)   DH 1024 bits   FS   WEAK 	256
      TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 (0xc027)   ECDH secp256r1 (eq. 3072 bits RSA)   FS 	128
      TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 (0xc028)   ECDH secp256r1 (eq. 3072 bits RSA)   FS 	256
      TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA (0xc013)   ECDH secp256r1 (eq. 3072 bits RSA)   FS 	128
      TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA (0xc014)   ECDH secp256r1 (eq. 3072 bits RSA)   FS 	256
      TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 (0x67)   DH 1024 bits   FS   WEAK 	128
      TLS_DHE_RSA_WITH_AES_128_CBC_SHA (0x33)   DH 1024 bits   FS   WEAK 	128
      TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 (0x6b)   DH 1024 bits   FS   WEAK 	256
      TLS_DHE_RSA_WITH_AES_256_CBC_SHA (0x39)   DH 1024 bits   FS   WEAK 	256
      TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA (0xc012)   ECDH secp256r1 (eq. 3072 bits RSA)   FS 	112
      TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA (0x16)   DH 1024 bits   FS   WEAK 	112

      padahal sebelum pakai repo dari nginx-more dapat grade A, apa pengaruh memang pengaruh dari nginx-more ya.

      1. mas chandra, ciphers ini kan ada tiga pilihan modern, intemediate dan old, kalau pilih yg modern apa berarti browser2 versi jadul nggak bisa buka site kita ya?

      2. Kalau ini keputusan ada di tangan mbak sendiri. Kalau ada analytics (XenForo ada statistik user agent tidak?) bisa dilihat pengunjung forumnya pakai apa saja aksesnya.

        Tapi sekarang sudah sangat jarang pakai browser jadul dari beberapa situs yang saya kelola. Tapi saya tekankan ini karena segmen pengunjungnya bisa beda, seperti servernesia ini mayoritas melek teknologi. Ga ketemu Internet Explorer sebeluam 11.0, dan Firefox juga Chrome sudah auto update. Tinggal Android saja semoga ga pakai sebelum Lollipop. 😀

  3. sayangnya baik codeit atau nginx-more sama2 hanya mendukung 64bit 🙁
    dan untuk pertama kalinya saya coba compile nginx dan openssl dari source 😀 sejauh ini berhasil tapi belum di tes lebih jauh lagi hehe

    1. Sebentar lagi cuma ada versi 64-bit mbak. Beberapa distro (bukan server sih) mulai rilis edisi 64-bit saja.

    1. Maksud saya mau upgrade OpenSSL nya aja dari OpenSSL 1.0.1e-fips ke 1.0.2n atau migrasi ke 1.1.0g

      Webserver yang di pake itu Nginx dari KloxoMR, OS nya CentOS 6.9 (Final) 64-bit, Panelnya pake Kloxo-MR, nah saya cuman mau update OpenSSL nya saja, itu gimana mas?

      1. Kalau OpenSSL yang dipakai Nginx itu ga berhubungan langsung dengan yang terinstall di server mas. Harus compile ulang Nginx dengan dependensi OpenSSL versi yang diinginkan.

Tinggalkan Balasan ke shafira Batalkan balasan

Alamat email Anda tidak akan dipublikasikan. Ruas yang wajib ditandai *