Jun 22, 2014

Magento: Sample apache virtualhost for your website

Sample apache virtualhost to point to your magento directory and run your local website with specified URL.

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot "/var/www/magento/"
    ServerName loca.lho.st
    ServerAlias loca.lho.st
    ErrorLog "logs/error_log"
    CustomLog "logs/access_log" common

Add entry to /etc/hosts too:    loca.lho.st

Restart apache (service httpd restart OR service apache2 restart) and point your browser location to:


and you will see the website running from your /var/www/magento directory.

Leave a comment


Welcome to my Blog

Kalpesh MehtaHelping Magento developers in their day-to-day development problems since 2011. Most of the problems and solutions here are my own experiences while working on different projects. Enjoy the blog and don't forget to throw comments and likes/+1's/tweets on posts you like. Thanks for visiting!




Magento top 50 contributors

Magento top 50 contributors