Pages

Subscribe:

Wednesday, April 9, 2014

Tomcat Installation

As a pre-requisite for the installation of Tomcat , you need to have Java installed. Check my previous post for the detailed instruction for  the Java Installation and setting up the necessary environment variables for the Java to work.

  • Download the Tomcat Installation file
 [[email protected] tomcat]# mkdir -p /usr/tomcat  
 [[email protected] tomcat]# cd /usr/tomcat/  
 [email protected] tmp]# wget https://archive.apache.org/dist/tomcat/tomcat-7/v7.0.39/bin/apache-tomcat-7.0.39.tar.gz  
 --2014-04-01 01:32:13-- https://archive.apache.org/dist/tomcat/tomcat-7/v7.0.39/bin/apache-tomcat-7.0.39.tar.gz  
 Resolving archive.apache.org... 192.87.106.229, 140.211.11.131, 2001:610:1:80bc:192:87:106:229  
 Connecting to archive.apache.org|192.87.106.229|:80... connected.  
 HTTP request sent, awaiting response... 200 OK  
 Length: 7831716 (7.5M) [application/x-gzip]  
 Saving to: `apache-tomcat-7.0.39.tar.gz'  
 100%[===================================================================================================================================================================================================>] 7,831,716  86.6K/s  in 79s    
 2014-04-01 01:33:33 (97.3 KB/s) - `apache-tomcat-7.0.39.tar.gz' saved [7831716/7831716]  
 [[email protected] tmp]# du -sh apache-tomcat-7.0.39.tar.gz  
 7.5M  apache-tomcat-7.0.39.tar.gz  


  • Extract the tar file to install the  Tomcat 
 [[email protected] tomcat]# tar -zxvf /tmp/apache-tomcat-7.0.39.tar.gz   
  [[email protected] java]# cd /usr/tomcat/apache-tomcat-7.0.39/bin   
  [[email protected] bin]# ls -ltr   
  total 796   
  -rw-r--r-- 1 root root 28615 Mar 22 2013 bootstrap.jar   
  -rw-r--r-- 1 root root 13217 Mar 22 2013 catalina.bat   
  -rwxr-xr-x 1 root root 19276 Mar 22 2013 catalina.sh   
  -rw-r--r-- 1 root root 2121 Mar 22 2013 catalina-tasks.xml   
  -rw-r--r-- 1 root root 24281 Mar 22 2013 commons-daemon.jar   
  -rw-r--r-- 1 root root 202451 Mar 22 2013 commons-daemon-native.tar.gz   
  -rw-r--r-- 1 root root 2131 Mar 22 2013 configtest.bat   
  -rwxr-xr-x 1 root root 1982 Mar 22 2013 configtest.sh   
  -rw-r--r-- 1 root root 1342 Mar 22 2013 cpappend.bat   
  -rwxr-xr-x 1 root root 7492 Mar 22 2013 daemon.sh   
  -rw-r--r-- 1 root root 2178 Mar 22 2013 digest.bat   
  -rwxr-xr-x 1 root root 2021 Mar 22 2013 digest.sh   
  -rw-r--r-- 1 root root 3264 Mar 22 2013 setclasspath.bat   
  -rwxr-xr-x 1 root root 3524 Mar 22 2013 setclasspath.sh   
  -rw-r--r-- 1 root root 2111 Mar 22 2013 shutdown.bat   
  -rwxr-xr-x 1 root root 1960 Mar 22 2013 shutdown.sh   
  -rw-r--r-- 1 root root 2112 Mar 22 2013 startup.bat   
  -rwxr-xr-x 1 root root 1961 Mar 22 2013 startup.sh   
  -rw-r--r-- 1 root root 38161 Mar 22 2013 tomcat-juli.jar   
  -rw-r--r-- 1 root root 288166 Mar 22 2013 tomcat-native.tar.gz   
  -rw-r--r-- 1 root root 4114 Mar 22 2013 tool-wrapper.bat   
  -rwxr-xr-x 1 root root 5086 Mar 22 2013 tool-wrapper.sh   
  -rw-r--r-- 1 root root 2116 Mar 22 2013 version.bat   
  -rwxr-xr-x 1 root root 1965 Mar 22 2013 version.sh   
  [[email protected] bin]# ./startup.sh   
  Using CATALINA_BASE: /usr/tomcat/apache-tomcat-7.0.39   
  Using CATALINA_HOME: /usr/tomcat/apache-tomcat-7.0.39   
  Using CATALINA_TMPDIR: /usr/tomcat/apache-tomcat-7.0.39/temp   
  Using JRE_HOME:  /usr   
  Using CLASSPATH:  /usr/tomcat/apache-tomcat-7.0.39/bin/bootstrap.jar:/usr/tomcat/apache-tomcat-7.0.39/bin/tomcat-juli.jar   
  [[email protected] bin]# ps -ef | grep tomcat   
  root  2145  1 9 05:35 pts/1 00:00:02 /usr/bin/java -Djava.util.logging.config.file=/usr/tomcat/apache-tomcat-7.0.39/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/usr/tomcat/apache-tomcat-7.0.39/endorsed -classpath /usr/tomcat/apache-tomcat-7.0.39/bin/bootstrap.jar:/usr/tomcat/apache-tomcat-7.0.39/bin/tomcat-juli.jar -Dcatalina.base=/usr/tomcat/apache-tomcat-7.0.39 -Dcatalina.home=/usr/tomcat/apache-tomcat-7.0.39 -Djava.io.tmpdir=/usr/tomcat/apache-tomcat-7.0.39/temp org.apache.catalina.startup.Bootstrap start   

    Next we will discussing the linking of the tomcat with the Apache with native connectors.

    Tomcat Installation

    As a pre-requisite for the installation of Tomcat , you need to have Java installed. Check my previous post for the detailed instruction for  the Java Installation and setting up the necessary environment variables for the Java to work.

    • Download the Tomcat Installation file
     [[email protected] tomcat]# mkdir -p /usr/tomcat  
     [[email protected] tomcat]# cd /usr/tomcat/  
     [email protected] tmp]# wget http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.39/bin/apache-tomcat-7.0.39.tar.gz  
     --2014-04-01 01:32:13-- http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.39/bin/apache-tomcat-7.0.39.tar.gz  
     Resolving archive.apache.org... 192.87.106.229, 140.211.11.131, 2001:610:1:80bc:192:87:106:229  
     Connecting to archive.apache.org|192.87.106.229|:80... connected.  
     HTTP request sent, awaiting response... 200 OK  
     Length: 7831716 (7.5M) [application/x-gzip]  
     Saving to: `apache-tomcat-7.0.39.tar.gz'  
     100%[===================================================================================================================================================================================================>] 7,831,716  86.6K/s  in 79s    
     2014-04-01 01:33:33 (97.3 KB/s) - `apache-tomcat-7.0.39.tar.gz' saved [7831716/7831716]  
     [[email protected] tmp]# du -sh apache-tomcat-7.0.39.tar.gz  
     7.5M  apache-tomcat-7.0.39.tar.gz  


    Java Installation on Linux

    Java can be installed on Linux as

    • Download Java ( JDK 6 Update 24
     https://www.oracle.com/technetwork/java/javase/downloads/java-se-6u24-download-338091.html   


    • Creating a Directory for the Java Installation file
     [[email protected] Desktop]# mkdir -p /usr/java  
     [[email protected] Desktop]# cd /usr/java/  
     [[email protected] java]# du -sh jdk-6u24-linux-i586.bin  
     82M   jdk-6u24-linux-i586.bin  
     [[email protected] java]# chmod 777 jdk-6u24-linux-i586.bin  
     [[email protected] java]# ls -ltr jdk-6u24-linux-i586.bin  
     -rwxrwxrwx 1 ankit ankit 84927175 Apr 1 01:18 jdk-6u24-linux-i586.bin  


    • Installing the Java 
     [[email protected] java]# ./jdk-6u24-linux-i586.bin  
     [[email protected] Desktop]# ln -s /usr/java/jdk1.6.0_24/bin/java /usr/bin/java   

    • Finally check the version of the Java as
     [[email protected] bin]# java -version  
     java version "1.6.0_24"  
     Java(TM) SE Runtime Environment (build 1.6.0_24-b07)  
     Java HotSpot(TM) Client VM (build 19.1-b02, mixed mode, sharing)  

    Java Installation on Linux

    Java can be installed on Linux as

    • Download Java ( JDK 6 Update 24
     http://www.oracle.com/technetwork/java/javase/downloads/java-se-6u24-download-338091.html   


    • Creating a Directory for the Java Installation file
     [[email protected] Desktop]# mkdir -p /usr/java  
     [[email protected] Desktop]# cd /usr/java/  
     [[email protected] java]# du -sh jdk-6u24-linux-i586.bin  
     82M   jdk-6u24-linux-i586.bin  
     [[email protected] java]# chmod 777 jdk-6u24-linux-i586.bin  
     [[email protected] java]# ls -ltr jdk-6u24-linux-i586.bin  
     -rwxrwxrwx 1 ankit ankit 84927175 Apr 1 01:18 jdk-6u24-linux-i586.bin  


    Tuesday, April 1, 2014

    Source Installation of Apache

    For the source installation the Apache web server following  are the steps:-

    1. Download  the Apache Web Server as
     # wget http://archive.apache.org/dist/httpd/httpd-2.2.24.tar.gz  

    2. Extract the compressed file as
    [[email protected] ~]# tar -zxvf httpd-2.2.24.tar.gz

    3. Run the configuration file as

     cd /tmp/httpd/httpd-2.2.24   

     ./configure --enable-so --enable-expires --enable-file-cache --enable-cache --enable-disk-cache --enable-mem-cache --enable-headers --enable-ssl --enable-http --disable-userdir --enable-rewrite --enable-deflate --enable-proxy --enable-proxy-connect --enable-proxy-ftp --enable-proxy-http --enable-proxy-ajp --enable-proxy-balancer --enable-cgi --disable-dbd --enable-modules=most --with-mpm=worker --prefix=/usr/local/apache2  

    configure:- It is the configuration for httpd
    --enable  :-  Used for installing the specific modules to be used by Apache. If not used the Apache will be installed with all the modules.
    --prefix    :- specifies the location for the installation of the Apache

    4. Try the configuration and check for any reported errors here
     make