Operation Sheet/Job Sheet/Lab Sheet
Technology/course /trade: CIT Duration: 3 Years 1st/2nd/3rd: 3rd Year
Title of subject and code: Web Development with JAVA, CIT-303
Practical No: 03
Practical: Deploy simple website in Apache Tomcat Server
Name of Instructor: Sana Parveen
Technology: Computer Information Technology Year: 2025-2026
Specific Objectives: At the end of this practical a student will be able to
The process of deploying a simple static website to an Apache Tomcat server.
To understand how to package a web application and make it accessible on the server.
Introduction, Preparation, Motivation:
Deploying a website is the process of making it available on a web server so users can access it. Tomcat can
host static websites (HTML, CSS, and JavaScript) as well as dynamic Java web applications. This practical will
focus on the simpler static deployment.
Machines/Equipment/Tools/Material
Computer System: A PC or laptop with a modern operating system.
Apache Tomcat Server: A working installation of Apache Tomcat.
Simple Website Files: A folder containing a basic website, including an index.html file, CSS, and JavaScript.
Safety Precautions:
Do not place your web application files directly in the bin or conf directories of the Tomcat server, as this can
lead to security vulnerabilities. Always deploy your applications in the designated webapps directory
Procedure/Method
The practical is broken down into the following steps
STEPS
Key Points
Step 1: Register Tomcat Server in NetBeans Visit the official NetBeans
download page.
1.1. Open In NetBeans, navigate to the Services tab (usually on Choose the version of
Services Tab the left side, next to Projects and Files). NetBeans that suits your
1.2. Add needs. Select the version that
Right-click the Servers node and select Add Server. includes support for the
Server
technologies you want (e.g.,
1.3. Select Select Apache Tomcat or TomEE from the list, Java, PHP, HTML5, etc.).
Server Type then click Next.
Enter the Server Location (the root directory of Download the installer for your
1.4. Specify operating system (Windows,
your Tomcat installation, e.g., C:\apache-tomcat-
Location macOS, or Linux).
9.0.x).
Enter a Username and Password. These credentials
must match a user defined in Tomcat's
1.5. Add
conf/tomcat-users.xml file with the manager-
Credentials
script role for the IDE to successfully deploy
applications. Click Finish.
Step 2: Create a Web Application Project
2.1. New Go to File > New Project... (or press
Project: Ctrl+Shift+N).
2.2. Select Under Categories, select Java Web. Under Projects,
Template: select Web Application, then click Next.
2.3. Name
Give your project a name (e.g., CIT303_SimpleWeb)
and
and choose a location, then click Next.
Location:
On the Server and Settings panel: — Ensure the
Server dropdown is set to the Apache Tomcat
2.4. Select
instance you just registered. — Note the Context
Server:
Path (e.g., /CIT303_SimpleWeb), which is how you
will access the app. Click Finish.
Step 3: Deploy and Run the Application
NetBeans automatically creates an index.html or
3.1. Verify index.jsp file in the Web Pages folder. Add simple
Index Page content to it (e.g., a heading: <h1>Deployment
Successful via NetBeans!</h1>).
Right-click the project name in the Projects window
3.2. Run the
and select Run. OR Click the green Run Project
Project
button (▶) in the main toolbar.
The IDE will automatically: 1. Build and compile the
project. 2. Start the Apache Tomcat server (if not
3.3. Verify already running). 3. Deploy the compiled application
Deployment (as a .WAR file). 4. Launch your default web browser
to the application's URL (e.g.,
http://localhost:8080/CIT303_SimpleWeb/).
Application & Try out:
Practice deploying another simple website with a different name. After deployment, try to access the website in
your browser using the new context path (the folder name).
Testing & Follow up:
Practice the deployment process multiple times. In your notebook, document the steps you took to deploy
your websites and how you accessed them.