Topics in this sectionHosting and publishing websites2 topics
- Setting up web servers
- Deploying website
A web server is a computer program that stores website files and delivers them to users over the internet. In this topic, you will learn about different types of web servers and how to set up a basic local web server on your computer for testing websites.
A web server is software that listens for requests from web browsers and sends back the requested web pages. When you type a website address in your browser, the browser sends a request to the web server hosting that site. The server then finds the requested files (like HTML, images, or CSS) and sends them back to your browser to display.
Web servers can be:
- Remote servers — computers hosted on the internet that serve websites to people worldwide
- Local servers — servers running on your own computer for testing websites before publishing them online
There are many web server programs, but the two most common are:
Apache HTTP Server
- One of the most popular web servers in the world
- Free and open-source
- Works well on Windows, Linux, and macOS
- Very flexible and supports many features
Nginx
- Known for high performance and handling many simultaneous connections
- Also free and open-source
- Lightweight and uses less memory
- Often used for busy websites
Both Apache and Nginx can be installed on your computer to create a local testing environment.
Follow these steps to install and configure a basic local web server using XAMPP (a package that includes Apache and makes installation easy on Windows).
Step 1: Download XAMPP
- Open a web browser on your computer
- Visit the official XAMPP website (apachefriends.org)
- Download the Windows version of XAMPP
Step 2: Install XAMPP
- Run the downloaded installer
- Choose your preferred language (English)
- Click "Next" through the installation wizard
- When asked which components to install, keep Apache selected
- Choose a folder for installation (the default is usually fine)
- Complete the installation
Step 3: Start the Apache Server
- Open the XAMPP Control Panel
- Click the "Start" button next to Apache
- Wait for the status to turn green, meaning Apache is running
Step 4: Test Your Local Server
- Open your web browser
- Type
http://localhostorhttp://127.0.0.1in the address bar - If you see the XAMPP welcome page, your server is working correctly
To serve your own website files on the local server:
- Locate the htdocs folder in your XAMPP installation directory (usually found in
C:\xampp\htdocs) - Create a new folder inside htdocs, for example
mywebsite - Place your HTML files inside that folder
- Open your browser and type
http://localhost/mywebsite/filename.html
In Tanzania, small businesses and youth entrepreneurs can use local web servers to practice building and testing websites before paying for internet hosting. For example, a student in Dar es Salaam learning web design can create a portfolio site for a local shop owner in Kariakoo, test it locally using Apache, and then publish it online once the client approves the design — saving money during the development phase.
How you'll be assessedProcess assessment · Outcome assessment · Knowledge assessment
Process assessment
- Install web server software (e.g., Apache, Nginx).
- Configure web server settings (ports, virtual hosts).
Outcome assessment
A fully functional web server that can serve static and dynamic content is set up.
Knowledge assessment
Detailed knowledge of:
Method used: The student should explain how to:
- set up a web server
Principles: The student should explain the principle of:
- client-server architecture.
Theories: The student should explain:
- Different types of web servers and their use cases
Circumstantial knowledge:
Detailed knowledge about:
- Security considerations in server setup.
Question
What is a web server?
Sign in to submit your answer and have it count toward your mastery.
Sign in to practiceTutor
Stuck? Ask me anything about this topic.
Sign in to ask the Sonza AI Tutor about this question.
Sign in to askDiscussions
No questions yet