Saturday, 25 May 2013

Installing tomcat in linux


Welcome Folks.. This post will guide you in the installation and configuration of the apache tomcat server

In order to work with the tomcat server, you need to have the Java environment set, if you haven't done it yet then follow this post


Installation and configuration of the apache tomcat server

Steps to download and install the tomcat server

Step 1 : Download the tomcat sever from http://tomcat.apache.org/ .
             Once downloaded, you should have a folder named 

                                           apache-tomcat-6.0.29.tar.gz (similar to this).

Step 2 : Extract the folder you just downloaded by using the below command
                                          
                                           tar -xvfz apache-tomcat-6.0.29.tar.gz

Step 3 :  Now the next step is to set up the paths for catalina as below

export CATALINA_HOME=/location where you have extracted the tomcat

 ex : export CATALINA_HOME = /home/vignesh/Desktop/apache-tomcat-7.0.37

 Add the following lines to your /etc/profile file so that it can set the CATALINA_HOME variable automatically when the system restarts.

profile 

Step 4 : Run the following command to start the Tomcat server: 
      
                        $CATALINA_HOME/bin/startup.sh 

Step 5 : Verify that the Tomcat server is running by browsing to

                        http://Your_IP_Here:8080/

        ex : http://localhost:8080 on doing this, you should see something like below

APACHE, catalina, configuring apache tomcat server, Installing tomcat in linux, java environment, jsp, server, tomcat, webapps,
 

Congratulations you have now installed the TOMCAT SERVER successfully !!!

let us have a check by running a simple program


1. Type the below given program in the text file

                         <HTML>
                                <BODY>
                                        Hello Developer !!!
                                </BODY>
                         </HTML>

2. Save the file with .jsp extension in the below path where all your .class and .jsp files should be  
    present

                           /apache-tomcat-7.0.37/webapps/ROOT/

3. In order to execute the program, you need to start your tomcat server, its so simple 
 
- open your terminal and traverse to the bin folder in tomcat which you had downloaded by 
following this post
 
- type ./catalina.sh start and ./catalina.sh stop to stop the server
  
Example:root@localhost:/home/vignesh/Desktop/apache-tomcat-7.0.37/bin# ./catalina.sh start
 
Note: Once you have started the catalina server, you can verify it by typing  
 
http://localhost:8080 on the address bar of your browser.Tats it !!!!! 
 
4 . Now from the browser open the file you just created . 

    Example : http://localhost/apachetesting.jsp

    You should see the text Hello Developer on your browser.




Leave your doubts or suggestions in comments section..

No comments:

Post a Comment