Troubleshooting Steps Of Tomcat Server

0 comments

Troubleshooting Steps to check whether the Tomcat server is runing or not?

Step1 : Check ps command output

#ps -ef | grep tomcat

Step2 : Check with nmap whether port 8080 is opened or not?

#nmap localhost

Step3 : Check with telnet command as shown in below by executing GET / HTTP/1.0 Host: localhost command once logged in to server at 8080 port.

#telnet localhost 8080 Trying 127.0.0.1... Connected to localhost.localdomain (127.0.0.1). Escape character is '^]'. GET / HTTP/1.0 Host: localhost

This command should output hte test tomcat page.

Enjoy the troubleshooting:)

  • Like the post? Please Subscribe to free RSS feed to get updates
  • How To Install Apache Tomcat on Linux(Redhat/Ubuntu)?

    1 comments

    How to install Apache tomcat on Linux(Redhat/Ubuntu)?

    What is Apache tomcat?
    Ans : ApacheTomcat is an open source web application server which supports J2ee Servlets, JavaServer, Pages(JSP) and API's. Tomcat should not be confused with Apache web server which an HTTP web server.
    ---Wikipedia.

    Some terminology about Apache tomcat.

    Apache Tomcat can be configured by editing server.xml file. Those who knows apache web server. This server.xml can be taken as synonimas to httpd.conf file.

    Servlet is defined as a way add dynamic content to a Web server using the Java platform. And a servlet container is a compiled, executable program. The servlet container name is tomcat is catalina.

    Pre requists for Apache tomcat are
    1. java
    2. JDK

    Step by step for installing Apache tomcat

    Note : Avoide installing tomcat from reposatories, always prefer to install it from source downloaded from apache site.

    Step1 : Install all the prequistes

    Redhat :

    #yum install java

    Ubuntu :

    #apt-get install java

    Step2 : Download tomcat source package and uncompress it.
    Redhat/Ubuntu
    #cd /opt
    #wget http://www.trieuvan.com/apache/tomcat/tomcat-6/v6.0.29/bin/apache-tomcat-6.0.29.tar.gz
    #tar xvfz apache-tomcat-6.0.29.tar.gz

    Step3 : Setup the paths for Catalina and others.
    Setting catalina paths

    Redhat/ubuntu

    CATALINA_HOME=/opt/apache-tomcat-6.0.29
    CATALINA_BASE=/opt/apache-tomcat-6.0.29

    Setting java paths

    Check what java versions are installed in your system

    #update-alternatives --config java


    This command will display which is default java version used by your machine.

    Example output :

    # update-alternatives --config java

    There are 2 programs which provide 'java'.

    Selection Command
    -----------------------------------------------
    1
    /usr/lib/jvm/jre-1.4.2-gcj/bin/java
    *+ 2
    /usr/lib/jvm/jre-1.6.0-openjdk/bin/java

    Enter to keep the current selection[+], or type selection number:

    If you see above the default java version is 1.6 so set the path to /usr/lib/jvm/jre-1.6.0-openjdk

    JAVA_HOME=/usr/lib/jvm/jre-1.6.0-openjdk
    JDK_HOMe=$JAVA_HOME

    Step4 : Now start tomcat server

    #/opt/apache-tomcat-6.0.29/bin/sartup.sh

    Sample output.

    Using CATALINA_BASE: /opt/apache-tomcat-5.5.26

    Using CATALINA_HOME: /opt/apache-tomcat-5.5.26
    Using CATALINA_TMPDIR: /opt/apache-tomcat-5.5.26/temp
    Using JRE_HOME:
    /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/

    Step5 : By default Apache Tomcat will be hosted onlocalhost : 8080 port by default. So try to access the site with web browser

    http://localhost:8080
    or
    http://localhost:8080
    or
    http://systemname:8080

    Stay tuned to other posts about troubleshooting tomcat installation.

  • Like the post? Please Subscribe to free RSS feed to get updates
  • How To Set Java Path In Linux?

    0 comments

    How to set java path in Linux?

    Ans : Check where java is installed by using below command

    #update-alternatives --config java
    This command will show installed java packages in your machine.

    Example output :
    # update-alternatives --config java

    There are 2 programs which provide 'java'.

    Selection ----------------------------------------------- 1 /usr/lib/jvm/jre-1.4.2-gcj/bin/java *+ 2
    From above you can see java version in use it. 1.6.

    Setting java path(In Temporary way)

    #JAVA_HOME=/usr/lib/jvm/jre-1.6.0-openjdk #export $JAVA_HOME

    Setting java path (In Permanent way)
    Edit ~/.bashrc and place below two lines in that file and save the file.

    Vi ~/.bashrc
    JAVA_HOME=/usr/lib/jvm/jre-1.6.0-openjdk export $JAVA_HOME

    Now save the file and exit, then logout and login to make those changes to reflect.

    Command

    /usr/lib/jvm/jre-1.6.0-openjdk/bin/java

  • Like the post? Please Subscribe to free RSS feed to get updates
  • How to Set Priority for a service at booting of Linux

    0 comments

    This is possible with renaming of the scripts located in running configuration(rc) folders. As you people know that
    all the startup scripts are stored in rc1.d, rc2.d etc... each of these folders corresponding to scripts to be started in that run-level 

    for example.. if you want to start some script in runlevel 1 they are kept in /etc/rc1.d folder so that when Linux is booting up these scripts are executed at runlevel 1.


    So how can i set priority to my scripts/services?
    Just go in to one of the rc folders, you can see all the scripts which are started in that runlevel.. 
    if you observe those scripts, these scripts will start with different numbers. here are some for your reference.

    K09apache2
    K15pulseaudio
    K20acpi-support
    K20kerneloops
    K20saned
    K20speech-dispatcher
    K20virtualbox-ose
    K20virtualbox-ose-guest-utils
    K74bluetooth
    README
    S30killprocs
    S70dns-clean
    S70pppd-dns
    S90single


    so the script(services) start sequence will be like K09apache2 then K15pulseaudio so on.. so if you want to give priority to your service just name with less number.. as shown below..



    K09apache2
    K01pulseaudio
    K20acpi-support
    K20kerneloops
    K20saned
    K20speech-dispatcher
    K20virtualbox-ose
    K20virtualbox-ose-guest-utils
    K74bluetooth
    README
    S30killprocs
    S70dns-clean
    S70pppd-dns
    S90single



    So now the first script/service which start in this list is K01pulseaudio


    Please comment your thoughts on this..

  • Like the post? Please Subscribe to free RSS feed to get updates
  • How To Change The Java Version In Linux?

    0 comments

    This post is regarding how to change java version if multiple java versions are installed?


    Check what are the java versions are installed on your system


    #java -version


    Example output

    OpenJDK Runtime Environment (build 1.6.0-b09)

    OpenJDK Client VM (build 1.6.0-b09, mixed mode)


    So now I want to change the one version to another version.

    If more than one java is installed. Execute below command to see how many java versions are installed? And what is the default version (Default version will be indicated by *)



    #update-alternatives --config java



    This command will display which is default java version used by your machine..

    Example output.

    # update-alternatives --config java


    There are 2 programs which provided 'java'.


    Selection Command


    -----------------------------------------------


    1. /usr/lib/jvm/jre-1.4.2-gcj/bin/java


    *+ 2 /usr/lib/jvm/jre-1.6.0-openjdk/bin/java


    Enter to keep the current selection[+], or type selection number:


    So if you want to change the java version from 1.6 (now 2 is default version as shown) to 1.4 just press “1 with out quotes.

    Please let us know if you know other way of changing java version.

  • Like the post? Please Subscribe to free RSS feed to get updates
  • Archive

    Translate this page

     

    The Linux Juggernaut | Copyright 2006-2009 Surendra Kumar Anne | Surendra's Home Page | Give us feedback how we are doing, Click here