Caldarale, Charles R wrote:
From: Peter McNeil [mailto:pe...@mcneils.net]
Subject: Re: Virtual host set-up woes
1. edit conf/server.xml and add a <host> section inside the <engine> tag
that looks like this:-
<Host name="yourhost.com" appBase="yourhostapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
</Host>
2. create a directory inside your tomcat home directory called
"yourhostapps" as defined above e.g. mkdir $tomcathome/yourhostapps
Note that the above needs to be repeated for each desired host.
4. create a file in $tomcathome/conf/Catalina/yourhost called ROOT.xml,
making sure ROOT is all upper case, that contains the context for your
app e.g.
<Context path=""
You were good up to that point. The path attribute is not allowed here; remove
it.
The other point is that each <Host> name must have a DNS entry or else your
clients will never be able to reach it. (Alternatively, you could require your
clients to make entries in their hosts files - assuming your clients can find it.)
- Chuck
(Keep getting a high spam score; added some spaces in between URLs; resending
to list)
Ok... I think I'm getting closer. Now when I go to http:// dummy. com:8180 (8180 is the port I'm running the connector
on), I get a completely blank page. However, I am able to access/display certain static content for example:
http:// dummy. com:8180/css/main.css
local file: $CATALINA_HOME/dummyapps/css/main.css
But I only get an blank page for a simple index.jsp file (file is simple HTML markup w/some text). View source from the
browser shows absolutely nothing.
http:// dummy. com:8180/index.jsp
local file: $CATALINA_HOME/dummyapps/index.jsp
And a blank page is all I get for a simple static HTML file that lives in the
same place.
http:// dummy. com:8180/index.html
local file: $CATALINA_HOME/dummyapps/index.html
In fact even any non-existing file produces a blank page (i.e., no error; just
blank; nothing in the logs).
E.g., http:// dummy. com:8180/non-existent-file.dummy
Here are the changes I'm employed based on Peter and Charles' comments and
another read of the official docs.
$CATALINA_HOME/conf/server.xml
...
<Engine name="Catalina" defaultHost="localhost">
...
<Host name="http:// dummy. com" appBase="dummyapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<Logger className="org.apache.catalina.logger.FileLogger" directory="logs" prefix="dummy_access_log"
suffix=".log" timestamp="true"/>
</Host>
...
</Engine>
...
/etc/hosts
127.0.0.1 localhost dummy. com
...
$CATALINA_HOME/conf/Catalina/dummyapps/ROOT.xml
<?xml version='1.0' encoding='utf-8'?>
<Context>
<WatchedResource>WEB-INF/web.xml</WatchedResource>
</Context>
And the directory structure for the new context home (the content a built/deployed app I copied over from its old
location in /webapps).
$CATALINA_HOME/dummyapps
$CATALINA_HOME/dummyapps/WEB-INF
$CATALINA_HOME/dummyapps/index.jsp
$CATALINA_HOME/dummyapps/(other static files)
...
Nothing of interest in any of the logs.
Thanks for reading all of this.
Eric
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org