Apache Web Server, Firewall Configuration with Ubuntu

Apache Web Server, Firewall Configuration with Ubuntu

When I was still a junior in Web System Development, I only focused on web development without any knowledge of web servers. What I know is setting up a local web server by using XAMPP. Thanks to my supervisor and manager, I learned it myself.

For the first time accessing a Linux OS (Ubuntu), all the necessary packages and updates need to be completed. Open the terminal and write the command.

sudo apt update
sudo apt upgrade

UPDATE TIME SERVER IN LINUX

timedatectl
sudo timedatectl set-timezone Asia/Kuala_Lumpur
timedatectl

You will be needing to set your firewall too. (Keep in mind this is only a rough and basic idea).

sudo ufw status //this is to check firewall status
sudo ufw enable //this is to enable firewall
sudo ufw allow ssh //this is to allow SSH access
sudo ufw status //re-check the status

INSTALLING THE APACHE WEB SERVER

// STEP 01
sudo apt update

// STEP 02
sudo apt install apache2

// STEP 03
sudo ufw app list

// STEP 04
sudo ufw allow in "Apache"

// STEP 05
sudo ufw allow in "Apache Secure"

// STEP 07
sudo ufw status

// STEP 08
sudo apache2 -v

You can check the configuration by browsing your IP Address (it might be binded with IP or just a simple localhost/127.0.0.1). If Apache2 Default Page appear, it means you good to go!

UPDATING / UPGRADING APACHE WEB SERVER

//Follow all the commands
sudo cp /etc/apache2/apache2.conf /etc/apache2/apache2-backup.conf 
sudo apt-get install software-properties-common 
sudo add-apt-repository ppa:ondrej/apache2 
sudo apt update 
sudo apt upgrade 
sudo apache2 -v 

fariskmrdn Avatar

Leave a Reply

Your email address will not be published. Required fields are marked *