Saturday, 5 October 2013

Virtual Host Menggunakan Apache di Ubuntu

Posted By: Rufaidah-network - 01:18

Share

& Comment

Virtual Host Menggunakan Apache di Ubuntu


berikut ini adalah langkah langkahnya

1 install apache
  #sudo apt-get install apache2

  Secara default, document root apache terletak di /var/www, dan konfigurasi file terletak di  /etc/apache2/apache2.conf. Konfigurasi tambahan terletak di /etc/apache2, seperti /etc/apache2/mods- enabled (untuk module apache),   /etc/apache2/sites-enabled (untuk virtual hosts), dan /etc/apache2/conf.d.

2. Kita nonaktifkan dulu default virtual host apachenya
   #sudo a2dissite default

   Kemudian restar apacenya
   sudo /etc/init.d/apache restart

Setiap konfigurasi virtual host tersimpan dalam sebuah file yang diberi nama domain dan terletak pada direktori   /etc/apache2/sites-available/. Dalam contoh ini, saya akan membuat file dengan basis nama domain ophan.com dan gatot.com

3. pertama, saya buat dulu file ophan.com di /etc/apache2/sites-available
   #sudo nano /etc/apache2/sites-available/ophan.com
   dan masukkan konfigurasi berikut:
   <VirtualHost *:80>
   ServerAdmin admin@ophan.com
   ServerName ophan.com
   ServerAlias www.ophan.com
   DocumentRoot /home/www/ophan.com/html/
   ErrorLog /home/www/ophan.com/logs/error.log
   CustomLog /home/www/ophan.com/logs/access.log combined
   </VirtualHost>

4.Selanjutnya membuat file konfigurasi gatot.com
  sudo nano /etc/apache2/sites-available/gatot.com
   <VirtualHost *:80>
   ServerAdmin admin@gatot.com
   ServerName gatot.com
   ServerAlias www.gatot.com
   DocumentRoot /home/www/gatot.com/html/
   ErrorLog /home/www/gatot.com/logs/error.log
   CustomLog /home/www/gatot.com/logs/access.log combined
   </VirtualHost>

5.kemudian membuat direktori yang saya butuhkan:
  $sudo mkdir -p /home/www/ophan.com/html
  $sudo mkdir /home/www/ophan.com/logs
  $sudo mkdir -p /home/www/gatot.com/html
  $sudo mkdir /home/www/gatot.com/logs

Sekarang, restart apache untuk mengetahui hasil perubahan
Lakukan reload konfigurasi setelah anda melakukan editing file virtual host



About Rufaidah-network

Techism is an online Publication that complies Bizarre, Odd, Strange, Out of box facts about the stuff going around in the world which you may find hard to believe and understand. The Main Purpose of this site is to bring reality with a taste of entertainment

0 komentar:

Post a Comment

Copyright © Pembelajaran IT ™ is a registered trademark.

Designed by Templateism. Hosted on Blogger Platform.