This section covers the fundamental concepts and steps to get started with Apache Tomcat. Learn how to set up, configure, and deploy web applications.
- Open the terminal and navigate to the
bin
directory of your Tomcat installation. - Run the startup script:
- Windows:
startup.bat
- Linux/Mac:
./startup.sh
- Windows:
- Navigate to the
bin
directory. - Run the shutdown script:
- Windows:
shutdown.bat
- Linux/Mac:
./shutdown.sh
- Windows:
- Open the
server.xml
file located in theconf
directory. - Locate the
<Connector>
element and change theport
attribute:
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
- Deploy a Pre-Built
.war
File - Download a sample
.war
file- Download the sample application Sample Web Application at https://tomcat.apache.org/tomcat-10.1-doc/appdev/sample/
- Deploy to Tomcat
- Copy the
.war
file into the webapps directory of your Tomcat installation. - Access the Application: Open a browser and navigate to http://localhost:8080/sample.
- Copy the