Apache - Virtual Host Setup in 2 Minutes

Apache - Virtual Host Setup in 2 Minutes

Prerequisites

Add domain name to aws account

You can also do IP mapping with godaddy or any other provider if you are registered with them.

AWS domain

Server set up

Example Folder

Add a conf file in apache2 folder on this location /etc/apache2/sites-available/ name it example.metamug.net.conf

<VirtualHost *:80>

    ServerName example.metamug.net 
    DocumentRoot /var/www/example.metamug.net 

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    <Directory /var/www/example.metamug.net >
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
    </Directory>

</VirtualHost>

Add above code in your conf file i.e example.metamug.net.conf and save it.

Enable your conf file i.e example.metamug.net.conf and then restart your apache2 server

sudo a2ensite example.metamug.net.conf
sudo service apache2 restart

Log on to your website http://example.metamug.net