You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by M von Ziegenweidt <ma...@vzhost.co.uk> on 2006/06/22 15:04:38 UTC

[users@httpd] Problem with setting up virtual hosting. Ver. 2.0.54

Hi,

 

Can anybody help. I have tried the documentation. As far as I can tell, I've
set the virtual hosting correctly, but it isn't working, so obviously I
haven't. 

 

The "main" webserver is working as intended, but the extra domains set out
in the <virtualhost> blocks are not.

 

Where should I start looking for a solution. No problems seem to be reported
in the log files. If I type the "virtual" domain name I get through to the
main server base page and am not redirected to the subdirectory.

 

I have tried a number of combinations including the simple:

 

Below

Listen *:80

 

I have 

NameVirtualHost *:80

 

And in the second section I have:

 

ServerName www.vzhost.co.uk

 

In section 3 (Virtualhosting) I have the second block set to:

 

<VirtualHost *:80>

DocumentRoot /var/www/html/noticeboard

ServerName www.norfolknoticeboard.co.uk

</VirtualHost>

 

Thanks for any help,

 

Maarten


RE: [users@httpd] Problem with setting up virtual hosting. Ver. 2.0.54

Posted by M von Ziegenweidt <ma...@vzhost.co.uk>.
Although a bit late, thank you for your assistance. I was able to get it
working.

Maarten

-----Original Message-----
From: jslive@gmail.com [mailto:jslive@gmail.com] On Behalf Of Joshua Slive
Sent: 23 June 2006 14:42
To: users@httpd.apache.org; maarten@vzhost.co.uk
Subject: Re: [users@httpd] Problem with setting up virtual hosting. Ver.
2.0.54

On 6/23/06, M von Ziegenweidt <ma...@vzhost.co.uk> wrote:
> If I access www.vzhost.co.uk which is the main server it goes through 
> to the base directory as required. If I access 
> www.norfolknoticeboard.co.uk it goes through to the base directory 
> (www.vzhost.co.uk) as well when I actually want it to go to 
> ...html/noticeboard which can also be accessed by
www.vzhost.co.uk/noticeboard.
>
> It is almost as if the request for the norforknoticeboard.co.uk isn't 
> getting the referral address through? There is no mention of it in the 
> log files. Is that normal?

If you want to verify what the client is sending, you need to log the Host
HTTP request header, which you can do by adding %{Host}o to your LogFormat.

But the most likely problem in this case seems to be that you are editting
the wrong config file or haven't properly restarted your server of something
of the like.  Because once a NameVirtualHost *:80 exists, the DocumentRoot
specified in the main server configuration should *never* be used.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org




--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.9.2/373 - Release Date: 22/06/2006


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Problem with setting up virtual hosting. Ver. 2.0.54

Posted by Joshua Slive <jo...@slive.ca>.
On 6/23/06, M von Ziegenweidt <ma...@vzhost.co.uk> wrote:
> If I access www.vzhost.co.uk which is the main server it goes through to the
> base directory as required. If I access www.norfolknoticeboard.co.uk it goes
> through to the base directory (www.vzhost.co.uk) as well when I actually
> want it to go to ...html/noticeboard which can also be accessed by
> www.vzhost.co.uk/noticeboard.
>
> It is almost as if the request for the norforknoticeboard.co.uk isn't
> getting the referral address through? There is no mention of it in the log
> files. Is that normal?

If you want to verify what the client is sending, you need to log the
Host HTTP request header, which you can do by adding %{Host}o to your
LogFormat.

But the most likely problem in this case seems to be that you are
editting the wrong config file or haven't properly restarted your
server of something of the like.  Because once a NameVirtualHost *:80
exists, the DocumentRoot specified in the main server configuration
should *never* be used.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Problem with setting up virtual hosting. Ver. 2.0.54

Posted by M von Ziegenweidt <ma...@vzhost.co.uk>.
If I access www.vzhost.co.uk which is the main server it goes through to the
base directory as required. If I access www.norfolknoticeboard.co.uk it goes
through to the base directory (www.vzhost.co.uk) as well when I actually
want it to go to ...html/noticeboard which can also be accessed by
www.vzhost.co.uk/noticeboard.

It is almost as if the request for the norforknoticeboard.co.uk isn't
getting the referral address through? There is no mention of it in the log
files. Is that normal?

Thanks for your help.

Maarten

-----Original Message-----
From: jslive@gmail.com [mailto:jslive@gmail.com] On Behalf Of Joshua Slive
Sent: 22 June 2006 14:38
To: users@httpd.apache.org; maarten@vzhost.co.uk
Subject: Re: [users@httpd] Problem with setting up virtual hosting. Ver.
2.0.54

On 6/22/06, M von Ziegenweidt <ma...@vzhost.co.uk> wrote:

> Can anybody help. I have tried the documentation. As far as I can 
> tell, I've set the virtual hosting correctly, but it isn't working, so 
> obviously I haven't.
>
> The "main" webserver is working as intended, but the extra domains set 
> out in the <virtualhost> blocks are not.

What happens when you try to access them?

As the docs say, once you include a "NameVirtualHost *:80", the "main"
host shouldn't serve any requests anymore.  All requests should be served by
<VirtualHost>s.

Joshua.



--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.9.2/372 - Release Date: 21/06/2006


-----Original Message-----
From: jslive@gmail.com [mailto:jslive@gmail.com] On Behalf Of Joshua Slive
Sent: 22 June 2006 14:38
To: users@httpd.apache.org; maarten@vzhost.co.uk
Subject: Re: [users@httpd] Problem with setting up virtual hosting. Ver.
2.0.54

On 6/22/06, M von Ziegenweidt <ma...@vzhost.co.uk> wrote:

> Can anybody help. I have tried the documentation. As far as I can 
> tell, I've set the virtual hosting correctly, but it isn't working, so 
> obviously I haven't.
>
> The "main" webserver is working as intended, but the extra domains set 
> out in the <virtualhost> blocks are not.

What happens when you try to access them?

As the docs say, once you include a "NameVirtualHost *:80", the "main"
host shouldn't serve any requests anymore.  All requests should be served by
<VirtualHost>s.

Joshua.



--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.9.2/372 - Release Date: 21/06/2006



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Problem with setting up virtual hosting. Ver. 2.0.54

Posted by Joshua Slive <jo...@slive.ca>.
On 6/22/06, M von Ziegenweidt <ma...@vzhost.co.uk> wrote:

> Can anybody help. I have tried the documentation. As far as I can tell, I've
> set the virtual hosting correctly, but it isn't working, so obviously I
> haven't.
>
> The "main" webserver is working as intended, but the extra domains set out
> in the <virtualhost> blocks are not.

What happens when you try to access them?

As the docs say, once you include a "NameVirtualHost *:80", the "main"
host shouldn't serve any requests anymore.  All requests should be
served by <VirtualHost>s.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org