Syntax problem with Virtual Hosts

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

Syntax problem with Virtual Hosts

Postby jonnyschneider » 03. July 2009 09:17

I am having some trouble getting apache to start up when I try and use a virtual host via xampp on mac os x 10.5.

In httpd-conf, I have enabled virtual hosts like this:
Include /Applications/xampp/etc/extra/httpd-vhosts.conf

Then, in httpd-vhosts.conf, I am starting with just the default virtual host (I will add more when I get it to work properly)
It looks like this:

NameVirtualHost *:80

<VirtualHost *:80>
   DocumentRoot "/Applications/xampp/htdocs"
   ServerName localhost
</VirtualHost>

However, when I try to restart apache it gives a non-descriptive error.
If disable virtual hosts, apache starts fine.
I have checked that the DocumentRoot path is valid.

Have I got something wrong?
jonnyschneider
 
Posts: 3
Joined: 03. July 2009 09:09

Re: Syntax problem with Virtual Hosts

Postby glitzi85 » 03. July 2009 18:22

I am not familiar with Mac, but you can try the DocumentRoot without the quotation marks. I am not sure about this as i never use quotation marks.

What is a non-descriptive Error?

glitzi
User avatar
glitzi85
 
Posts: 1920
Joined: 05. March 2004 23:26
Location: Dahoim

Re: Syntax problem with Virtual Hosts

Postby jonnyschneider » 04. July 2009 00:49

yep, I tried it without quotes, and that didn't work either.

By 'non-descript error', I just mean that xampp failed and gives an error which doesn't define the problem, it just says to come to the forum...

I assume it's a syntax thing in the the virtual hosts file though, because if I comment out the virtual host configs with '#' character, then xampp starts okay.
jonnyschneider
 
Posts: 3
Joined: 03. July 2009 09:09

Re: Syntax problem with Virtual Hosts

Postby jonnyschneider » 04. July 2009 09:30

I figured out the problem...

The VirtualHost config was cut/pasted from a webpage.
I think the special encoding (&amp;) was hidden in the text editor I was using (BBEdit).
When I deleted the spaces before the ServerName and DocumentRoot lines, everything started up and works as expected.

I hope this is helpful for someone else. :)
jonnyschneider
 
Posts: 3
Joined: 03. July 2009 09:09

Re: Syntax problem with Virtual Hosts

Postby glitzi85 » 04. July 2009 15:47

OK, that is something I've never heard before. Good to know!

Have fun with XAMPP.

glitzi
User avatar
glitzi85
 
Posts: 1920
Joined: 05. March 2004 23:26
Location: Dahoim


Return to XAMPP for Mac OS X

Who is online

Users browsing this forum: No registered users and 5 guests