Browsing articles in "Apache"
Jun 22, 2014
kalpesh

Magento: Sample apache virtualhost for your website

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

1
2
3
4
5
6
7
8
<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
</VirtualHost>

Add entry to /etc/hosts too:

1
127.0.0.1    loca.lho.st

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

1
http://loca.lho.st

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

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!

Certifications