To install Apache 2.4 on Ubuntu 20.04 LTS, you can use the
apt package manager, which makes the process straightforward. Here are the steps:
- Update Package List: Open a terminal and make sure your package list is up to date by running the following command:
sudo apt update
- Install Apache: Once the package list is updated, install Apache using the following command:
sudo apt install apache2
This command will download and install the Apache 2.4 web server.
- Start Apache: After the installation is complete, start the Apache service:
sudo systemctl start apache2
- Enable Apache to Start on Boot: Ensure that Apache starts automatically on boot:
sudo systemctl enable apache2
- Check Apache Status: Verify that Apache is running without any issues:
sudo systemctl status apache2
If Apache is running, you should see a message indicating that the service is active and running.
- Configure Firewall: If you have a firewall enabled, you may need to allow HTTP traffic. Use the following command to allow traffic on port 80 (default HTTP port):
sudo ufw allow 80
If you also plan to enable HTTPS later, you can allow traffic on port 443:
sudo ufw allow 443
- Access Apache Default Page: Open a web browser and navigate to
http://your_server_ip. You should see the default Apache web page, indicating a successful installation.
That’s it! You have successfully installed Apache 2.4 on Ubuntu. You can now start deploying your web applications or websites on the Apache server.
If you need to configure virtual hosts, SSL, or other advanced settings, you can refer to the Apache documentation or additional guides based on your specific requirements.