mike47

Member
Oct 8, 2002
7
0
151
I have a very simple question after reading all the posts on Cpanel 11 and Tomcat. First it's gone then it's back etc etc ............
I am on Cpanel 11 Stable 16448, If I load Tomcat from WHM Plugins will it work or not?
Thank You ahead of time if someone can give a simple answer.
 

xeonex

Well-Known Member
Mar 20, 2005
56
0
156
mm ido not think it works
i used to run severlat jsp sites that i had to move to a pl*sk box cause all problems running tomcat on a cPanel.
by the way i had a trouble ticket opened with cPanel from my data center scince 6 days ago and no one was able to made tomcat run again
 

CrewXp

Active Member
Nov 12, 2003
43
0
156
is there any update to this? There's no Tomcat installation option in the Plugins section, or the Update Apache section.

I was requested by a client to have mysql-connector-java installed. I think this is Tomcat, but I'm not sure, thx.
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
13
313
Houston, TX
cPanel Access Level
Root Administrator
is there any update to this? There's no Tomcat installation option in the Plugins section, or the Update Apache section.

I was requested by a client to have mysql-connector-java installed. I think this is Tomcat, but I'm not sure, thx.
mysql-connector-java is not Tomcat in and of itself, it's the JDBC driver for MySQL. You can find it on MySQL's website.

I haven't heard any news regarding re-enabling Tomcat in Stage 1 builds yet. It seems the developers are focusing their efforts on Tomcat support for Stage 2 at the moment. Essentially they're trying to make sure using Tomcat on cPanel/WHM will not be the bumpy ride that it was in previous versions of cPanel/WHM.
 

meeven

Well-Known Member
May 8, 2007
132
2
168
I haven't heard any news regarding re-enabling Tomcat in Stage 1 builds yet. It seems the developers are focusing their efforts on Tomcat support for Stage 2 at the moment. Essentially they're trying to make sure using Tomcat on cPanel/WHM will not be the bumpy ride that it was in previous versions of cPanel/WHM.
Am I right in understanding this to mean that, at the moment, there is no Tomcat in cPanel 11 STABLE?

I am in a bit of a catch-22 situation. I need to install JDK1.3 for a client (their payment gateway needs it) and am on cPanel 10.9 right now, but Tomcat on this version is broken and bug-ridden and on cPanel11, it isn't available yet. I am left scratching my head:confused:

Is there any other, non-cPanel dependent way to install JDK 1.3? If yes, what will happen when I run a cPanel update or upgrade?
 

mtindor

Well-Known Member
Sep 14, 2004
1,463
114
193
inside a catfish
cPanel Access Level
Root Administrator
I installed Tomcat on WHM 11.2.0 cPanel 11.11.0-R16789. The install went fine except that it would not compile jvsc (which is used to manage the service). This was specific to my architecture (x86_64). I don't think non-x86_64 architectures would have the problem.

In Cpanel 11 Release you'll find 'beta' support for Tomcat. This is supposed to change when EasyApache 3 is out after stage 2. Then I believe the idea is that Tomcat installs will be a non-issue and should well for all.

But, the beta Tomcat support in current Cpanel 11 Release did work for me. If your architecture is x86_64, be prepared to have to download the jvsc sources and and do a little bit of work to get it installed to the point where it will fire up and run. It's not too difficult though, and I can share the steps with you to do it if you try on x86_64 and have problems.

Mike
 

meeven

Well-Known Member
May 8, 2007
132
2
168
mtindor, many thanks. I had completely forgotten this thread. Sorry.

It's great to know that Tomcat beta works in cPanel11. Regarding x86-64, I suppose I should ask my hosting provider for confirmation?

