Install Multiple Tomcat Instances With CPanel X.xx

Nov 20, 2007

install tomcat in one location and have multiple instances running for individual clients:

Why would you want to do this:
==============================
1) Install tomcat in 1 location and have x number of instances running on a per client basis
2) Upgrade tomcat and have it propagate to all clients
3) Limit the resources each tomcat instance uses
4) Tomcat runs as the individual user rather than "root" or "tomcat"
5) Each user has its own manager; hence, no security risk to others
6) Start/Stop/Restart tomcat instances without affecting other clients who also have a tomcat instance

Assumptions:
============
1. Tomcat is installed in: /usr/local/tomcat (TOMCAT_HOME)
2. Instances are installed in: /usr/local/tomcat/instances
3. Java is installed somewhere on your machine

Step 1 - Create a Tomcat Instance
=================================
- Create a directory in /usr/local/tomcat/instances/user1 (CATALINA_BASE)
- Create a set of directories (conf,temp,logs,webapps) in $CATALINA_BASE
- Copy web.xml,server.xml,tomcat-users.xml from $TOMCAT_HOME/conf to $CATALINA_BASE/conf
- Create a bash script called user1startstop.sh as follows and make it executable

Quote:

#!/bin/bash
export INSTANCE_NAME=user1
export CATALINA_BASE=/usr/local/tomcat/instances/user1
#This is where you'd be able to restrict the memory usage
export CATALINA_OPTS=" -Djava.awt.headless=true"
# Call the jsvc script to launch the Tomcat instance
/usr/local/tomcat/bin/Tomcat5.sh $1

Step 2 - Configure the Tomcat Instance
======================================
- edit $TOMCAT_BASE/conf/server.xml:

Replace: ... port=8005 with port 8101 ... This is shutdown port
Replace: ... port=8080 with port 8201 ... This is http port
Replace: ... port=8009 with port 8301 ... This is the AJP port

- edit $TOMCAT_HOME/conf/workers.properties

Add: user1 to worker.list=ajp12,ajp13...
Add:
worker.user1.host=localhost
worker.user1.port=8301
worker.user1.lbfactor=1
worker.user1.type=ajp13
Under:
DEFAULT ajp13 WORKER DEFINITION

Step 3 - Modify Main Tomcat (One-Time)
======================================
Edit $TOMCAT_HOME/bin/Tomcat5.sh

Add:

Quote:

DAEMON_HOME=/usr/local/tomcat/bin
PIDFILE=/var/run/jsvc-$INSTANCE_NAME.pid
TMP_DIR=/usr/local/jakarta/servers/$INSTANCE_NAME/temp
TOMCAT_USER=$INSTANCE_NAME

Modify start case with the following:

Quote:

$DAEMON_HOME/jsvc
-user $TOMCAT_USER
-home $JAVA_HOME
-outfile $CATALINA_BASE/logs/catalina.out
-errfile $CATALINA_BASE/logs/catalina.err
-pidfile "$PIDFILE"

-Dcatalina.home=$CATALINA_HOME
-Dcatalina.base=$CATALINA_BASE
-Djava.io.tmpdir=$TMP_DIR
$CATALINA_OPTS
-cp $CLASSPATH
org.apache.catalina.startup.Bootstrap
;;

Modify end case with the following:

Quote:

PID=`cat $PIDFILE`
kill $PID
rm $PIDFILE
;;

Step 3 - Configure Apache
=========================

