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 ;)
- Login as SuperUser
sudo su
- Installing Apache Server
apt-get update
apt-get install apache2
- Edit /etc/hosts
nano /etc/hosts
Insert:
127.0.0.1 domainname.ext
Ctrl+x to Save and Exit
- 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
- Make a Symlink of File in /etc/apache2/sites-enabled
cd /etc/apache2/sites-enabled
ln -s ../sites-available/domainname.ext .
- Restart Apache
service apache2 restart