Ubuntu How-To Make Apache Virtual Host Survival Guide

September 22nd, 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 and Details are Expressly Reduced to Give Focus Only to the Essentials Instructions and Commands and Make the Tut Easier to Understand ;)

Linux-Gnome Penguin on Ubuntu
  1. Login as SuperUser
    sudo su

    If Got “User is Not in Sudoers file” then Look: Solution

  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:



    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
(Visited 1 times, 1 visits today)
Share on Tumblr

Tags: , , , , , ,