Saturday, October 5, 2019

Utilisasi Apache Server untuk Aplikasi Berbasis Web

Apache Server sudah menjadi bagian yang tidak bisa dipisahkan dari daur hidup aplikasi berbasis web. Bagi Web Developer, Apache Server adalah opsi yang selalu ada di antara daftar web server yang dapat dijadikan target deployment.

Salah satu cara cepat untuk deployment aplikasi berbasis web adalah dengan menjadikan Apache sebagai proxy ke aplikasi yang ingin di-deploy. Berikut beberapa snippet untuk dapat melakukannya.

Contoh NodeJs
  1. Install modul Apache mod_proxy, mod_proxy_http 
  2. buat Virtual host yang akan menjadi proxy ke port yang digunakan oleh nodejs
  3. Code Snippet-nya sbb:
    <virtualhost>
      ServerName sub.domain.com
      ServerAdmin webmaster@domain.com

      ProxyRequests off

      <proxy *>
        Order deny,allow
        Allow from all
      </proxy>

      <location />
        ProxyPass http://localhost:8100/
        ProxyPassReverse http://localhost:8100/
      </location>
    </virtualhost>

Contoh Python
  1. Jangan lupa untuk menginstall modul Apache mod_proxy, mod_proxy_http.
  2. Contoh di bawah ini adalah menggunakan proxy port 8000 di Apache server sementara port yang digunakan oleh aplikasi adalah 8080
    Listen 8000
    <VirtualHost *:8000>
        ServerAdmin user@domain.com

        ServerName app.domain.com
        ServerAlias app
        SSLEngine on


        # Jika menggunakan SSL certificate
        SSLCertificateFile /path/to/file.crt
        SSLCertificateKeyFile /path/to/file.id.key
        SSLCertificateChainFile /path/to/intermediate.crt
     
        ProxyPreserveHost On
        ProxyPass / http://127.0.0.1:8080/
        ProxyPassReverse / http://127.0.0.1:8080/

        LogLevel debug
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
    </VirtualHost>

Thursday, May 12, 2016

Ketika Samba Rewel Password

Ubuntu 16.04 sudah di-release oleh canonical dengan codename XenialXerus sejak Oktober 2015. Tapi postingan kali ini tidak membahas mendalam tentang relase ini. Justru saya menemukan kendala untuk konektivitas ubuntu versi ini pada samba.

Ketika saya hendak menghubungkan ubuntu versi ini dengan printer yang ada di host windows, samba selalu meminta password. Nah untuk memperbaikinya kita dapat menambahkan script berikut pada file /etc/samba/smb.conf:


client use spnego = no 

Selamat mencoba. :)

Monday, April 4, 2016

Openshift, Deployment Using Git, Pelican

Just explored a couple of things today:
Openshift
  • Installing rhc, a ruby gem to communicate with openshift server
  • Add application (wordpress) in Openshift
Deployment Using Git on Your Own Server
  • Deployment any application couldn't be easier with git-push
  • For a enterprise application there should be a way to do repetitive task related with deployment process. Well, this is known with Continuous Integration: you code, you test, you deploy. Git-push help you deal with deployment automation.
Pelican
A static site generator powered by python. You might familir with jekyll in term of ruby. It's just those things.