Install apache tomcat on raspberry pi

What you will learn here about apache tomcat on raspberry pi:

  • How to install apache tomcat on raspberry pi or How to install Application server on raspberry pi.
  • How to change apache tomcat port on raspberry pi

How to install Apache tomcat on raspberry pi

Please follow the following steps to install apache tomcat on raspberry pi.
1)First open the raspberry pi terminal.

2)Execute the following command to update existing packages.

sudo apt-get update

3)In order to install apache tomcat on raspberry, you need a JDK. So please execute the following command to install JDK on raspberry pi.

sudo apt-get install default-jdk

4)Now execute the following command to make tomcat folder.

mkdir tomcat
5)Execute the following command to go in tomcat folder.
cd tomcat

6)Execute the following command to download apache tomcat.

sudo wget http://mirrors.estointernet.in/apache/tomcat/tomcat-8/v8.5.47/bin/apache-tomcat-8.5.47.zip

IMPORTANT NOTE: You will get an error 404 not found when apache-tomcat-8.5.47.zip file is not available in above path. If you are getting 404 not found error then only follow this step. Right now available apache-tomcat-8.5.47 version is available in step 8 path. In future apache tomcat version may change. To know available apache tomcat version please open the following URL in any browser and follow following steps show image.

http://mirrors.estointernet.in/apache/tomcat/tomcat-8/

apache tomcat new version
If there is new version then replace copied path and execute the following command.

sudo wget paste copied path here

IMPORTANT NOTE: If there is new version available then please replace version name below in every step.

7)Downloaded apache tomcat is available in zip format. So to unzip it. First, we need to install unzip on raspberry pi. To install unzip on raspberry please execute the following command.

sudo apt-get install unzip

8)Execute the following command to unzip apache tomcat.

sudo unzip apache-tomcat-8.5.47.zip

9)Now execute the following command to navigate in the bin folder of apache tomcat.

cd apache-tomcat-8.5.47/bin/

10)Execute the follwoing command to make all .sh files as executeble.

sudo chmod 700 *.sh

11)Execute the following command to start apache tomcat

sudo ./startup.sh

12)Execute the following command to stop apache tomcat

sudo ./shutdown.sh

13)Now please open any browser on Raspberry pi.

14)Enter the following URL in browser and if you are able to see apache tomcat default page means apache tomcat is successfully installed on raspberry pi.

localhost:8080

apache tomcat default page on raspberry pi

How to Change apache port on raspberry pi

Please follow the following steps to modify the apache tomcat port on raspberry pi. Below we will see how to install apache tomcat on port 80 on raspberry pi.
1)Please open the raspberry pi terminal

2)Please navigate to conf folder of apache-tomcat-8.5.47

cd tomcat/apache-tomcat-8.5.47/conf/

3)Now execute the following command to edit server.xml file on raspberry pi

sudo nano server.xml

4)modify the connector port to 80 which is shown below
modify apache tomcat port on raspberry pi
5)Now press the Ctrl+ X and please press y and hit enter to save the changes.

6)Now execute the following command to go in bin folder of apache tomcat.

cd ..
cd bin

7)Now please execute the following command to stop the apache tomcat.

sudo ./shutdown.sh

8)Now please execute the following command to start the apache tomcat.

sudo ./startup.sh

9)Now please open any browser on raspberry pi

10)Enter the following URL in browser and if you are able to see apache tomcat default page means apache tomcat is successfully installed on raspberry pi.

localhost

apache tomcat default page on raspberry pi

You may also like...

Leave a Reply