Operating System - OpenVMS
1828208 Members
2333 Online
109975 Solutions
New Discussion

Re: Running CSWS Java (Tomcat) in multiple instances

 
Bernado Pehar_1
Advisor

Running CSWS Java (Tomcat) in multiple instances

Hi,

does anybody know how I can run the CSWS Tomcat Webserver in multiple instances on VMS ? I have the default installation running, and would like to start the server in another instance on another port so I can do some testing. I don't want to interrupt the original instance when starting and stopping the test instance. Is this possible with the VMS Installation ? Does anybody have this sort of setup running already ? I am referring to the current release of Tomcat that is available from HP.

Regards,

Bernado
5 REPLIES 5
Duncan Morris
Honored Contributor

Re: Running CSWS Java (Tomcat) in multiple instances

Hi Bernado,

we have multiple Tomcat instances running on our systems.

Although the setup is not very elegant, it works quite well. The multiple instances grew in a disorganised fashion some years ago, so do not necessarily make decent usage of the latest facilities.

To give you and idea of the environment, please see the attched text file.

Regards,

Duncan
Hoff
Honored Contributor

Re: Running CSWS Java (Tomcat) in multiple instances

With parallel installs and parallel directories and parallel httpd.conf files and parallel ports, you should be OK. This is a fairly standard Apache configuration, particularly when you're prototyping a new Apache release. Two directories, two conf files, two IP ports, and off you go.

Use apachectl to start each parallel instantiation of Apache, aiming the start operation at the particular httpd.conf file.

You could also run completely separate using OpenVMS Galaxy instances, depending on the particular box.

As part of this, I tend to name the various log files, PID file, error log, and other such pieces by appending the IP port to the name.

Conceivably, you can choose to use the same doc root; the same HTML directories. For testing Apache or Apache modules, I tend to run fully parallel.

Starting and stopping the server can often be done "hot". On a server that is not marginal in its performance, restarting Apache is usually a very fast operation, and folks accessing the site typically won't notice. (There are cases where virtual hosts -- based on host name or on IP address -- are a better approach than multiple instances.) (Your particular environment probably has rather more context, but virtual hosting is mentioned here for completeness.)

Wander over to http://www.Apache.org and review the documentation over there. Since SWS is Apache, the documentation over there applies here, and there are piles of how-to and reference documents over there. (If anything, Apache has too much documentation, which can make simply finding stuff somewhat more difficult.)

As for Tomcat, take a look at:
http://tomcat.apache.org/tomcat-5.5-doc/appdev/deployment.html

Have run multiple instances quite regularly on other platforms, though have not tried this on OpenVMS. (Otherwise, you'd be looking at an OpenVMS-oriented httpd.conf right now.)

Stephen Hoffman
HoffmanLabs.com
Hoff
Honored Contributor

Re: Running CSWS Java (Tomcat) in multiple instances

addendum: If you want to run the exact same version of Apache with the same modules, you don't need to replicate Apache itself. Just httpd.conf (httpd80.conf, httpd8080.conf, etc) and replicate the files that are referenced from there. Possibly parallel cgi and doc roots, possibly the same. Either works.
Bernado Pehar_1
Advisor

Re: Running CSWS Java (Tomcat) in multiple instances

Hi,

I will give this another try and see if I can make this work. I'll be back to you when I get some results !

Regards,

Bernado
Bernado Pehar_1
Advisor

Re: Running CSWS Java (Tomcat) in multiple instances

Hi,

as promised, I'm back with some more info:

We have used a similar approach as Duncan, that is we have replicated the Tomcat Directory and changed the configuration files to use distinct ports. For startup, we have created a file called APACHE$JAKARTA_CONFIG_00.DAT in the sys$manager directory. We start the server using a DCL that does following:
$ DEFINE /SYSTEM APACHE$JAKARTA_CONFIG SYS$MANAGER:APACHE$JAKARTA_CONFIG_00.DAT
$ @SYS$MANAGER:APACHE$JAKARTA.COM 'P1' "''P2'" "''P3'" "''P4'" "''P5'" "''P6'" "''P7'" "''P8'"
$
$ EXIT

The content of APACHE$JAKARTA_CONFIG_00.DAT is simply an adaption of the APACHE$JAKARTA_CONFIG.DAT, and the logical makes the startup script use the different configuration and start the other instance. The only downside currently is, since we are using the same user uic to start the server, that we can not start and stop the 2 instances at the same time, because the logical is visible to both starting processes and can only hold one value in the group / system table ( it doesn't work on process level, since a new process gets started with run /detach in the end ).

But it does the trick. Alternatively, we also could have define a CATALINA$BASE logical, that would basically achieve the same.

We'll have to see if this is what we need in the end, otherwise we could try to see if we can make it work with virtual hosts, but then we would need 2 different IPs on the machine, as far as I could see.

Thanks for your input !

Regards,

Bernado