Operating System - OpenVMS
1753925 Members
9161 Online
108810 Solutions
New Discussion юеВ

Re: 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 12
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).