Learning Horizon | For Learners

ASP.NET, SQL SERVER, JQUERY,JAVASCRIPT, WEBSPHERE

Thursday, 25 April 2019

How To Install Apache Tomcat On Linux System Offline

In this tutorial we will learn about how to install Apache Tomcat on Linux machine without internet. In many organizations internet access to system is not allowed due to security purposes or it requires approval from your management to get internet access which is time consuming. So, this tutorial is for all of you folks who don’t want to pass above hectic process. In my case I have windows machine (also called a host machine) on which I’ve made a RedHat Enterprise Linux 7 virtual machine (also called a guest machine) for practical purpose and going to install Apache Tomcat.

Pre-Requisite: -

  1. Make sure you have Java SE 7 or 8 installed on your Linux machine because it is mandatory for Apache Tomcat. To check if you already have JAVA installed on your Linux machine please use below command.
    java -version

    If you don’t have JAVA installed on Linux machine, please see my post on this topic.

Procedure: -

  1. Go to Apache Tomcat official download page and download tar.gz file. If you have internet allowed on your Linux machine, then use wget command to download it directly on Linux machine.

    apache-tomcat-official-page
  2. After downloading the above package, you can use FileZilla or WinSCP or Xftp to upload the package on Linux machine. Since I am using Xshell so there is a built-in Xftp for file uploading. I’ve uploaded the file on /home directory.

    home-directory-path
  3. Type below mentioned command on terminal to extract tomcat folder from tar.gz file.
    tar xzf i.e. tar xzf apache-tomcat-7.0.94

  4. Move the extracted tomcat folder to /usr/local/ directory with the help of below command.
    mv apache-tomcat-7.0.94 /usr/local/tomcat

  5. Now it’s time to start the Tomcat server. So Just go to /usr/local/tomcat/bin/ directory and use below command.
    cd /usr/local/tomcat/bin/
    ./startup.sh

  6. To access Tomcat, open your browser and type below link. By default, 8080 is the port for Apache Tomcat server.
    http://localhost:8080 or http://computer_name:8080 or http://computer_ip :8080

    tomcat-default-page
  7. In the end we need to create user (modify this file /usr/local/tomcat/conf/tomcat-users.xml) to secure and access manager pages. In my case I have created only a “tomcat” user with role “manager-gui” who can only access manager section. You can create user with multiple role as well.

    tomcat-user
  8. To stop Tomcat server, you can use below command.
    cd /usr/local/tomcat/bin
    ./shutdown.sh

No comments:

Post a Comment

Please do not enter spam links.