Ubuntu How-To Make Apache Virtual Host Survival Guide

September 22, 2012 | By Regaz.

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

The content of the Guides give Focus only to the Essentials Instructions and Commands for an easier understanding ;)

Linux-Gnome Penguin on Ubuntu
  1. Login as SuperUser

    sudo su

    If Got “User is Not in Sudoers file” then see: How to Enable sudo

  2. Installing Apache Server

    apt-get update
    apt-get install apache2
  3. Edit /etc/hosts

    nano /etc/hosts

    Append: 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:

    ServerName domainname.ext
    ServerAlias www.domainname.ext
    ServerAdmin email@domainname.ext
    DocumentRoot /var/www/domainname.ext

    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

QuickChic Theme • Powered by WordPress