Multiple domains (virtual hosts) in apache

Published on June 3rd, 2006 by DannyT. Filed under Apache Web Server, Linux

This information is everywhere and is by no means anything special. But as a recent convert to apache from IIS I need somewhere to put this as reference:

To setup multiple hosts in apache, add the following into http.conf

  <VirtualHost 10.1.2.3>
  DocumentRoot /www/vhost1
  ServerName  www.my-dom.com
  </VirtualHost>

Full details over on apache.org
Genius huh?

I’ve also been creating symlinks to my user’s public_html folder, a symlink is kindof a shortcut or virtual directory equivilent in windows/iis. The following command line code is used for creating symlinks:

ln -s /home/your_user_name/public_html/folder /srv/www/htdocs/folder" 

This creates a shortcut from the Apache htdocs to the users personal html docs.

Leave a Reply

About DannyT

The blog: danny-t.co.uk - General geek talk focusing on Rich Internet Applications, Microsoft and Adobe technologies and the web in general. The business: Moov2.com - RIA development agency Dan Thomas has been an Internet geek since circa 1994. He has been running Moov2 since 2003 and prior to that worked as a Flash developer for one of europes largest E-learning providers.

Copyright © 2010 Danny-T.co.uk

CSS Template By RamblingSoul | WordPress Theme by Theme Lab and Best Hosting.