BCE-C712 Linux System Administration

0 of 74 lessons complete (0%)

Web Services and Databases

Setting Up Web Servers

You don’t have access to this lesson

Please register or sign in to access the course content.

Here are general instructions for setting up a web server on CentOS 8 and Ubuntu 20.04. Adjust the commands based on the actual versions you are using.

CentOS 8:

  1. Update the system:
sudo dnf update
  1. Install the Apache web server:
sudo dnf install httpd
  1. Start and enable Apache:
sudo systemctl start httpd 
sudo systemctl enable httpd
  1. Allow HTTP traffic through the firewall:
sudo firewall-cmd --permanent --add-service=http 
sudo firewall-cmd --reload
  1. Test the Apache installation by visiting your server’s IP address in a web browser.

Ubuntu 20.04:

  1. Update the system:
sudo apt update 
sudo apt upgrade
  1. Install the Apache web server:
sudo apt install apache2
  1. Start and enable Apache:
sudo systemctl start apache2 sudo systemctl enable apache2
  1. Allow HTTP traffic through the firewall:
sudo ufw allow 'Apache'
  1. Test the Apache installation by visiting your server’s IP address in a web browser.