You are on page 1of 12

DFN50303 – Open Source Server Administrator

Matrix No.
Name : PREEVITHA NITHIYANANTHAN
10DDT19F2067
Code & Course : DFN40183 Open Sources Server Administration Class: DDT 5B

Lecturer(s) : WAN AHMAD HILMI A. RAHIM Date: 01/07/2022

Practical Test (FA) : [CLO: CLO1P4] Duration : 2 Hours

DFN 40183 : OPEN SOURCE SERVER ADMINISTRATOR.

JABATAN TEKNOLOGI MAKLUMAT & KOMUNIKASI (JTMK)

FINAL ASSESSMENT (PRACTICAL TEST)

Session II 2021/2022

Date: 01 July 2022


Time: 8.30 AM - 10.30 AM

This paper contains Nine (9) printed pages and FOUR (4) questions.

Question Practical (4 question) 100 Marks


DFN50303 – Open Source Server Administrator

QUESTION MARKS: 100 MARKS

INSTRUCTION:
This section consists of FIVE (4) Structure questions. Write your answer on this paper.

1. Write the command code below:

a. Show Server ip
b. Show Hostname
c. Write source code to change origin Hostname on Ubuntu to new
Hostname as JTMKF[last 4 digit id number]
d. Create new directory as name as LAMPWeb
e. In new directory you have been created was named LAMPWeb, create
another new directory in LAMPWeb as name as PHP
f. Show the both new directory you had been created separately.
g. Write the command code that show URL PHP directory
h. In directory LAMPWeb, create new file name as info.html

<html>
<body>
<center>
Name : Your_Name
<br>
ID Number : Your_ID_Matrix

<br>
Gender : Your_Gender
</center>
</body>
</html>

Figure 1.

i. Copy text from figure.1 and insert into info.html, write the command
code to insert text
j. Write command code to copy LAMPWeb directory to your desktop.
DFN50303 – Open Source Server Administrator

a.

b.

c.
d.

e.

f.
g.

h.
DFN50303 – Open Source Server Administrator

i.
j.

2. Mr. Radzi wanted to provide a new website server for his company, he did not know
the ways and how to build such a server. He has prepared a file in html format to be
uploaded in the server of the website. Therefore, with the expertise and experience
you have, Mr. Radzi asks for your help to prepare this server also write step command
code for his reference. He only asked for the server's IP to be given to him when it was
ready.

a. Change from user to root, write command code to change


to root account
[1 Marks]
b. Installing Apache and Updating the Firewall. [4 Marks]

c. View Firewall app profile [4 Marks]

d. Set Firewall rule to allow accept incoming @ inbound traffic for


DFN50303 – Open Source Server Administrator

Apache Full @ Apache [3 Marks]

e. Write command to check current status Firewall Apache [3 Marks]

f. Write the code to Start and Restart your Apache [3 Marks]

g. Write a command code to test your Apache on browser and screen


screenshot the output. [3 Marks]

h. Apply to assign LAMPWeb directory ownership of the directory with the $USER
environment variable. Then set to allow all permission to owner, groups and
others as Read, Write and Execute [6 Marks]

i. Create A new file Index as a format html in the LAMPWeb directory. Copy
and Insert html text code from figure.2 into the new html file you have
created [8 Marks] Figure 2.
DFN50303 – Open Source Server Administrator

<html>
<head>
<title> Apache Server Final Practical Task </title>
<style>

table, th, td {
border:1px solid black;
}
.dhead{
background-color:
d9ead3; height: 50px;
width: 100%;
border: 1px solid #4CAF50;
margin: auto;
}

body{
background-image: url("https://wallpapercave.com/wp/wp9265065.jpg"); background-
repeat: no-repeat;
background-size: 100% 100%;
}

.dvr{
/* float:right */;
position:absolute; right:50px;
}

.dvi{ height: 50%; width:


40%; border: 1px solid
#4CAF50; background-
color : white;
font-size:20;
float:left;
}
DFN50303 – Open Source Server Administrator

.dvii{ height: 10%; width:


30%; border: 1px solid
#4CAF50; background-color:
white;
font-size:20; position:
absolute; bottom: 10%;
}

