Before you can start hosting websites from your Ubuntu server, you will first need to install web server software. This software will function as a handler for your server, allowing users to connect to the server over the public internet. While there are many different types of web server software available, one of the most popular is Apache. In this guide, we will outline how to install and configure Apache on your Ubuntu server via SSH. Please note that you will need root access to complete this guide.
Install Apache on your Dedicated Hosting server to start establishing your online presence today!
- Before you can install Apache, you will first want to make sure to update the software package using the following command:
sudo apt update
- Once the package has updated, you can then install Apache using the following command:
sudo apt install apache2
The installation process will prompt you to press a key to continue. Press the Y key and hit enter.
Before Apache can start accepting connections, you need to allow the service in the Ubuntu firewall software, known as ufw or UncomplicatedFirewall.
- If ufw is not already enabled, enable it with the following command:
sudo ufw enable
- With ufw enabled, you can allow Apache connections using the following command:
sudo ufw allow 'Apache'
- To confirm that the firewall is now allowing Apache connections, use the following command:
sudo ufw status
The output will then display which connections are now allowed in the firewall.
To check the status of the Apache service, run the following command:
sudo systemctl status apache2
If Apache is running properly, it should say active in the output.
Occasionally, making changes to your server may require you to restart Apache. You can do this via the following command:
sudo systemctl restart apache2
If you want to restart Apache without dropping active connections, you can reload Apache with the following command:
sudo systemctl reload apache2
- To confirm that Apache is installed properly and accepting connections over the public internet, you can test it by visiting your server IP address in your browser. For example, if your server IP is 123.456.789.0, you would navigate to this URL in your browser:
- If the installation process was successful, you should see the following splash page:
Congratulations, you have now installed Apache on your Ubuntu server!