----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files. Don't make us guess your problem!!!
----------------------------------------------------------------
Ben,
In scenario 1, if you want to go with 2 NICs and 2 Apache/JServs, keep
in mind that unless State 2 goes down, you don't even have to turn on the
second Apache/JServ. I assume that the situation would be both irregular
and temporary, so you could just turn on the second JServ when needed and
deal with the performance loss until State2's real machine came online
again. I'm assuming they'd notify you if they needed to make the switch to
the DNS to point to your second card instead of the normal machine, in which
case you just flip your switch as well.
However, scenario 2 is probably the better solution, and it's less
complicated than you think. Only one NIC is needed. When in trouble with
one of your states, we're gonna have the DNS map both host names,
state1.your.domain and state2.your.domain, to the same IP address. Apache
will receive them both on port 80, and decipher for itself whether someone
is asking for state1 or state2.
Your NameVirtualHost directive will have your IP address - no port
necessary. For this example, we'll say you're on 192.168.0.2, so you say:
NameVirtualHost 192.168.0.2
Then you will have a <VirtualHost> tag for each of them, as follows:
<VirtualHost 192.168.0.2>
ServerAdmin [EMAIL PROTECTED]
DocumentRoot /path/to/state1/htdocs
<Directory "/path/to/state1/htdocs">
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
ServerName state1.your.domain
ErrorLog logs/state1_error_log
CustomLog logs/state1_access_log common
</VirtualHost>
<VirtualHost 192.168.0.2>
ServerAdmin [EMAIL PROTECTED]
DocumentRoot /path/to/state2/htdocs
<Directory "/path/to/state2/htdocs">
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
ServerName state2.your.domain
ErrorLog logs/state2_error_log
CustomLog logs/state2_access_log common
</VirtualHost>
Now you need different servlet mounting points for state1 and for
state2. I've read a few different people's instructions on how to do that,
but they never worked, so I do this and it works every time. Within your
jserv.conf, where the ApJServMount section is, you need two different
servlet mounting points. We'll let State1 mount on /servlet/, and State2
mount on /servlets/. So you say:
ApJServMount /servlet /state1
ApJServMount /servlets /state2
In jserv.properties put all of your wrapper.classpath entries for things
that would be allowed to be shared by both zones; any servlets that would
require separate data to be held for State1 and State2, even if they are the
same servlet or jar file, have to go into the repositories of the
appropriate properties for each zone. Now we point each mount point to its
proper zone with:
zones=state1,state2
state1.properties=/usr/local/apache/conf/jserv/state1_zone.properties
state2.properties=/usr/local/apache/conf/jserv/state2_zone.properties
This will make everything that people refer to in /servlet access the
servlets in the repositories of state1_zone.properties, and requests in
/servlets access the servlets in the repositories of state2_zone.properties.
Next you need to make sure each state's users stay in their appropriate
zones, so you make sure that your references to servlets in the
/path/to/state1/htdocs documents point to /servlet/State1Servlet, and
references to servlets in the /path/to/state2/htdocs documents point to
/servlets/State2Servlet. Maybe your index.html for each directory would
contain a simple
<SCRIPT>location.href="/servlet/MainMenu"</SCRIPT> for State1 and
<SCRIPT>location.href="/servlets/MainMenu"</SCRIPT> for State2.
So in recap, the DNS will send both host names to your machine on the
same address and port; Apache will know whether to serve pages from
/path/to/state1/htdocs or /path/to/state2/htdocs depending on which host
name the user entered in their browser; You make sure the documents in each
directory reference the proper mount point; You can drink coffees while the
DNS guys scramble to point both host names to your machine, which is all
ready to handle it. 1 copy of Apache/JServ running, and I'll have to rely
on someone else to make comment about the actual overhead of running two
servlet zones, but my guess is that your machine can handle it. When it
receives the load from both clients' users, I can only assume that it would
be faster and more efficient than running two copies of Apache/JServ. They
wrote JServ specifically with these scenarios in mind, and it's not that
hard to set it up.
Garrison
----- Original Message -----
From: Ben Ricker <[EMAIL PROTECTED]>
To: Java Apache Users <[EMAIL PROTECTED]>
Sent: Thursday, April 27, 2000 1:55 PM
Subject: Running multiple Apache/Jservs
> ----------------------------------------------------------------
> BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
> WHEN YOU POST, include all relevant version numbers, log files,
> and configuration files. Don't make us guess your problem!!!
> ----------------------------------------------------------------
>
> The network guys at my place of employemnt came up with this colocation
> scheme that I need to implement. Here is what we have now:
>
> Two locations in different states running nearly identical setups of
> Apache/Jserv on Linux 6.1 using Sun's JDK 1.2.2 and JSDK 2.
>
> They want me to duplicate each state's instance of the Apache/Jserv on
each
> machine. That is, on State 1's machine, we have a duplicate Apache/Jserv
> instance that can come online if something were to happen to State 2's
> Apache/Jserv instance and vice versa.
>
> My question is what is the best way to go about this? My first thought is
to
> make two different builds of Apache/Jserv on each machine: one listens to
> one ethernet adapter and the other listens to a second ethernet adapter
> (there are two NICs installed). A possible downside is that I will have
two
> separate versions of Apache and Jserv running in memory, not mention
adding
> more load to the machine.
>
> The other possibility is to set up virtual hosting so that when State 1
goes
> down, we just reroute through DNS to the State 2's Apache/Jserv but to a
> different port. Now that I think about it, I hardly hav an idea how to
> implement this part; the only difference between the two State's instances
> is the servlet class files. I could just create a second repository for
each
> site on each machine. Does this make sense?
>
> Which scenario sounds the best keeping in mind the extra load and
> performance loss associated with the increased load? Any ideas would be
> greatly appreciated.
>
> Ben Ricker
> US-Rx
>
>
>
> --
> --------------------------------------------------------------
> Please read the FAQ! <http://java.apache.org/faq/>
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> Archives and Other: <http://java.apache.org/main/mail.html>
> Problems?: [EMAIL PROTECTED]
>
>
--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives and Other: <http://java.apache.org/main/mail.html>
Problems?: [EMAIL PROTECTED]