> -----Original Message-----
> From: Valter Nogueira [mailto:[EMAIL PROTECTED]]
> Subject: RE: [JBoss-user] Virtual Hosts
> 
> I thought that <virtual-host> tag was about a server name like 
> www.myhost.com. And this make me really confuse.
> 
> Shouldn't www.myhost.com be setted at DNS or hosts file?

Tomcat resolves the name to an address when it sets up the vhost.  So it
knows which address to set the vhost on.  Now, remember that vhosting means
that you have multiple names that all go to one address.  If you were just to
provide the IP address, Tomcat could never know *which* name was supposed to
go to which particular context.  So when you provide the name as a part of
the context, it now knows which name should go to your context, then when it
does the IP address resolution, it knows which IP interface to start
listening on for those requests to come in on.

Note that what I wrote to you earlier was wrong.  I haven't slept much, sorry
to confuse you.  It should be:

add to jboss-web.xml inside app1.war:
  <jboss-web>
   <context-root>/</context-root>
   <virtual-host>app1.myhost.com</virtual-host>
  </jboss-web>

add to jboss-web.xml inside app2.war:
  <jboss-web>
   <context-root>/</context-root>
   <virtual-host>app2.myhost.com</virtual-host>
  </jboss-web>

> I read an answer sugesting add an <alias> tag for myhost.com, 
> instead of 
> redirecting it using DNS.

I don't quite understand what you are asking here, but just try it with the
full name of the host that you want to vhost, in this case www.myhost.com. 

> Just to add another novice question I don't get the issue 
> about port 80.

HTTP (the protocol that the web normally runs on) has a default port of port
80.  When you request a web page without a specific port, it goes to port 80.
Just like telnet goes to port 23, mail to port 25, etc.

> Maybe I am missing an important point in security or I am too 
> Windows/ASP to 
> see it. I know its is really of topic, but the problem would 
> occur with 
> diferent web server (iis, apache, tomcat, websphere)? Or just 
> with Jetty?

What problem are you referring to?  vhosting works this way on just about
every platform I have ever used.  What you may not be familiar with is the
concept of an "application context" and "WAR file".  When used together,
these are pretty specific to Java web applications.

> Together this post I am sending my solemn oath
> 
> "That I will not post such stupid questions again!", since I 
> believe I will 
> not be soo stupid after reading Stark's book.

:)  No worries.  

But I will leave you with something very important to consider:  Instead of
trying to start using JBoss today, think about getting started with Java by
using Tomcat by itself.  http://jakarta.apache.org/tomcat.  See, JBoss simply
uses Tomcat (or Jetty) to serve the web files out, kind of like M$ IIS.
JBoss is different, it provides advanced functionality that is something like
.NET.  .NET uses IIS just like JBoss uses Tomcat.  See what I mean?  Learn
Tomcat or Jetty now, then come back to learning JBoss.  I think you will be
glad that you did, and both products have very helpful user lists, just like
JBoss. 

http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg72944.html has
some good books that you might want to pick up to get started with.  

Good luck!

-b


-------------------------------------------------------
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility
Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to