Kolej Profesional Mara Indera Mahkota
Kolej Profesional Mara Indera Mahkota
Kolej Profesional Mara Indera Mahkota
INSTRUCTION TO CANDIDATES:
2) AHMAD MUHAIMIN
BIN MOHD TAMIZI
I/D 1) ICN21-07-037
Number
2) ICN21-07-012
DCN 5A
Class
ZUL FAKHRI ZOLKEFLI
Lecturer
Total /
Table of Contents
TASK ................................................................................................................................................................ 3
SUMMARY ....................................................................................................................................................... 3
SECTION 1: VIRTUALBOX INSTALLATION ................................................................................................................ 4
INTRODUCTION TO VIRTUALBOX ............................................................................................................................... 4
INSTALLING VIRTUALBOX ON WINDOWS .................................................................................................................... 4
SECTION 2: CENTOS INSTALLATION AND CONFIGURATION .................................................................................. 7
INSTALLATION OF CENTOS 9..................................................................................................................................... 7
SECTION 3: WEB SERVER INSTALLATION AND CONFIGURATION .............................................................................. 20
STEP 1: CONFIGURATION IN THE SERVER BEFORE INSTALLING WEB SERVER ..................................................................... 20
STEP 2: INSTALL MARIADB .................................................................................................................................... 22
STEP 3: INSTALL PHP ............................................................................................................................................ 24
STEP 4: INSTALL WORDPRESS ................................................................................................................................. 25
STEP 5: CREATE A MARIADB DATABASE AND USER FOR WORDPRESS ........................................................................... 26
STEP 6: SEARCH THE WEB SERVER IP ADDRESS ON THE CLIENT COMPUTER .................................................................... 26
SECTION 4: DNS SERVER INSTALLATION AND CONFIGURATION ................................................................................... 27
STEP 1 – INSTALLING BIND EXTENSION .................................................................................................................... 27
STEP 2 – CONFIGURE DNS SERVER......................................................................................................................... 28
STEP 3 – CREATE AND CONFIGURE ZONE FILE ........................................................................................................... 29
STEP 4 – ENABLE AND START THE DNS SERVICE ....................................................................................................... 30
STEP 5 – FIREWALL CONFIGURATION ...................................................................................................................... 30
STEP 6 – APPLYING DNS SERVER TO WEBSITE .......................................................................................................... 31
STEP 7 – TESTING DNS SERVER ............................................................................................................................. 31
SECTION 5: SAMBA FILE SERVER INSTALLATION AND CONFIGURATION ......................................................................... 32
STEP 1 – INSTALLING SAMBA EXTENSION ................................................................................................................. 32
STEP 2 – CONFIGURE SAMBA ................................................................................................................................ 33
STEP 3 – CREATE A SAMBA USER ........................................................................................................................... 34
STEP 4 – START SAMBA SERVICE ............................................................................................................................ 35
STEP 5 – CONFIGURE FIREWALL ............................................................................................................................. 36
STEP 6 – CONNECT FROM WINDOWS CLIENT............................................................................................................... 37
STEP 7 – TESTING SERVER AND CLIENT FILE SHARING ................................................................................................ 38
REFERENCES........................................................................................................................................................ 0
TASK
Our pairing team has been tasked the final project for the Unix as Operating System subject on Kolej
Professional Mara that focus on identifying and exploring the most suitable Linux OS server for use in
both personal and professional settings. The project involved evaluating different Linux server options
and has to implement three essential services on the Linux Server that we choose.
SUMMARY
The final project aimed to demonstrate our knowledge of Linux operating systems, server
administration, and web development. It is also involved a thorough evaluation of various
Linux OS servers to identify the most suitable option for our implementation. After
considering the features and performance of different options, my team has selected CentOS
9, an open-source community-supported server. CentOS 9 is a Linux distribution that offers a
stable and secure platform for running servers and hosting web applications.
To further explore CentOS 9, we have implemented three essential and one backup services
on the server. The first service involved setting up a Web Server with LAMP stack and
WordPress. LAMP is an acronym for Linux, Apache, MySQL, and PHP, which are widely used
in web application development. By installing LAMP and WordPress on CentOS 9, we
demonstrate our ability to configure a web server and install a content management system
(CMS).
The second service involved setting up a Database Server using MySQL which is mariadb
server to be exact. MySQL is a widely used open-source database management system that
is popular among web developers. By setting up a MySQL database on CentOS 9, we
demonstrate our knowledge of database administration and management.
The third service include installing and configuring a DNS Server on CentOS 9. DNS stands for
Domain Name System and is responsible for mapping domain names to IP addresses. By
setting up a DNS server, you demonstrated your understanding of network administration
and configuration.
Finally, you've explored Samba file sharing services, which allow you to share files between
Linux and Windows machines. This can be a useful service for businesses that need to share
files between different operating systems.
SECTION 1: VIRTUALBOX INSTALLATION
Introduction to VirtualBox
Sun Microsystems' VirtualBox, which is now owned by Oracle, can simulate a standalone
computer. Each standalone computer (also known as a virtual appliance) is self-contained
and can run its own operating system (guest OS). The appliances can communicate with one
another and be part of your home network, but they will be treated as a separate system.
Because of these and other features, VirtualBox enables you to test different operating
systems without making permanent changes to your host OS. You could use VirtualBox to
test these operating systems before deciding on one. Alternatively, you can run your server
operating system or media server from your VirtualBox instance 24 hours a day, 7 days a
week. For example, run a 24/7 Ubuntu Home, media, or file server guest OS from within
your windows laptop
The figure above shows what on the screen when you open VirtualBox app, which is the
starting screen of VirtualBox. To start, users need to click the add button to install any OS they
wish to simulate in it.
Next, we need to go machine tab on our VirtualBox, and then pick the setting, go to the
Network tab, and change adapter 1 attached to “Bridged adapter”
Installation of CentOS 9
CentOS (short for Community Enterprise Operating System) is a free and open-source Linux
distribution that is based on the source code of Red Hat Enterprise Linux (RHEL). It is
developed and maintained by the CentOS Project, and, in this section, I will show how to
install CentOS. Firstly, user need to click on the NEW icon to create a new machine-like in
the figure below
Give your virtual machine a name and select "Linux" as the type and "Red Hat (64-bit)" as the
version. Click "Next" to continue.
We'll use Expert Mode (see below) instead of guided mode because it's much faster. The
user is shown in the figure selecting a descriptive name for their new virtual machine and
destination folder. They must then select CentOS as the type and Ubuntu (64-bit) as the
version.
Then click the network and hostname to assign the servers static ip address to the server
and the server’s hostname.
before we install the web server, we have changed the dhcp ip to static by using the
command “sudo vi /etc/sysconfig/network-scripts/ifcfg-172.20.10.5 and then we add the
following lines to set the IP address, net mask, gateway, and DNS servers for our network
and restart the network service by running the “sudo systemctl restart network” command.
Next, once the installation is complete, we start the Apache service by running “sudo
systemctl start httpd” and we enable the Apache service to start automatically at boot
time by running the “sudo systemctl enable httpd” command.
Now we run the security script to secure the MariaDB installation using a “sudo
mysql_secure_installation” command. This script will prompt us to set the root password,
remove anonymous users, disable remote root login, and delete the test database.
PHP is a popular server-side scripting language for creating dynamic websites so the
command that we use to install PHP on CentOS 9 is “sudo dnf install php php-common
php-mysqlnd php-gd php-mxi php-cli php-opcache php-mbstring”
Finally, our PHP is successfully installed, after the installation process, we restart the Apache
service to apply the changes using sudo systemctl restart httpd
Next After the extraction process, we set the appropriate ownership and permissions to
the WordPress directory by running the “sudo chown -R apache:apache
/var/www/html/wordpress” and “sudo chmod -R 755 /var/www/html/wordpress”
Before you can install WordPress, you need to create a MariaDB database and user for it.
Log in to the MariaDB shell as the root user using “sudo MySQL –u root -p” command.
Before you can install WordPress, you need to create a MariaDB database and user for it.
Log in to the MariaDB shell as the root user using “sudo MySQL –u root -p” command.
The bind package provides the named daemon, which is a Domain Name System (DNS) server
implementation. In CentOS 9, the bind package is available in the default package repositories
and can be installed using the package manager, dnf.
Install and configure BIND (Berkeley Internet Name Domain) on your CentOS 9 server:
The above configuration sets up a virtual host for your website on port 80 (HTTP) and
specifies the server’s name, document root directory, error log file, and access log file for
your website.
Binary packages of Samba are included in almost any Linux distribution. We install the samba
package from the terminal in CentOS with the following code “sudo dnf install samba samba-
client samba-common”.
The next step is Create a backup of the original Samba configuration file using “sudo cp
/etc/samba/smb.conf /etc/samba/smb.conf.bak” and then we open the samba
configuration file using a text editor. The command is “sudo vi /etc/samba/smb.conf”.
We can complete this by using the command “sudo systemctl start smb”. Then, enable the
samba service to start automatically on system boot using “sudo systemctl enable smb”.
Allow Samba traffic through the firewall by typing “sudo firewall-cmd --add-service=samba
--permanent”. After that, we need to reload the firewall rules using “sudo firewall-cmd –
reload” command.
Lastly, on the Windows client, we must open File Explorer and type the address bar
\\172.20.10.5\matkpmim and we can enter the Samba user account and password that we
created earlier.
First, we go to our Window client and open This PC directory. Then right-click on This PC on
the left side of the screen and choose map network drive option. Then, we choose any
drive from the list and type “//ipaddress/share/” and press ‘Finish’ afterward.
Now our screen will be the same as the figure below. From here we can add or remove a file,
as the same can be done on our server and it is shown here.
1. Negus, Christopher. Linux Bible, 9th Edition. John Wiley & Sons, 2015.
2. Blum, Richard, and Christine Bresnahan. Linux Command Line and Shell Scripting Bible.
John Wiley & Sons, Inc., 2021.
Date Detail
19/2/2023 1) Analyze the questions and divide the task among the group
members.
21/2/2023 1) Discuss among the group members and download which Linux
distribution to use.
5/3/2023 1) Finalize other services and start doing the documentation and
compile.
1
APPENDIX B
Date Detail