Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

Question about virtual hosts on Apache 1.3...

SOLVED
Go to solution
Willem Grooters
Honored Contributor

Question about virtual hosts on Apache 1.3...

Now for something completely different.
My system runs Apache (aka CSWS) 1.3, and is (via a firewall) continously connected to the Internet.
In DNS at my ISP, "www.domain.tld" refers to my FW's outside NIC (aaa.bbb.ccc.ddd, and this translates all http-traffic (port 80) to my Alpha (having a public (non-routed) address.
I have a second 'web' "anotherweb.domain.tlb" defined, it is in DNS as wel, and also referring my (outside) IP address. Still on port 80, I assumed having this defined as a in Apache's configuration this web could be accessed seperately. All conform the examples on the Apache website, Alan Winston's book and the CSWS documentation
However, is doesn't work as I expected.
"http://www.domain.tld" shows my 'normal' webpage (what I wanted), but so does http://anotherweb.domain.tlb, which should be VERY different.
Both webs are to be accessed by port 80, so a different port is not an option (at least, if avoidable).

I know it must be possible but somewhere I lost track.
If you need a part of httpd.conf (at least, part of it), tell me which part and I'll attach it.

Willem
Willem Grooters
OpenVMS Developer & System Manager
12 REPLIES
Andreas Fassl
Frequent Advisor

Re: Question about virtual hosts on Apache 1.3...

Hi,

could you post your httpd.conf file?

Regards

Andreas
Dieter Rossbach
Regular Advisor

Re: Question about virtual hosts on Apache 1.3...

I run 10+ different Web-Sites on my Alpha with OpenVMS 7.3-2/csws/Tomcat in .de .net and .com TLDs. It must be a problem with your httpd.conf file, so please show us how it looks like ...

Regards
Dieter
Willem Grooters
Honored Contributor

Re: Question about virtual hosts on Apache 1.3...

Here's the bare httpd.conf. I stripped off all (standard) comments, so only non-comment lines were left. It's in the right order.

There is a third web mentioned, but that will be started using a specific port so I can transfer control directly in the firewall.

Another matter - related to this question
I know this won't work if SSL is enabled. If I t to use the same (single IP-address, single port) approach, how to confure that? (MOD_SSL will be inserted before the virtual hosts (as Alan Winstoin suggests))
Willem Grooters
OpenVMS Developer & System Manager
Dieter Rossbach
Regular Advisor

Re: Question about virtual hosts on Apache 1.3...

Hi Willem:

remove the webx.domand.tld entry from the VirtualHost directive and try:


...



...


Dieter

Willem Grooters
Honored Contributor

Re: Question about virtual hosts on Apache 1.3...

Dieter,
That what I originally had, but it's not what I require. For access on my LAN it's no problem to do that, but since the webs need to be accessable from outside, this doesn't seem to work.
To clearify: in DNS, all names resolve to just ONE IP-address. The firewall has no facilities to discriminate in names - so all HTTP-requests will be transferred to 192.168.0.2.
If I specify the virtual hosts like you said, the second and third are not accessable from outside since there is no path to them, so these webs will never show.
I have tried to specify 192.168.0.2 for all, but even that doesn't work properly, it's always the first web that will show up.
For what I understood from the documentation, multiple specifications are possible, for instance for internal and external access, and for named virtual hosts specification of the name in the line is a requirement.
Willem Grooters
OpenVMS Developer & System Manager
Dieter Rossbach
Regular Advisor

Re: Question about virtual hosts on Apache 1.3...

I hope I got your problem now ...

I need access to my home system, I run a similar construction on that system (DSL-Router, dyndns, all the dyndns-names are mapped to one IP-Address, multiple addresses on the VMS Box) but I'll not be back home until late.

Dieter
Martin Vorlaender
Honored Contributor

Re: Question about virtual hosts on Apache 1.3...

> and for named virtual hosts specification
> of the name in the line is
> a requirement.

That's not quite correct. The name of the virtual host (preferably specified by an IP address) is supplied with the ServerName statement inside the .

See http://httpd.apache.org/docs/dns-caveats.html
Willem Grooters
Honored Contributor

Re: Question about virtual hosts on Apache 1.3...

Martin,
So I do NOT need "webx.domain.tlb" in , just the IP address, like this:



...




...


As you will see from the previously attached file, this IS already the case. As stated before, I _need_ them to be on ONE address.

however, specifying a name in would not lead to a problem, the Apache documentation gives it as an example where a server is to be accessed by different names for intranet and extranet.

Willem Grooters
OpenVMS Developer & System Manager
Martin Vorlaender
Honored Contributor

Re: Question about virtual hosts on Apache 1.3...

Apart from the brackets around ServerName, that's it. You can have two VirtualHost sections using the same IP, provided you also specify ServerNames.

Using DNS names in VirtualHost statements will lead to problems whenever DNS fails.

Using IP addresses without ServerNames will likewise fail in case of DNS problems, because Apache tries a Reverse Lookup then.
Plus it will not work with multihoming (i.e. multiple servers on one IP).

I see a "*" in the first VirtualHost statement of your config file that bothers me. I've no idea how Apache reacts to that.

How does VMS' TCP/IP resolve web2.domain.tld and web3.domain.tld? Try it using nslookup or dig (if present).
Willem Grooters
Honored Contributor

Re: Question about virtual hosts on Apache 1.3...

Martin,
For what I understood, "*" as address means "any bound address"; interpreted by me as "specified name will be used, regardless the specified address" - if more BindAddresses are used (as in my case).

>>How does VMS' TCP/IP resolve web2.domain.tld and web3.domain.tld? Try it using nslookup or dig (if present).

I'll check what my VMS machine thinks of IP-addresses of these webs but I'm pretty sure it finds it on the ouside side of the router (which is correct) - as will any PC inside the firewall. None of them is specified on the local DNS (on my VMS-box as well).
I specified the router as forwarder and in the router's log, I see translation requests from the VMS-box for domains it cannot resolve (it's the primary DNS server on the intranet)

Anyway, I'll take your suggestion and remove the names, and put expolicitly the internal address in .
Willem Grooters
OpenVMS Developer & System Manager
Martin Vorlaender
Honored Contributor
Solution

Re: Question about virtual hosts on Apache 1.3...

The Apache docs state that

...

Addr can be
The IP address of the virtual host
A fully qualified domain name for the IP address of the virtual host.

The special name _default_ can be specified in which case this virtual host will match any IP address that is not explicitly listed in another virtual host. In the absence of any _default_ virtual host the "main" server config, consisting of all those definitions outside any VirtualHost section, is used when no match occurs.

cf. http://httpd.apache.org/docs/mod/core.html#virtualhost
Willem Grooters
Honored Contributor

Re: Question about virtual hosts on Apache 1.3...

Martin,
Consider this known.

I have just checked on my VMS system, and all webs are found using DIG on the address expected: on the _outside_ address (so NOT 192.168.0.2).

Anyway - you put me on the right track:



...

same for web2 and web3.

From outside: it works. From inside, it works by separate addresses (192,168.0.11, .12, and .13) but not by name. I'll check on that later.

NO _default_ - yet - but since web1 is the first of the virtual webs, that would automaticly be the default one. At least, says Alan Winston.
Willem Grooters
OpenVMS Developer & System Manager