Beranda > Linux, System Administrator > Konfigurasi Webserver untuk Virtual Hosting (Ubuntu 12.04 LTS)

Konfigurasi Webserver untuk Virtual Hosting (Ubuntu 12.04 LTS)

Install webserver agar mudah di maintenace dan tidak berantakan jika sudah banyak website yang running di server tersebut.

verrysoon@kowalski#aptitude -y install apache2
verrysoon@kowalski#nano /etc/apache2/conf.d/security
# line 27: EDIT
ServerTokens Prod
# line 39: EDIT
ServerSignature Off

verrysoon@kowalski#nano /etc/apache2/mods-enabled/dir.conf
# line 3: TAMBAHKAN
DirectoryIndex index.html index.cgi

verrysoon@kowalski#nano /etc/apache2/mods-enabled/mime.conf

# line 218: Disable comment dan tambahkan
AddHandler cgi-script .cgi .pl

verrysoon@kowalski#nano /etc/apache2/sites-available/default
# line 2: EDIT
# line 10: Delete “Indexes”
Options FollowSymLinks ExecCGI
# line 11: EDIT
AllowOverride All

verrysoon@kowalski#ln -s /usr/bin/perl /usr/local/bin/perl

verrysoon@kowalski#service apache2 restart

Installasi dasar selesai, coba testing dengan request http://ip-address-server , jika berhasil “It Works”
selanjutnya install PHP

verrysoon@kowalski#aptitude -y install php5 php5-cgi libapache2-mod-php5 php5-common php-pear
verrysoon@kowalski#nano /etc/apache2/mods-enabled/mime.conf

#line 219: tambahkan ext PHP
AddHandler php5-script .php

verrysoon@kowalski#service apache2 restart
verrysoon@kowalski#nano /var/www/index.php
Tuliskan PHP Code sample


Installasi php selesai, coba lakukan request kembali ke http://ip-address-server/index.php , jika berhasil keluar info PHP yang dibuat tadi.
Selanjutnya membuat VirtualHost File :

verrysoon@kowalski#nano /etc/apache2/sites-available/
#Isi dari

DocumentRoot /home/netadmin/
ErrorLog /var/log/apache2/
CustomLog /var/log/apache2/ combined
LogLevel warn

verrysoon@kowalski#service apache2 reload

Satu website berhasil dibuat, untuk disable host file gunakan perintah “a2dissite file_host”

jadi untuk memudahkan maintenance, pisahkan setiap host file setiap website yang di pasang diserver, dan pisahkan pula error log dan access log nya.


Best Regards,

  1. Oktober 1, 2013 pukul 9:33 am

    When I originally left a comment I seem to have clicked the
    -Notify me when new comments are added- checkbox and from now on every time a comment is added I get 4 emails with the exact same comment.
    There has to be a means you can remove me from that service?

    Thank you!

  2. September 15, 2014 pukul 2:38 am

    Hey There. I found your blog using msn. This is a really smartly written article.
    I will be sure to bookmark it and return to read more of your helpful information. Thank you for the post.
    I will definitely return.

  3. Oktober 8, 2014 pukul 9:19 am

    Greetings! This is my first comment here so I just wanted to give a quick shout out and tell you I truly enjoy reading through your blog posts.
    Can you suggest any other blogs/websites/forums that cover the same topics?
    Many thanks!

  1. No trackbacks yet.

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:


You are commenting using your account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s