Magento: Sample apache virtualhost for your website

· kalpesh

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

 <virtualhost>  
 ServerAdmin [email protected]  
 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:

 127.0.0.1 loca.lho.st

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

 http://loca.lho.st

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

#apache #linux #magento #virtualhost