Page 1 of 1

Virtual host configuration problem

PostPosted: 08. December 2009 15:55
by thirstywork
Hi,

No idea what I am doing wrong here...

I want http://help.canlaorn.com/ to point to C:\xampp\htdocs\help but unless I use http://help.canlaorn.com/help I get redirected to http://help.canlaorn.com/xampp/

This is what I have in the httpd-vhosts.conf.

Code: Select all
NameVirtualHost 79.123.106.89:80

<VirtualHost help.canlaorn.com>
DocumentRoot "C:/xampp/htdocs/help/"
DirectoryIndex index.html
ServerName help.canlaorn.com
ErrorLog "logs/help.canlaorn.com-error.log"
CustomLog "logs/help.canlaorn.com.log" combined
</VirtualHost>

Re: Virtual host configuration problem

PostPosted: 08. December 2009 16:00
by Wiedmann
Code: Select all
NameVirtualHost 79.123.106.89:80

<VirtualHost help.canlaorn.com>

replace this 3 lines from your code with:
Code: Select all
NameVirtualHost *:80

<VirtualHost *.80>
ServerName localhost
</VirtualHost>

<VirtualHost *.80>

Re: Virtual host configuration problem

PostPosted: 08. December 2009 16:10
by thirstywork
Thanks for the reply, I replaced the lines as you said so it now looks like this:

Code: Select all
NameVirtualHost *:80

<VirtualHost *.80>
ServerName localhost
</VirtualHost>

<VirtualHost *.80>
DocumentRoot "C:/xampp/htdocs/help/"
DirectoryIndex index.html
ServerName help.canlaorn.com
ErrorLog "logs/help.canlaorn.com-error.log"
CustomLog "logs/help.canlaorn.com.log" combined
</VirtualHost>


But I still have the same problem and now I have some errors and a warning when I start up apache

Code: Select all
[Tue Dec 08 15:11:22 2009] [error] (EAI 11001)APR does not understand this error code: Could not resolve host name *.80 -- ignoring!
[Tue Dec 08 15:11:22 2009] [error] (EAI 11001)APR does not understand this error code: Could not resolve host name *.80 -- ignoring!
[Tue Dec 08 15:11:22 2009] [warn] NameVirtualHost *:80 has no VirtualHosts

Re: Virtual host configuration problem

PostPosted: 08. December 2009 16:12
by Wiedmann
Could not resolve host name *.80 -- ignoring

Ah sorry. I guess my "shift" key is broken :-) :
It must be "*:80" and not "*.80" (two times).

Re: Virtual host configuration problem

PostPosted: 08. December 2009 16:19
by thirstywork
Brillaint thanks alot :D

Should have picked up on the "." I guess but have spent so long trying different variations I would given anything a shot.