Your quick guide to installing and managing the world's most popular web server.
The Apache HTTP Server, colloquially called Apache, is a free and open-source cross-platform web server software. It is fast, reliable, and secure. When combined with Ubuntu, it provides a highly stable environment for hosting websites and web applications.
Installing Apache 2 on Ubuntu is incredibly straightforward using the default package manager, apt. Follow these steps in your terminal:
1. Update your local package index:
sudo apt update
2. Install the apache2 package:
sudo apt install apache2 -y
If you are using UFW (Uncomplicated Firewall), you need to allow HTTP and HTTPS traffic to access your web server.
Allow Apache through the firewall:
sudo ufw allow 'Apache Full'
Verify the status:
sudo ufw status
Once your server is up and running, you can manage the Apache service using systemctl commands.
sudo systemctl start apache2sudo systemctl stop apache2sudo systemctl restart apache2sudo systemctl status apache2To verify that Apache is working correctly, open your web browser and navigate to your server's public IP address or http://localhost if you are on the same machine. You should see the default Apache2 Ubuntu Default Page.