FEDERAL TECHNICAL & VOCATIONAL EDUCATION & TRAINING INSTITUTE
(TVETI) ADDIS ABABA, ETHIOPIA
MASTER OF SCIENCE IN ICT TEACHERS EDUCATION
Operation Sheet 3.2 :
Installing Apache Web
Server in Linux Server
DR. PATRICK D. CERNA
2017
[Type text] Page 1
ICT 543 SERVER ADMINISTRATION LEARNING GUIDE 3
Installing Apache Web Server in Ubuntu Linux Server
Objectives: After the end of the activity, the students will be able to:
Install and Configure Apache Web Server in Linux
Create Website and Deploy it in Apache Web Server
Test the configuration
Procedure:
Step 1: Open VM Ware Ubuntu Linux Server, and now Login on the shell on the server as user your
created during installation. The username may differ if you have chosen a different name during setup.
Step 2: Install the Apache Web Server using the code below:
sudo apt-get update
sudo apt-get install apache2
Operation Sheet 3.1: IIS by: Dr. Patrick D. Cerna Page 2
Step 3: Adjust the Firewall
Before we can test Apache, we need to modify our firewall to allow outside access to the default web ports.
Assuming that you followed the instructions in the prerequisites, you should have a UFW firewall configured
to restrict access to your server.
sudo ufw app list
You should get a listing of the application profiles:
Output
Available applications:
Apache
Apache Full
Apache Secure
OpenSSH
As you can see, there are three profiles available for Apache:
Apache: This profile opens only port 80 (normal, unencrypted web traffic)
Apache Full: This profile opens both port 80 (normal, unencrypted web traffic) and port 443
(TLS/SSL encrypted traffic)
Apache Secure: This profile opens only port 443 (TLS/SSL encrypted traffic)
Step 4: Allow Apache Full to open port 80 and port 443
For our purposes, we will allow incoming traffic for the Apache Full profile by typing:
sudo ufw allow 'Apache Full'
Operation Sheet 3.1: IIS by: Dr. Patrick D. Cerna Page 3
Step 5: Verify the status of ufw
You can verify the change by typing:
sudo ufw status
You should see HTTP traffic allowed in the displayed output:
Output
Status: active
To Action From
-- ------ ----
OpenSSH ALLOW Anywhere
Apache Full ALLOW Anywhere
OpenSSH (v6) ALLOW Anywhere (v6)
Apache Full (v6) ALLOW Anywhere (v6)
Step 6: Check if Apache Web Server is running
When you have your server's IP address or domain, enter it into your browser's address bar (This is
through your Windows 7 /10 Client)
http://server_domain_or_IP or http://10.0.4.242
You should see the default Ubuntu 16.04 Apache web page, which should look something like this:
Operation Sheet 3.1: IIS by: Dr. Patrick D. Cerna Page 4
Step 7: Go to the HTML Directory
Type the following command to go HTML Directory
Cd /var/www
Step 8: Create an HTML Page by typing the command:
sudo nano home.html
Operation Sheet 3.1: IIS by: Dr. Patrick D. Cerna Page 5
Once the editor is open type the following HTML code:
<html>
<body>
<h1>Welcome to my Apache Web Server</h1>
<p>Amasedgenalehu </p>
</body>
</html>
Step 9: Test the HTML page
When you have your server's IP address or domain, enter it into your browser's address bar (This is
through your Windows 7 /10 Client)
http://10.0.4.242/home.html
Step 10: Starting, Stoping, and Restarting Apache Web Server
sudo /etc/init.d/apache2 start
sudo /etc/init.d/apache2 stop
sudo /etc/init.d/apache2 restart
Operation Sheet 3.1: IIS by: Dr. Patrick D. Cerna Page 6