- Edit httpd.conf
Add the following code under the VirtualHost definition of the user in question:
<IfModule mod_jk.c>
JkMount /*.jsp user1
JkMount /webapps/* user1
JkMount /servlets/* user1
JkMount /servlet/* user1
</IfModule>

Step 4 - Restart Apache

Step 5 - run $TOMCAT_INSTANCE/user1startstop.sh start

That's it.

I have 5 instances of tomcat running on my machine and it works like a charm.

View 4 Replies


ADVERTISEMENT

Apache :: Redirecting To Multiple Webapps In Same Tomcat

Jun 25, 2015

I must say that I tried a lot of possibilities but my knowledgment in Apache WS is not too much advanced.

Apache Web Server version: 2.2.22
OS: Centos 6 64 bits
Tomcat version: 7.0.57

What I need to achieve is the following:

I have some plain websites defined this way:

<VirtualHost *:80>
ServerAdmin example1@example1.com
DocumentRoot "/opt/sites/example1/"
ServerName example1.com
ErrorLog logs/example1-error_log
CustomLog logs/example1-access_log common
RedirectMatch permanent ^/(.*) http://www.example1.com/$1

[Code] ....

View 5 Replies View Related

Install Tomcat

Apr 24, 2009

in cPanel 11.24.4-R35075 I have installed tomcat using the manage plugin in whm now could anyone let me know how do i test it and what will be the webapp;lication directory for tomcat, Does the steps performed to install is inadequate?

View 4 Replies View Related

How To Install Tomcat On Linux

Dec 21, 2008

You can easily install tomcat on Linux through this tutorial
[url]

View 6 Replies View Related

How To Install Multiple Certificates With Stunnel

Mar 30, 2009

I am running qmail with stunnel to achieve SMTPSD and POP3DS. I am running it on 1 SSL cert on stunnel. How do I install more than 1 cert on stunnel as some of the clients on the server want their own cert for SMTP and POP over SSL?

View 1 Replies View Related

Plesk 11.x / Linux :: Multiple PHP Versions - How To Install Extensions

May 27, 2014

I have installed PHP5.5.12 as the secondary php version. The primary version (installed with plesk) is php5.4 .

Now when I try to install extensions, every time they are installing to the primary version.

How can I install extensions special for the other version?

I have Debian 7 x64 and parallels plesk 11.5

View 3 Replies View Related

Tomcat @ Cpanel Stopped

Mar 18, 2007

for some reason since 2 days ago tomcat stopped working by itself. i removed it and reinstalled it several times with no luck at all. it seems it has something todo with mysql connectivity, but the weird thing its working on php just fine even the test code its not working ....

View 0 Replies View Related

WHM/cpanel Tomcat 404 Error

Aug 4, 2009

In my linux vps i am using WHM and enabled tomcat hosting for one of virtual host ,the tomcat shows 404 error for .jsp pages,remaining virtualhosts are working properly.When i view the log file i found the following line,

INFO: Container org.apache.catalina.core.ContainerBase.[Catalina].[vhost].[/] has not been started

In above line vhost is domainame.How to solve this issue?

View 1 Replies View Related

Reliable VPS Provider That Manage Tomcat/JSP Fine On Cpanel?

Nov 5, 2008

Could you please recommend a stable reliable VPS provider that manage Tomcat/JSP fine on cpanel?

I did search and find no suitable one

View 2 Replies View Related

Redirect 8080 Requests To 80 Port - Tomcat Problem At CPanel Server

Jan 31, 2008

Yesterday I installed tomcat on a RHEL 4 + cPanel and httpd 2.0.63 server using easyapache3, process was ok, jsp pages are loading fine using http://site.com/example.jsp , but servlets, are not working using http://site.com/example, how ever, if I load http://site.com:8080/example it loads the servlet perfect.

I read something about redirecting all traffict from port 80 to 8080, but you know.. this is a shared server, and that would affect all customers on the server.

So, mod_jk seems to be the only solution, now I read many documents over the web, but no one seems to be working to configure apache2 and mod_jk that is installed using easyapache3 script.

In my httpd.conf file, i have this:

LoadModule jk_module modules/mod_jk.so
Include "/usr/local/apache/conf/jk.conf"
At jk.conf i have this content: ...

View 5 Replies View Related

Plesk 11.x / Linux :: Multiple Email Certificates For Multiple Domains?

Nov 11, 2014

I have two domains as virtual hosts on same IP address.

I am getting certificate error for the second domain when I try to check email (using MS Outlook). I can't permanently "accept" certificate, it complains again and again. Certuficate I created and self signed for imap.domain1.com, but the second email server is imap.domain2.com, so it complains.

How do I set separate email certificates for two domains? Is it possible at all?

View 5 Replies View Related

Apache :: Multiple Error Codes For Multiple Pages

Nov 9, 2012

Depending on where u are at on my site (documents pages, training, main root, etc.) will depend on which type of background, footer, header and the like you'll get. Now I was thinking. Is there a way to have multiple error messages for more then one page depending on where you are at on a site? Right now it's intranet site and a modded snitz forum. What is the code and were does it go and in which apache conf file(s) does it go in?

View 1 Replies View Related

CPanel With Multiple Ethernet Adapters

Jul 24, 2008

We have a few CPanel servers, all with multiple NIC's. (2 Each)

We want to setup Eth0 to be the managment interface (ie. 72.2.24.x)
We want to setup Eth1 to be the Shared / Exclusive IP Nic (ie. 67.69.141.x)


Here is the issue, Eth1 is on a totally different Vlan than Eth0.. thus, isolating DDOS attacks, and any other type of traffic concerns for managment.. But, it also has a different G/W as Eth0.

View 1 Replies View Related

Multiple Account CPanel Transfer Without SSH

Nov 6, 2009

I have a new dedicated server, and I want to transfer multiple accounts from a reseller package I have with a third party to the new server.

I only have SSH access on the dedicated server so I can't use the Multiple Account Transfer feature of WHM, only the single account transfer feature.

Is there anyway I can transfer multiple accounts without SSH access?

Another question - how can I mass change the MX records of accounts once they are transferred over?

View 3 Replies View Related

Multiple CPanel Servers / Firewall

May 6, 2008

I recently found out the hard way that cPanel cannot run behind firewall using NAT, I got pretty far in configuring the server but I ran into major issues when it came to SSL and gave up!

Anyway, I current have one cPanel server with CSF and IFD which is working great (I guess), but what happens when I want to move all my server over to cPanel? Will I need CSF/IFD installed on the servers? This seems really impractical and a nightmare to administer. What firewall can I use so that all my cPanel servers can sit behind it?

Any input would be much appreciated as I cannot seem to find a solution, everything seems to have a catch!

View 4 Replies View Related

Multiple DNS Zone Edit In CPanel

Feb 7, 2007

I was thinking if there's any option in WHM to edit multiple DNS Zones? I need to Edit the zones for quite a number of domains.

View 5 Replies View Related

Cpanel Multiple Account Transfer

Apr 15, 2007

how to fix cpanel multiple account transfer issue. When i use the tool, it logins to my other server but when i select the multiple accounts and click copy it gives error of ssh timeout or password not right.

How to fix this as i need to move alot of accounts.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved