WEB375 Lab 5 Configure HTTP Server in Linux



The purpose of this Lab is to configure an Apache web server in Linux. Use the IP addresses that exist when you start Linux.
Virtual Machine Login Information for PLABFED01 and PLABFED02
Username: Student
Password: Password
Username: root
Password: Password
Lab Diagram
During your session, you will have access to the following Lab configuration.
The Linux servers also connect to a private network. The IP address of PLABFED01 is and the IP address of PLABFED01 is
Connecting to Your Lab
In this module, you will be working on the following equipment to carry out the steps defined in each exercise.
WINCONSOLE (Management Server)
PLABFED01 (Linux Server)
PLABFED02 (Linux Server)
Each exercise will detail which console you are required to work on in order to carry out the steps.
To start, simply click on the named server from the device list (located on the left hand side of the screen) and click the Power on from the Tools bar. In some cases, the devices may power on automatically.
During the boot up process, an activity indicator will be displayed in the Name tab:
Black – Powered Off
Orange – Working on your request
Green – Ready to access
If the remote console is not displayed automatically in the main window (or popup), click the Connect icon located in the Tools bar to start your session.
If the remote console does not appear please try the following option:
Switch between the HTML 5 and Java client versions in the tools bar.
In the event this does not resolve your connectivity problems, please visit our Help / Support pages for additional resolution options.
TASK A – Read General Background Information on HTTP Server
This is the background information to help you do your lab. Read this to get a general understanding of how to configure an HTTP server.
Apache Web Server Overview
What Is a Web Server?
A web server uses the Hypertext Transfer Protocol (HTTP) to communicate or distribute static or dynamic information from a central computer. In addition, many web servers also:
send descriptive information about the requested resource (e.g., mime type) instructing the client how to interpret or format the resource.
perform user authentication and data encryption to permit online business transactions
provide database access on behalf of the client, eliminating the need for the client to use a client-side application to do the work.
send appropriate error messages.
What is Apache?
The most popular web server on the Internet is Apache; it is open source. Apache is stable, relatively secure, and can be customized with added functionality with dynamic modules loaded on the fly when they are needed.
Become Familiar with Apache Files
The root directory of the web server is /etc/httpd, which is divided into three parts:
/etc/httpd/conf (where configuration files stay)
/etc/httpd/logs (where the logs of the web server are, and site accessing stay)
/etc/httpd/modules (where the module stays)
The main file, httpd.conf, is used to configure a web server. It contains the configuration directives that give the server its instructions. The configuration directives are grouped into three basic sections:
Directives that control the operation of the Apache server process as a whole (the ‘global environment’).
Directives that define the parameters of the main or default server, which respond to requests that are not handled by a virtual host. These directives also provide default values for the settings of all virtual hosts.
Settings for virtual hosts, which allow Web requests to be sent to different IP addresses or host names, and have them handled by the same Apache server process.
The following table lists some directives and their meaning:
ServerRoot The server installation / configuration location
ScoreBoardFile Where the Apache server stores some of its own process information
Port Which port the server listens on
ServerAdmin Administrator’s E-mail address
ServerName Host name / IP address of the machine running the server
DocumentRoot This is the location where your HTML documents are stored
DirectoryIndex List of HTML document file names
ServerType Select “standalone” or via xinetd
LoadModule To load the specified module
TASK B – Configure Basic Settings For The Web Server Step-By-Step
We start setting up a basic HTTP server. As always when doing any type of system administration, we need to perform them using root account. Use Putty to logon plabfed01 as root.
Step 1: To stop all firewalls or security features, type the following commands:
#systemctl stop firewalld
#systemctl stop iptables
Step 2: Make sure Apache is installed by typing the following from a terminal window:
If it did not show as the above outputs, you need to install them. To install Apache on an Fedora 20 system type:
#yum –y install httpd
Step 3:
Now that the Apache packages are installed, we need to set the name of the web server to match with the name of the computer. Edit /etc/httpd/conf/httpd.conf, search for the line containing ‘ServerName localhost” (line number 95), and delete the # from the beginning of the line, and add It should look like this:
To make it available on the LAN, replace localhost with your IP address.
In a real setup, we would use the computer name defined in the DNS server (e.g.,
Step 4: Start the Apache web server by typing:
#systemctl start httpd
Note: If you change your configuration file, the changes will take effect with the command:
#systemctl restart httpd
You can stop the service with this command:
#systemctl stop httpd
You can show the service status with this command:
#systemctl status httpd
Step 5: To check httpd status type:
#systemctl status httpd
An active httpd status looks like this:
Screenshot # 1
Clear the screen and type this command: systemctl status httpd. Capture the Skillsoft desktop and paste it into your Lab Report document.
Step 6: You are done with the setup.
If httpd fails starting, check for errors using command journalctl –xn, fix any typo in the /etc/httpd/conf/httpd.conf file, and restart the service with command #systemctl restart httpd until vsftpd starts successfully. Below is a sample of journalctl –xn command output without any error.
Step 7: To enable the vsftp server during boot, type the following command:
#systemctl enable httpd
TASK C –Validate and Test Web Server
Now we need to have two TigerVNC sessions, one logon on plabfed01 and the other on plabfed02
Use TigerVNC to logon plabfed01 as root.
Use TigerVNC to logon plabfed02 as root.
Note: Type 1 to logon as Student, and 2 to logon as root.
Arrange the VNC windows so we can switch back and forth easily by moving the cursor to the desired screen and right click. See below screenshot:
Note: Press the ESC key to bring back the active screen.
Step 1: We are using a text browser called links to display a web page. To install it on both systems, plabfed01and plabfed02, type the command:
#yum –y install links
Step 2: On the web server (plabfed01), create a simple web page and save it as index.html in your DocumentRoot directory:
cd /var/www/html
vi index.html
Enter the following text:
Apache is cool!!!
This message is from your_name_here.
Your index.html file’s contents look like this:
Step 3: On the web client plabfed02, display the web page from the web server plabfed01 using the text browser links. Type the command as follows:
A sample text-based web page appears as follows:
Note: To open another terminal from links click on file then select “Open terminal”.
Screenshot # 2
Capture the Skillsoft desktop showing the content of the web page similar to the above screenshot, and paste it into your Lab Report document.
TASK D – Configure Virtual Hosting
In this part of the Lab, we will host two websites, and to the apache web server. Go to the plabfed01 server and login as root.
Step 1: For each website, create a DocumentRoot directory and an index page as seen below:
Use vi or nano to edit the index.html for and sites with the content below:
Screenshot # 3
Clear the screen and use cat to display the contents of the /var/www/virtual/ file. Capture the Skillsoft desktop and paste it into your Lab Report document.
Step 2: Update the /etc/hosts file with the content below:
Step 3:
Use vi or nano to create the virtual configuration file /etc/httpd/conf.d/papamama.conf of apache server. The content looks like this:
Step 4: To check the syntax of the file, and before restarting the web server, type:
Step 5: To restart the HTTPD web server type:
TASK E –Test Virtual Hosting
Now we use Putty to logon plabfed01 as root to perform the testing.
Step 1: On the plabfed01 web server, display the web page using the text browser links. Type the command as follows:
A sample text-based web page appears as follows:
Note: To exit from Links, click on the top of the page and the Tool bar will appear. Click on File, then Exit.
Screenshot # 4
Capture the Skillsoft desktop showing the content of the web page similar to the above screenshot, and paste it into your Lab Report document.
Step 2: On the plabfed01 web server, display the web page using the text browser links. Type the command as follows:
A sample text-based web page appears as follows:
This concludes the Week 5 Lab.
The solution includes a zip document.
Attachments [Move over files to preview content of those files] (713.59 KB)
Price: $15
Buy Now
Added to cart
Buy More Save More
Buy at least TWO items & save up to 30% OFF your ENTIRE order!
Rack up instant rebates in your shopping cart. Simply add items to your cart, and see the savings add up.
Discounts will automatically be applied on eligible orders.
WEB375 Lab 5 Configure HTTP Server in Linux – $15.00
WEB375 Lab 6 Configure a MySQL Server in Linux – $15.00
WEB375 Lab 7 Configure iptables in Linux – $15.00
Add to Cart
Added to cart
You May Also Like:
WEB375 Lab 1 Basic Linux and System Admin Commands
WEB375 Lab 2 Configure a DNS Server in Linux
WEB375 Lab 3 Configure a Sendmail Server in Linux
WEB375 Lab 4 Configure a vsftp Server in Linux
WEB375 Lab 6 Configure a MySQL Server in Linux
WEB375 Lab 7 Configure iptables in Linux


There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.