On 3/31/2013 1:32 PM, Kevin Jenkins wrote:
Thanks but I had already tried variations on the URL in Host name that
before posting. Right now it's going to defaultHost (currently set to
masterserver2.raknet.com) even though I enter http://lobby3.raknet.com/ in
my webbrowser

<Engine name="Catalina" defaultHost="localhost">
<Host name="localhost"  appBase="webapps/masterserver2" unpackWARs="true"
autoDeploy="true">
<Host name="masterserver2.raknet.com" appBase="webapps/masterserver2"
unpackWARs="true" autoDeploy="true"/>
<Host name="lobby3.raknet.com" appBase="webapps/lobby3" unpackWARs="true"
autoDeploy="true"/>
<Host name="milestone.masterserver2.raknet.com"
appBase="webapps/masterserver2" unpackWARs="true" autoDeploy="true"/>
<Host name="milestone.lobby3.raknet.com" appBase="webapps/lobby3"
unpackWARs="true" autoDeploy="true"/>

Right now I just have an A record DNS pointing to the server IP address. Do
I need to set some other kind of setting than the above change to
server.xml?


On Sun, Mar 31, 2013 at 11:13 AM, Mark Thomas <ma...@apache.org> wrote:

On 31/03/2013 18:50, Kevin Jenkins wrote:
I'm trying to setup name based hosts by editing server.xml.
http://masterserver2.raknet.com/ should display a different page than
http://lobby3.raknet.com/ <http://masterserver2.raknet.com/>

The DNS entries are already setup. However, no matter what URL I put, it
just goes to the localhost page (error)

<Engine name="Catalina" defaultHost="localhost">
<Host name="localhost"  appBase="webapps/error" unpackWARs="true"
autoDeploy="true">
<Host name="masterserver2" appBase="webapps/masterserver2"
unpackWARs="true" autoDeploy="true"/>

You need to use the full DNS name for the name attribute of the host. I.e.:

<Host name="masterserver2.raknet.com" ...

Mark

<Host name="lobby3" appBase="webapps/lobby3" unpackWARs="true"
autoDeploy="true"/>
<Host name="milestone.masterserver2" appBase="webapps/masterserver2"
unpackWARs="true" autoDeploy="true"/>
<Host name="milestone.lobby3" appBase="webapps/lobby3" unpackWARs="true"
autoDeploy="true"/>

Kevin,

You do not want each named virtual host in the same webapps directory. At best, you'll get double deployment. At worst, you won't get what you expect (the behavior you're currently seeing).

The Wiki document I referenced explains exactly how to do this. It works fine for Windows (change paths to reflect Windows particulars) and Linux. It works fine in production as well as development.

Simply put:

1. Create three directories OUTSIDE of %CATALINA_HOME%\webapps
2. For each named virtual host do the following:

<Host name="fully-qualified-hostname"
      appBase="absolute-path-to-directory"
      unpackWARs="true"
      autoDeploy="true"/>

3. If you want short-named aliases, change the above to:


<Host name="fully-qualified-hostname"
      appBase="absolute-path-to-directory"
      unpackWARs="true"
      autoDeploy="true">
      <Alias>short-name-one</Alias>
      <Alias>short-name-two</Alias>
</Host>

4. Place a ROOT.war in each of the directories (case is important)

5. If you want a Manager application for each named virtual host:
   a. By copying
      1. Copy manager folder to appBase specified above
      2. Copy manager.xml from localhost to

%CATALINA_BASE%\conf\fully-qualified-hostname\manager.xml

   b. By referencing
      1. Copy manager.xml from localhost to

%CATALINA_BASE%\conf\fully-qualified-hostname\manager.xml

      2. Add a docBase attribute to point to the localhost manager
         application

. . . . just my two cents.
/mde/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to