Open In App

How to Start Tomcat Server ?

Tomcat is a free and open-source web server. It was developed at Sun Microsystems (an American technology company, currently acquired by Oracle). Tomcat is the implementation of Java EE (Java Enterprise Edition) in the newer version of Jakarta Package (Jakarta EE). It supports Jakarta Servlet, Jakarta Server Page, Jakarta Expression Languages, Jakarta WebSockets, etc. It provides a “JAVA HTTP” web server.

History About Tomact

How to Install Apache Tomcat and Setup the Environment

Pre-requisite:

Steps To Start Tomcat Server In Windows

Step 1: First, you have to download the Windows Service Installer from their official website using the Windows Tomcat Binary Distribution.



Step 2: In the Screen we can see



Tomcat installation

Step 3: You need to click on next button.

Agree Installation

Step 4: Then agreed for installation.

Step 5: Then next -> next-> Finish.

Finish Installation

Step 6: Now Your server is running on port “http://localhost/8080″.

http://localhost:8080

Restart or Running of Tomact Server

If you want to stop the server then you need to go to the folder name “Program Files” like in my system “C:\Program Files\Apache Software Foundation” >> “C:\Program Files\Apache Software Foundation\Tomcat 9.0\bin”.

Step 1: Then go inside bin folder

bin folder

Step 2: Right click on Tomcat9w and then click on stop and similar you can again re-start from here.

start-stop server

How to install Tomcat Server on Linux

Step 1: Install Java (if not already installed)

sudo apt update

Step 2: Install the default JDK (Java Development Kit)

sudo apt install default-jdk

Step 3: Verify the Java installation

java -version

JDK Installation

Setting up a Tomcat User

Step 1: Create a new user

sudo useradd -r -m -U -d /opt/tomcat -s /bin/false tomcat

Step 2: Downloading the Tomcat package

wget -c https://downloads.apache.org/tomcat/tomcat-9/v9.0.87/bin/apache-tomcat-9.0.87.tar.gz

Step 3: After the downloading extract the file

sudo tar xf apache-tomcat-9.0.87.tar.gz -C /opt/tomcat

Step 4: Change directory

cd  /opt/tomcat
ls -ls

Installation

Steps To Change The Bin Directory

Step 1: Change to root user

sudo su

Step 2: Change directory

cd /opt/tomcat/apache-tomcat-9.0.87/bin/

Step 3: Start Tomcat using either of the following commands

sh startup.sh
OR
./startup.sh

Step 4: Open browser, now server is running on

http://localhost:8080/

Server at localhost

Step 5: For stop running server

./shutdown.sh

Stop Server

Advantages Of Apache Tomcat

Disadvantages Of Apache Tomcat

Applications

Start Tomcat Server – FAQ’s

What is a connector in Apache Tomcat?

A connector in Apache Tomcat is a component that enables communication between the web server and clients, Handling incoming requests and sending responses. It bridges various protocols like HTTP.

How do I start my tomcat server?

To start your Tomcat server, navigate to the Tomcat installation directory and run the command ./bin/startup.sh.

How to run Tomcat server using Java?

You can run Tomcat server programmatically in Java by instantiating org.apache.catalina.startup.Tomcat and calling its start() method.

How do I restart Tomcat server in Linux?

You can restart the Tomcat server in Linux by running the command sudo systemctl restart tomcat. Alternatively, you can use service tomcat restart.


Article Tags :