Adding Vhost on Apache2
Open your favorite text editor then add the code below, Save it under /etc/apache2/sites-available/localdomain.conf
note you can use any filename you want but for this example we will use localdomain.conf
<VirtualHost *>
ServerName localdomain.dev
DocumentRoot /home/user/public_html
</VirtualHost>
Now we need to add it to our hosts lists, again open your text editor then edit /etc/hosts file, add the code below to the list
127.0.0.1 localdomain.dev
To enable your new domain execute this command
sudo a2ensite localdomain.conf
Then reload apache
sudo /etc/init.d/apache restart
To test if its working, open a browser then point it to this addresss
http://localdomain.dev/
leave a comment