How to Install Apache on Ubuntu: Step-by-Step Guide.
1. Start by updating software packages and installing Apache Web Server;
sudo apt update
sudo apt install apache2
2. The Apache server should now be started automatically and you can check it by the following command:
sudo systemctl status apache2
3. If you have a Firewall on the server, enable ports 80 and 443 so you can allow the client to accept connections and be able to open websites by using HTTP and HTTPS protocols;
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw reload
4. Verify the server is working properly by opening the website (or localhost if it is a local server);