
Apache is an open-source and cross-platform HTTP server that powers a large number of websites. Apache web server is the most widely-used web server in the world. It also has many powerful features, dynamically loadable modules with other popular software. In this tutorial, we will explain how to install Apache web server on Debian 10.
Install Apache on Debian 10
Apache installation is very easy because Apache is available in the default Debian software repositories.
Prerequisites
Before you begin this guide, You need Debian 10 Buster with a non-root user account with full root access.
At first, you should update the package index and then will install the apache2
package using below commands :
sudo apt update
sudo apt install apache2
Here, we use sudo as command so these operations are executed with root privileges and it will prompt you to enter your regular user password
to verify.
Once Apache is installed and it will start apache2
service automatically.
Adjusting the Firewall
After Apache installation make sure that your firewall allows HTTP and HTTPS traffic. You can get list of ufw
profile list by typing :
sudo ufw app list
Available applications: Apache Apache Full Apache Secure OpenSSH
If you are using nftables to filter connections to your system, You can open required ports by issuing the following command:
nft add rule inet filter input tcp dport {80, 443} ct state new,established counter accept
Allow incoming HTTP and HTTPS traffic for this profile:
sudo ufw allow in "Apache Full"
Testing Apache Installation
You can also check Apache status by execute below command :
sudo systemctl status apache2
It will show you output like below :
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2019-07-27 11:29:17 UTC; 15min ago
...
Another method to check is, open your web browser, type your server IP address or domain name http://YOUR_SERVER_IP
and you will see the default Apache welcome page as shown below:

Manage Apache Processes
Now your web server is installed and up to run so we will see some basic management commands.
To stop Apache service you can run :
sudo systemctl stop apache2
You can again start Apache service by type :
sudo systemctl start apache2
To do Restart (stop and start) the Apache service:
sudo systemctl restart apache2
If you have need to making configuration changes, Apache can reload without dropping connections. For this, use this command:
sudo systemctl reload apache2
If you want to disable the Apache service type:
sudo systemctl disable apache2
To re-enable the service to start up at boot, type:
sudo systemctl enable apache2
Conclusion
Finally, you have successfully installed Apache on your Debian 10 Buster machine. You can now start deploying your applications and use Apache as a web or proxy server.
If you have any question or suggestion, leave comment below.
Leave a Reply