.dviii{ height: 70%; width:


40%; border: 1px solid
#4CAF50; background-color :
white; position:absolute;
right:10%;
float:right;
}
.hleft{
position:absolute;
}
img { border: 1px solid
#ddd; border-radius: 4px;
padding: 5px; width:
100%;
height: 100%;
}
h1{
color: white;
}
</style>
<div class="dhead">
<h3 class="hleft">
&nbsp; Company Mr. Radzi
</h3>
<div class="dvr">
Home | About Us | <a href=” info.html “>Information</a>
</div>
</div>
</head>
DFN50303 – Open Source Server Administrator

<body>
<h1> Web for Final Practical Task OSSA </h1>
<br><br><br>
<div class="dvi">

What is Lorem Ipsum?


Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has
been the industry's standard dummy text ever since the 1500s, when an unknown printer took
a galley of type and scrambled it to make a type specimen book. It has survived not only five
centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was
popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages,
and more recently with desktop publishing software like Aldus PageMaker including versions of
Lorem Ipsum.
<br><br>

Why do we use it?


It is a long established fact that a reader will be distracted by the readable content of a page
when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal
distribution of letters, as opposed to using 'Content here, content here', making it look like
readable English. Many desktop publishing packages and web page editors now use Lorem
Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites
still in their infancy. Various versions have evolved over the years, sometimes by accident,
sometimes on purpose (injected humour and the like). </div>

<br><br>
<div class="dvii"> Created
by :
<br>

Name : Your_name
<br>
ID : Your_ID
</div>

<div class="dviii">
<img src="https://www.apu.edu.my/sites/default/files/page11_image1_1280.jpg"/> </div>

</body>
</html>
DFN50303 – Open Source Server Administrator

j. Fill in and replace your name and your Matrix ID at [your_name]


& [your_id]
[2 Marks]
k. As a default Apache online, was show “Apache2 Ubuntu Default Page” to
make showing exactly HTML Web page, you must setup and change
configuration file located. Create new located configuration file from
your Apache, from using this command:
$sudo nano /etc/apache2/sites-available/your_domain.conf

Setup and complete your configuration below:

<VirtualHost 80>
ServerAdmin ServerName
ServerAlias
DocumentRoot
<VirtualHost>

[6 Marks]

l. Write code to test your new configuration Apache, show


status configuration either Syntax OK or error [3 Marks]

m. Write code restart Apache, and test your final result on your
Browser. Screenshot your final result [4 Marks]

2.2 Submit every step you make, either copy the code or capture a screen.

[50 Marks]
DFN50303 – Open Source Server Administrator

3. Based on the above website, Mr. Radzi would like to add a database server. He plans
to use it in the future which allows him to store some basic information from his
website users.Information to be stored such as:
a. Name,
b. Age,
c. email.

a. At the request of Mr. Radzi, please install MySQL,


show you command code [2 Marks]

b. Setup MySQL:
i. Write command code to log in MySQL console [3 Marks]

ii. Create database as name as Radzi [2 Marks]

iii. Show all DataBase [2 Marks]

iv. Create table as requirement:


1) Create Table as name Info
2) Add column name varchar (20),
3) Add column age int,
4) Add column email varchar (20) [5 Marks]

v. Write code to describe your table [2 Marks]

[16 Marks]
DFN50303 – Open Source Server Administrator

4. Therefore, Mr. Radzi wanted to add a function that allows his website to communicate
with the database, he asked to create a basic PHP function only. Where, this allows
Mr. Radzi to make his own changes to the database as well as link the database can be
used on his website.
Setup PHP:
a. Show all command code every each step.
i. Write command code to install PHPMyAdmin

a) Set username as admin, and password as 1234 [3 Marks]

ii. Check and show PHP version [1 Marks]

iii. Create a new link for PHPAdmin [3Marks]

iv. Write to enable configuration PHPAdmin [2 Marks]

v. Write source code to create new file as format php as name info.php in
directory LAMPWeb

a) Insert text code :


<?php
phpinfo(); [3 Marks]

vi. Write source code to reload Apache2 to trigger PHP on


browser and test to view PHPAdmin [3 Marks]

[15 Marks]
DFN50303 – Open Source Server Administrator

You might also like