Saturday, September 22, 2012

Ubuntu How-To Make Apache Virtual Host Survival Guide

The Guide Show Step-by-Step How-to Create a Virtual Host in Ubuntu Apache Web-Server Step-by-Step.


The Content and Details are Expressly Reduced to Give Focus Only to the Essentials Instructions and Commands and Make Tut more Easy & Digestive ;)

Linux-Gnome Penguin on Ubuntu
  1. Login as SuperUser
    sudo su
  2. Installing Apache Server
    apt-get update
    apt-get install apache2
  3. Edit /etc/hosts
    nano /etc/hosts

    Insert:

    127.0.0.1  domainname.ext

    Ctrl+x to Save and Exit

  4. Make a Virtual Host File in /etc/apache2/sites-available
    cd /etc/apache2/sites-available
    nano domainname.ext

    Insert something like:

    <VirtualHost *:80>
    ServerName  domainname.ext
    ServerAlias www.domainname.ext
    ServerAdmin email@domainname.ext
    DocumentRoot /var/www/domainname.ext
    </VirtualHost>
    

    Ctrl+x to Save and Exit

  5. Make a Symlink of File in /etc/apache2/sites-enabled
    cd /etc/apache2/sites-enabled
    ln -s ../sites-available/domainname.ext .
  6. Restart Apache
    service apache2 restart