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:
- Update the system:
sudo dnf update- Install the Apache web server:
sudo dnf install httpd- Start and enable Apache:
sudo systemctl start httpd
sudo systemctl enable httpd- Allow HTTP traffic through the firewall:
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --reload- Test the Apache installation by visiting your server’s IP address in a web browser.
Ubuntu 20.04:
- Update the system:
sudo apt update
sudo apt upgrade- Install the Apache web server:
sudo apt install apache2- Start and enable Apache:
sudo systemctl start apache2 sudo systemctl enable apache2- Allow HTTP traffic through the firewall:
sudo ufw allow 'Apache'- Test the Apache installation by visiting your server’s IP address in a web browser.
