-   Linux - Server (
-   -   how to install java and tomcat to CentOS release 5.4 (

anjanbacchu 06-08-2010 05:14 AM

how to install java and tomcat to CentOS release 5.4
hi there,


I'm a mid-level user on linux desktop but a noob admin on CentOS Server. Haven't installed much stuff -- Thanks in advance for helping.

Got a godaddy Virtual Dedicated Server(VDS), which is a VPS that runs CentOS release 5.4.

It already has java 6.0(OpenJDK) installed in /usr/bin/java. I would like to upgrade or install another version of java (sun's JDK 6.0_20) and apache tomcat 6.0.26 application server ( I don't mind using OpenJDK but I prefer Sun's JDK since it's more stable and works better.

I have ssh access to this CentOS server. Can someone help me
a) download sun's JDK (
b) download tomcat for linux (
c) install java
d) install tomcat

Once I do that I'd like tomcat to run as a daemon. From previous experience, I know that we create a script in /etc/init or /etc/init.d/ directory. This script helps in starting/stopping and restarting tomcat.

Also, how do I get and install midnight commander (the file manager) ?

I'll be glad to help you help me,

Thank you so much,


anjanbacchu 06-08-2010 05:30 AM

downloaded sun's java but have trouble installing it
hi all,

thanks for your responses.

I went ahead and downloaded java and tomcat using following commands
a) wget
b) wget

After downloading the above, I started installing java.

$ chmod +x jdk-6u20-linux-i586-rpm.bin
$ ./jdk-6u20-linux-i586-rpm.bin

UnZipSFX 5.50 of 17 February 2002, by Info-ZIP (
inflating: jdk-6u20-linux-i586.rpm
inflating: sun-javadb-common-10.5.3-0.2.i386.rpm
inflating: sun-javadb-core-10.5.3-0.2.i386.rpm
inflating: sun-javadb-client-10.5.3-0.2.i386.rpm
inflating: sun-javadb-demo-10.5.3-0.2.i386.rpm
inflating: sun-javadb-docs-10.5.3-0.2.i386.rpm
inflating: sun-javadb-javadoc-10.5.3-0.2.i386.rpm
error: can't create transaction lock on /var/lib/rpm/__db.000
Installing JavaDB
error: can't create transaction lock on /var/lib/rpm/__db.000

[temp]$ sudo ./jdk-6u20-linux-i586-rpm.bin

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.

vhosting is not in the sudoers file. This incident will be reported.
audit_log_user_command(): Connection refused
[ temp]$

What did I do wrong ? How do I go about installing Java (and tomcat) ?

thank you,


knudfl 06-08-2010 07:22 AM

No 'sudo' by default on CentOS ? Unless you set it up.

The most easy way to install Sun java jdk on CentOS 5.4 :
Use the "all in one" rpm package :
>>> jdk-1.6.0_20-fcs.i586.rpm
.. Then everything will usually be configured automatically.

Install with : 1) su
2) rpm -Uvh jdk-1.6.0_20-fcs.i586.rpm

You can of course use the packages, you already unpacked,
but you will then have to manually configure the links.
> Post #2.

Tomcat , probably ..
# yum install tomcat5 tomcat5-jsp tomcat5-servlet
And # yum search tomcat
.. to see all available tomcat packages.
.. And welcome to LQ. .. .. :)

anjanbacchu 06-11-2010 04:49 AM

that works!
knudfl : thank you. that works.

yum and apg-get : I am learning to use them regularly.


vikas027 06-11-2010 09:21 AM

See this

All times are GMT -5. The time now is 07:14 AM.