Tomcat Installation on Linux

Download tar file: wget

copy tar to folder optional softwares location

tar zvfx <downloaded tomcat file>.tar.gz

User permissions

  • groupadd tomcat
  • useradd -r -g tomcat tomcat
  • cd tomcat
  • chown -R tomcat .
  • chgrp -R tomcat .

Opening tomcat port

  1. sudo ufw allow port_number
  2. sudo ufw enable

Refer here for more info.

In case of using IP Tables command

  • sudo iptables -nvL
  • sudo iptables
  • netstat
  • netstat -l
  • sockstat -l
  • netstat -lntu
  • sudo iptables -A INPUT -p tcp –dport <PORT> -j ACCEPT
  • sudo iptables -A INPUT -p tcp –dport <PORT> -j ACCEPT

Error Note

In case of errors on shared object:

Set the path to the .so files in the lib folder

# set path to system so library files

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/lib/:/usr/lib/

In case of library errors for the below given libraries

sudo apt-get install libxrender1 libxtst6 libxi6

(apt-get install libxrender1:i386 libxtst6:i386 libxi6:i386)

Production Server Settings

INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib

To fix the above error follow the steps [[1]].

In summary run the below command:

apt-get install libapr1-dev libssl-dev

In case libapr library is not found can search for it by using the command: sudo apt-cache search libapr

Related Post

Leave a Reply

Your email address will not be published. Required fields are marked *