Virtual Hosts: Keeps going to XAMPP home page

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

Virtual Hosts: Keeps going to XAMPP home page

Postby sccr410 » 19. December 2009 08:59

I cannot figure out why my virtual hosts keep going to the XAMPP default home page and not the DocumentRoot I setup in the vhosts file. I have cleared cache repeatedly. Tried different browsers. No luck. The virtual host "works", when I type in my domain.dev it doesn't give errors - it just goes to the dang XAMPP home page.

My httpd-vhosts.conf

<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /Applications/XAMPP/xamppfiles/htdocs
ServerName localhost
</VirtualHost>

<Directory "/sites/projectname">
Options Indexes FollowSymLinks ExecCGI Includes
AllowOverride All
Order allow,deny
Allow from all
</Directory>

<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /sites/projectname
ServerName projectname
</VirtualHost>
sccr410
 
Posts: 1
Joined: 19. December 2009 08:54

Re: Virtual Hosts: Keeps going to XAMPP home page

Postby Izzy » 20. December 2009 01:57

If there is anything wrong with your vhosts configuration then Apache will resolve to the first good vhost, the default localhost in your case.

Try this and see if it helps, it is important to use the first line I have included in my example.
Code: Select all
NameVirtualHost *:80

<VirtualHost *:80>
ServerName localhost
DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs"
ServerAdmin webmaster@localhost
</VirtualHost>

<VirtualHost *:80>
ServerName projectname
DocumentRoot "/sites/projectname"
ServerAdmin webmaster@localhost
<Directory "/sites/projectname">
Options Indexes FollowSymLinks ExecCGI Includes
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
I am assuming your directory paths are spelled correctly and that they do exist.
Don't forget to add to this to your etc/hosts file"
Code: Select all
127.0.0.1 projectname
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: Virtual Hosts: Keeps going to XAMPP home page

Postby sili » 31. December 2009 00:26

If izzy's post shouldn't help, you might want to have a look at this guide to virtualhosts (especially step 5).
sili
 
Posts: 67
Joined: 15. March 2003 16:05


Return to XAMPP for Mac OS X

Who is online

Users browsing this forum: No registered users and 3 guests