Hi!
Thanks for your quick and detailed answers. Actually I think I did all
the things you mentioned but it still does not work. So here are the
changes I made:
1. I checked that the following entries are in the engine tag:
<Server port="8005" shutdown="SHUTDOWN">
...
<Service name="Catalina">
...
<Engine name="Catalina" defaultHost="localhost">
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true">
<Host name="www.my2nddomain.com"
appBase="/opt/apache-tomcat-7.0.32/my2nddomain" unpackWARs="true"
autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">
</Host>
</Engine>
</Service>
</Server>
2. In the host file I altered the entries to
88.84.140.85 www.my2nddomain.com
88.84.140.85 www.my1rstdomain.com
3. I actually did not really understand what you meant by
> Also, since you are using the /etc/hosts file instead of the DNS system, the
> client (browser) also has those entries in its hosts file. And, as
> Konstantin pointed out, you don't put the port number in the /etc/hosts file.
> If you are using DNS for the clients, make sure that it has entries for both
> hosts, pointing to the same IP address.
I'm not shure if I understand the meaning of DNS in this case
correctly. Do you mean a DNS on my local machine or do you mean the
DNS on a remote machine? I've got a pure domain hoster and I set an A
record entry such that the domain is forwarded to my server / ip
address 88.84.140.85. Both domains are actually pointing to this ip
address since both are hosted by the same domain hoster. I do not
explicitly use DNS on my local machine, at least I did not configure
it.
And how can the client (browser) have entries in a host file?
The current status is that when calling www.my1rstdomain.com:8080
points to the webapp installed for www.my2nddomain.com:8080.
2012/11/27 Jeffrey Janner <[email protected]>:
>> -----Original Message-----
>> From: Paul van Hoven [mailto:[email protected]]
>> Sent: Tuesday, November 27, 2012 2:13 PM
>> To: Tomcat Users List
>> Subject: Re: Tomcat with multiple domains
>>
>> Thanks for the answer. I followed the tutorial you propose (
>> http://wiki.apache.org/tomcat/TomcatDevelopmentVirtualHosts ). But it
>> is still not working. Here is my new configuration
>>
>>
>> server.xml
>> <Host name="2nddomain.com"
>> appBase="/opt/apache-tomcat-7.0.32/2nddomain.com" unpackWARs="true"
>> autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">
>> <Alias>2nddomain.com</Alias>
>> <Alias>www.2nddomain.com</Alias>
>> </Host>
>>
>> The directory
>> /opt/apache-tomcat-7.0.32/2nddomain.com
>> contains a ROOT.war file.
>>
>> I edited the /etc/hosts file and added the following entries:
>> 88.84.140.88 www.2nddomain.com:8080
>> 88.84.140.88 www.1rstdomain.com:8080
>>
>> Then I restarted the system and the tomcat server. Entering
>> www.2nddomain.com:8080 sends me to 1rstdomain.com. I noticed that the
>> file "/opt/apache-tomcat-7.0.32/2nddomain.com/ROOT.war" remains
>> untouched by tomcat, at least nothing is extracted from the war file.
>>
>> So what else am I missing here?
>
> Make sure that the new <Host></Host> definition is nested inside the
> <Engine></Engine> tags.
> You also do not need the first <Alias> line. The name= parameter takes care
> of that mapping for you.
> In general, the nesting works this way:
> <Server ... >
> <Service ... >
> <Connector ... />
> <Connector ... />
> <Engine ... >
> <Host name="host1.com" ... >
> <Alias>www.host1.com</Alias>
> </Host>
> <Host name="www.host2.com" ... >
> <Alias>host2.com</Alias>
> </Host>
> <Host name="www.myhost.com" ... />
> </Engine>
> </Service>
> </Server>
>
> There are a myriad other tag sets that could be included in there and it's
> very important that they be nested properly to work properly.
>
> Also, since you are using the /etc/hosts file instead of the DNS system, the
> client (browser) also has those entries in its hosts file. And, as
> Konstantin pointed out, you don't put the port number in the /etc/hosts file.
> If you are using DNS for the clients, make sure that it has entries for both
> hosts, pointing to the same IP address.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]