Thanks.
 

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,607
80
458
cPanel Access Level
Root Administrator
The jsvc source tarball that ships with all tomct releases (http://tomcat.apache.org) is severely out-of-date and will not compile on x86_64 architectures. The Tomcat project knows this but has not rectified this in the years since it was reported.

The Tomcat installer in EA3 ships the most recent release of jsvc, resolving this particular issue.
 

meeven

Well-Known Member
May 8, 2007
132
2
168
mtindor, my host confirmed that they're using an x86_64 architecture. Could you please share the steps for downloading jsvc directly and configuring it?
 

mtindor

Well-Known Member
Sep 14, 2004
1,463
114
193
inside a catfish
cPanel Access Level
Root Administrator
mtindor, my host confirmed that they're using an x86_64 architecture. Could you please share the steps for downloading jsvc directly and configuring it?
meeven,

What version of Cpanel are you running? Log into WHM and post the Cpanel/WHM version information in the top right corner.

If you're running a server that has CURRENT or EDGE (something with EA3 - EasyApache3), you'll do things differently than I did.

If you're running a RELEASE version, I may be able to help you. But I have to know first what you are running or it isn't worth me giving you the instructions.

If you are running a RELEASE version, then go into WHM, then under Cpanel you'll find 'Plugins'. Click on that. Then go down to the Tomcat entry, checkmark 'install and keep updated' and install it.

Once it has finished installing, see if it is running by doing a 'ps auwx |grep tomcat' to see if tomcat is running.

If it isn't running after you've tried to install it this way, let me know.


Otherwise, if you are running EDGE or CURRENT, I cannot help you as the instructions would be different. In EasyApache3, that comes as part of the latest CURRENT/EDGE releases, the problem with compiling Tomcat on x86_64 is supposed to be fixed and you'll need to follow the install methods for that.

Mike
 

mtindor

Well-Known Member
Sep 14, 2004
1,463
114
193
inside a catfish
cPanel Access Level
Root Administrator
I apologize, but I didn't write down what I did to get it running after all. I could do it again if i had to on a server that did _not_ have it installed. But I don't have the time to botch up my working system by testing it to give you the details.

The problem is that the Tomcat folks continue to bundle an ancient version of jsvc with their releases, and this is what usually breaks on x86_64.

IF you're running the latest RELEASE version and you want to try it. I think this is how it goes:

1. Install Tomcat via WHM - select Plugins under the Cpanel selection, checkmark 'install and keep updated' and then install Tomcat

2. From an SSH shell (as root) do this:

Code:
mkdir /root/tempdir
cd /root/tempdir
wget [url]http://apache.mirrors.hoobly.com/commons/daemon/binaries/commons-daemon-1.0.1.tar.gz[/url]
tar zxvf commons-daemon-1.0.1.tar.gz
cp commons-daemon-1.0.1/bin/jsvc.tar.gz /usr/local/jakarta/jakarta-tomcat-5.5.9/bin/
cd /usr/local/jakarta/jakarta-tomcat-5.5.9/bin
tar zxvf jsvc.tar.gz
cd jsvc-src
./configure --with-java=/usr/local/jdk
make
cp jsvc ../
cd ..
chown tomcat:nobody jsvc
/scripts/restartsrv_tomcat
See if that works for you. Follow those directions exactly as I have stated. If you don't go into the right directories, when I have instructed you to, this isn't going to work.

Mike
 

meeven

Well-Known Member
May 8, 2007
132
2
168
Thank you, Mike. I installed Tomcat first and grep showed the following:

[email protected] [/]# ps auwx |grep tomcat
root 4014 0.0 0.0 1556 316 ? Ss 02:25 0:00 jsvc.exec -user tomcat -cp ./bootstrap.jar -Djava.endorsed.dirs=../common/endorsed -debug -outfile ../logs/catalina.out -errfile ../logs/catalina.err -verbose org.apache.catalina.startup.Bootstrap -security
tomcat 4015 0.7 0.7 292588 32984 ? Sl 02:25 0:02 jsvc.exec -user tomcat -cp ./bootstrap.jar -Djava.endorsed.dirs=../common/endorsed -debug -outfile ../logs/catalina.out -errfile ../logs/catalina.err -verbose org.apache.catalina.startup.Bootstrap -security
root 26104 0.0 0.0 1584 472 pts/1 S+ 02:31 0:00 grep tomcat
I guess that means it is installed and working.

I then tried the next set of commands in SSH and came unstuck at the following:
[email protected] [/usr/local/jakarta/jakarta-tomcat-5.5.9/bin/jsvc-src]# ./configure --with-java=/usr/local/jdk
-bash: ./configure: Permission denied
Not sure why I would get this permission denied error when I am logged in as su -

Thanks for all your help so far.
 

meeven

Well-Known Member
May 8, 2007
132
2
168
I asked my host to help, so they made the configure binary executable and ran the ./configure command for me. They then asked me to proceed from make onwards and I did. But, I got stuck at the following:

[email protected] [/usr/local/jakarta/jakarta-tomcat-5.5.9/bin/jsvc-src]# cp jsvc ../
cp: overwrite `../jsvc'? y
cp: cannot create regular file `../jsvc': Text file busy
Can I ignore this and move to the next command, cd ../(which basically just steps back up one level) and restart jsvc?

Thanks,
meeven
 
Last edited:

meeven

Well-Known Member
May 8, 2007
132
2
168
Well, I asked my host who said the following:
The reason for this is you need to shutdown jsvc. However, it looks like the file is already there.. same size etc. Just about an hour difference in time stamps.
I decided to ignore it and go ahead with the remaining steps and this is what I got:
[email protected] [/usr/local/jakarta/jakarta-tomcat-5.5.9/bin]# chown tomcat:nobody jsvc
[email protected] [/usr/local/jakarta/jakarta-tomcat-5.5.9/bin]# /scripts/restartsrv_tomcat
jsvc debug: +-- DUMPING PARSED COMMAND LINE ARGUMENTS --------------
jsvc debug: | Detach: True
jsvc debug: | Show Version: No
jsvc debug: | Show Help: No
jsvc debug: | Check Only: Disabled
jsvc debug: | Run as service: No
jsvc debug: | Install service: No
jsvc debug: | Remove service: No
jsvc debug: | JVM Name: "null"
jsvc debug: | Java Home: "null"
jsvc debug: | PID File: "/var/run/jsvc.pid"
jsvc debug: | User Name: "tomcat"
jsvc debug: | Extra Options: 3
jsvc debug: | "-Djava.class.path=./bootstrap.jar"
jsvc debug: | "-Djava.endorsed.dirs=../common/endorsed"
jsvc debug: | "-verbose"
jsvc debug: | Class Invoked: "org.apache.catalina.startup.Bootstrap"
jsvc debug: | Class Arguments: 2
jsvc debug: | "-security"
jsvc debug: | ""
jsvc debug: +-------------------------------------------------------
jsvc debug: user changed to 'tomcat'
jsvc debug: User 'tomcat' validated
jsvc debug: Home not specified on command line, using environment
jsvc debug: Attempting to locate Java Home in /usr/local/jdk
jsvc debug: Attempting to locate VM configuration file /usr/local/jdk/jre/lib/jvm.cfg
jsvc debug: Attempting to locate VM configuration file /usr/local/jdk/lib/jvm.cfg
jsvc debug: VM configuration file not found
jsvc debug: Attempting to locate VM library /usr/local/jdk/jre/lib/i386/classic/libjvm.so
jsvc debug: Attempting to locate VM library /usr/local/jdk/jre/lib/i386/client/libjvm.so
jsvc debug: Java Home located in /usr/local/jdk
jsvc debug: +-- DUMPING JAVA HOME STRUCTURE ------------------------
jsvc debug: | Java Home: "/usr/local/jdk"
jsvc debug: | Java VM Config.: "null"
jsvc debug: | Found JVMs: 1
jsvc debug: | JVM Name: "null"
jsvc debug: | "/usr/local/jdk/jre/lib/i386/client/libjvm.so"
jsvc debug: +-------------------------------------------------------
jsvc debug: Using default JVM in /usr/local/jdk/jre/lib/i386/client/libjvm.so
jsvc debug: Invoking w/ LD_LIBRARY_PATH=/usr/local/jdk/jre/lib/i386/client:/usr/local/jdk/jre/lib/i386
jsvc.exec debug: +-- DUMPING PARSED COMMAND LINE ARGUMENTS --------------
jsvc.exec debug: | Detach: True
jsvc.exec debug: | Show Version: No
jsvc.exec debug: | Show Help: No
jsvc.exec debug: | Check Only: Disabled
jsvc.exec debug: | Run as service: No
jsvc.exec debug: | Install service: No
jsvc.exec debug: | Remove service: No
jsvc.exec debug: | JVM Name: "null"
jsvc.exec debug: | Java Home: "null"
jsvc.exec debug: | PID File: "/var/run/jsvc.pid"
jsvc.exec debug: | User Name: "tomcat"
jsvc.exec debug: | Extra Options: 3
jsvc.exec debug: | "-Djava.class.path=./bootstrap.jar"
jsvc.exec debug: | "-Djava.endorsed.dirs=../common/endorsed"
jsvc.exec debug: | "-verbose"
jsvc.exec debug: | Class Invoked: "org.apache.catalina.startup.Bootstrap"
jsvc.exec debug: | Class Arguments: 2
jsvc.exec debug: | "-security"
jsvc.exec debug: | ""
jsvc.exec debug: +-------------------------------------------------------
jsvc.exec debug: user changed to 'tomcat'
jsvc.exec debug: User 'tomcat' validated
jsvc.exec debug: Home not specified on command line, using environment
jsvc.exec debug: Attempting to locate Java Home in /usr/local/jdk
jsvc.exec debug: Attempting to locate VM configuration file /usr/local/jdk/jre/lib/jvm.cfg
jsvc.exec debug: Attempting to locate VM configuration file /usr/local/jdk/lib/jvm.cfg
jsvc.exec debug: VM configuration file not found
jsvc.exec debug: Attempting to locate VM library /usr/local/jdk/jre/lib/i386/classic/libjvm.so
jsvc.exec debug: Attempting to locate VM library /usr/local/jdk/jre/lib/i386/client/libjvm.so
jsvc.exec debug: Java Home located in /usr/local/jdk
jsvc.exec debug: +-- DUMPING JAVA HOME STRUCTURE ------------------------
jsvc.exec debug: | Java Home: "/usr/local/jdk"
jsvc.exec debug: | Java VM Config.: "null"
jsvc.exec debug: | Found JVMs: 1
jsvc.exec debug: | JVM Name: "null"
jsvc.exec debug: | "/usr/local/jdk/jre/lib/i386/client/libjvm.so"
jsvc.exec debug: +-------------------------------------------------------
jsvc.exec debug: Running w/ LD_LIBRARY_PATH=/usr/local/jdk/jre/lib/i386/client:/usr/local/jdk/jre/lib/i386
jsvc.exec debug: redirecting stdout to ../logs/catalina.out and stderr to ../logs/catalina.err
[email protected] [/usr/local/jakarta/jakarta-tomcat-5.5.9/bin]#
Does this look like the install went okay?
 

meeven

Well-Known Member
May 8, 2007
132
2
168
I asked my web host if the install looked okay and they came back with this:

I believe that looks to be correct.

According to a netstat it looks like the port is open for tomcat though.

tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 7499/jsvc.exec

I think you should be good.
 
Last edited:

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,607
80
458
cPanel Access Level
Root Administrator
Yes, it looks like everything setup properly. Once you Install Servlets on an account/domain you can visit port 8080 on the domain and see the Tomcat page.
 

meeven

Well-Known Member
May 8, 2007
132
2
168
Once you Install Servlets on an account/domain you can visit port 8080 on the domain and see the Tomcat page.
Thanks. That's a relief:)

Bear with me but I have to ask the next dumb question. How/where do I install servlets on an account?

Thanks in advance.
 

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,607
80
458
cPanel Access Level
Root Administrator
A function should appear in WHM >> Account Functions named Install Servlets

Click that link, select the account/domain and apply the settings.
 

meeven

Well-Known Member
May 8, 2007
132
2
168
A function should appear in WHM >> Account Functions named Install Servlets

Click that link, select the account/domain and apply the settings.
Thanks. That helped :)

I know this isn't a cpanel support forum, but when I visit www.domain.com:8080 with or without the trailing slash, I get a timed out message. I restarted Apache but it didn't make a difference.
 
Last edited: