Just a follow up on this, I did manage to get the virtual hosting and
everything working.
Windows server wise, I used the DNS tools v in Win2K3 Srinstead of the hosts
file. For some reason the HOSTS file isn't working correctly. This is an
issue for another time.
What I did to get Tomcat working was pretty much what is in the docs once I
re-re-re-read them. I used the virtual hosting and it looked like the
problem I was having is that instead of using $CATALINA_HOME/[directory
name]/ROOT, I was leaving the ROOT directory out and putting it into just
the directory name (which coincidentally is how I have it under the webapps
directory -> $CATALINA_HOME/webapps/[software directory])
In my server.xml file, I have narrowed down the <Engine> parameters down to
the base minimum (removed 90% of the comments from the file) and came up
with this:
<Engine name="Catalina" defaultHost="localhost">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false" />
<Host name="abc" appBase="abcapps">
<Alias>abc.test.com</Alias>
<Host name="abc" appBase="abcapps">
<Alias>abc.test.com</Alias>
</Host>
</Engine>
Notice the absolute basic <Host> parameters, since I don't have a WAR to
deploy, I can get away from all of the extra "hubub" about auto deploy.
However the Alias coincides with the sub-domain that I had set up on
Server2K3. I've also created an xyz company as well with complete separate
schemas for each of the companies using a custom context.xml in the META-INF
directory to test and it works. Now I just need to create a script or admin
panel that I can go in and set one up automatically.
On Wed, Jun 3, 2009 at 2:58 PM, Josh Gooding <[email protected]> wrote:
> You sir are a gentleman and a scholar! Thank you for all of the tips, they
> are greatly appreciated! I think you have answered just about all of my
> questions I have as of right now. I have Win Server 2K3 R2 and a box to
> play with. I am going to try to get everything up and running this
> weekend. Hopefully I'll be able to get this and the MySQL tweak running in
> under a day or so.
>
> Again thank you so much. If I have any more questions, I'll toss them up
> here.
>
> - Josh
>
>
> On Wed, Jun 3, 2009 at 12:59 PM, Caldarale, Charles R <
> [email protected]> wrote:
>
>> > From: Josh Gooding [mailto:[email protected]]
>> > Subject: Re: Just a few questions on my Tomcat Configuration
>> >
>> > I use virtual hosting to create /abcapps and /xyzapps and install the
>> > "program" in each directory.
>>
>> The proper term is webapp, not "program". A webapp has a spec-defined
>> directory structure that must be adhered to for proper operation of the
>> webapp. Browse through the various webapps that come with Tomcat to get an
>> idea of the layout, read the servlet spec for the details.
>>
>> > In the <Host> section, bind the sub-domain to them
>>
>> Also set the appBase attribute of each <Host> to point to the specific
>> sub-domain directories. Note that the default webapp for a <Host> must be
>> named ROOT (case sensitive). One of your <Host> elements must be declared
>> as the defaultHost for the surrounding <Engine>; this is the one used when
>> the URL does not match any of the <Host> name attributes (including
>> references via IP address).
>>
>> > then I should be able to login per subdomain
>>
>> Depends on what you mean by login. If it's just accessing the web site,
>> yes; if you mean authentication, you'll need to configure the appropriate
>> security mechanism. This is usually done with a <Realm>, which can be
>> placed inside an <Engine>, <Host>, or <Context>, as needed.
>>
>> > (since I have files being uploaded to the server).
>>
>> Do not attempt to write files into the appBase directory - keep them
>> outside of Tomcat's directory structure.
>>
>> > It's all housed in the Server.xml file right?
>>
>> <Context> elements are not. (Watch out for your capitalization; many file
>> names are case-sensitive, even on Windows. That should be server.xml, not
>> Server.xml.)
>>
>> > One more quick note, is there a way that I can break out certain
>> > sections of the server.xml file into a seperate .properties file?
>>
>> Not that I'm aware of, although various XML inclusion mechanisms might
>> work (haven't tried). You can resolve attribute values from system
>> properties, using the ${prop.name} notation. Anything to do with
>> specific webapps should not be in server.xml.
>>
>> > can I do the same thing in the server.xml file since it is
>> > a core file that tomcat relies on for it's configuration?
>>
>> And is thus not intended to be updated frequently. The contents of
>> server.xml are only read when Tomcat starts up; changes mad after the fact
>> won't be honored until the next Tomcat restart.
>>
>> - Chuck
>>
>>
>> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
>> MATERIAL and is thus for use only by the intended recipient. If you received
>> this in error, please contact the sender and delete the e-mail and its
>> attachments from all computers.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>>
>