Wednesday, April 14, 2010

How to host multiple web-sites on XAMP

Edit C:\xampp\apache\conf\httpd.conf
- yes... there are more lines in that file, but these are the ones you need to edit... :)
ServerName *:80

#DocumentRoot "C:/xampp/htdocs"

#<Directory />
# Options FollowSymLinks
# AllowOverride None
# Order deny,allow
# Deny from all
#</Directory>

#<Directory "C:/xampp/htdocs">
# Options Indexes FollowSymLinks Includes ExecCGI
# AllowOverride All
# Order allow,deny
# Allow from all
#</Directory> 

Edit C:\xampp\apache\conf\extra\httpd-vhosts.conf
- ok - just kinda follow the logic for each website... and place your web files in the right directory... or else...!
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot "C:/xampp/htdocs/FolderForWhateverSite"
ServerName www.whatever.com
##ServerAlias www.whatever.com
ErrorLog "logs/error.log"
CustomLog "logs/error.log" combined
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
<Directory "C:/xampp/htdocs/FolderForWhateverSite">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

Then go to command prompt:
net stop apache2.2 & net start apache2.2

No comments:

Post a Comment