Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problems migrating Apache 1 to 2 (virtual hosts)

0 views
Skip to first unread message

Robert Schroeder

unread,
May 17, 2009, 9:39:44 AM5/17/09
to
Hello there,

I finally need to move from my long-time working Apache 1.3 setup to
Apache 2. I'm testing with Paul Smedley's port of Apache 2.2.8.
Everything seems to work, except I cannot get my multi-ip/multi-domain
setup to work. Every request falls back to the default virtual host, no
matter what I do (like playing with UseCanonicalName). My httpd.conf
looks like this and works perfectly for 1.3:

NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot D:/WWW/HTML/DEFAULT
ServerName default.my.domain:port
...
</VirtualHost>

NameVirtualHost 1.1.1.1:80
<VirtualHost 1.1.1.1:80>
DocumentRoot D:/WWW/HTML/ip1host1
ServerName www.ip1host1.domain:80
...
</VirtualHost>

<VirtualHost 1.1.1.1:80>
DocumentRoot D:/WWW/HTML/ip1host2
ServerName www.ip1host2.domain:80
...
</VirtualHost>

...

NameVirtualHost 1.1.1.2:80
<VirtualHost 1.1.1.2:80>
DocumentRoot D:/WWW/HTML/ip2host1
ServerName www.ip2host1.domain:80
...
</VirtualHost>

<VirtualHost 1.1.1.2:80>
DocumentRoot D:/WWW/HTML/ip1host2
ServerName www.ip2host2.domain:80
...
</VirtualHost>

...

Whatever virtual host I point my browser to, all I get is the content of
D:/WWW/HTML/DEFAULT.

Starting apache with the -S option says "Syntax ok"; normal startup only
complains (correctly) about one DocumentRoot which indeed does not exist.

Any ideas? I searched both the web and usenet to no avail...

Cheers,
Robert

Trevor Hemsley

unread,
May 17, 2009, 12:34:25 PM5/17/09
to
On Sun, 17 May 2009 13:39:44 UTC in comp.os.os2.networking.misc, Robert
Schroeder <rs-at-iem...@invalid.invalid> wrote:

> NameVirtualHost *:80
> <VirtualHost *:80>

I think this will conflict with the same statements with specific IP addresses.
You either need to name all IP's or none of them.

--
Trevor Hemsley, Brighton, UK
Trevor dot Hemsley at ntlworld dot com

Robert Schroeder

unread,
May 17, 2009, 12:53:03 PM5/17/09
to
Trevor Hemsley wrote:
> On Sun, 17 May 2009 13:39:44 UTC in comp.os.os2.networking.misc, Robert
> Schroeder <rs-at-iem...@invalid.invalid> wrote:
>
>> NameVirtualHost *:80
>> <VirtualHost *:80>
>
> I think this will conflict with the same statements with specific IP addresses.
> You either need to name all IP's or none of them.

Thanks, Trevor. But if it is not different from Apache 1.3, which I
don't think it is, it specifies a default resource to serve when none of
the specific IP addresses to follow are met.

If I comment that portion out, I get "Forbidden - You don't have
permission to access / on this server" for every site I try to browse,
which is what I would expect to get if there's no DocumentRoot
configured for a site I try to browse...

Cheers,
Robert

Robert Schroeder

unread,
May 31, 2009, 1:12:12 PM5/31/09
to
Hello again,

to answer my own posting, I still found no solution, but a workaround:

Robert Schroeder wrote:

> D:/WWW/HTML/DEFAULT. [...]

I did it without explicitly specified IP addresses:

NameVirtualHost *
<VirtualHost *>


DocumentRoot D:/WWW/HTML/DEFAULT
ServerName default.my.domain

...
</VirtualHost>

<VirtualHost *>


DocumentRoot D:/WWW/HTML/ip1host1
ServerName www.ip1host1.domain

...
</VirtualHost>

<VirtualHost *>


DocumentRoot D:/WWW/HTML/ip1host2
ServerName www.ip1host2.domain

...
</VirtualHost>

...

<VirtualHost *>


DocumentRoot D:/WWW/HTML/ip2host1
ServerName www.ip2host1.domain

...
</VirtualHost>

<VirtualHost *>


DocumentRoot D:/WWW/HTML/ip1host2
ServerName www.ip2host2.domain

...
</VirtualHost>

Works perfectly, and will even make the next change of physical
addresses easier, if I may have to change the provider or something. I
still don't understand why the original attempt didn't work, though...

Cheers,
Robert

0 new messages