How to Install Apache on Debian 10

Install Apache on Debian 10

In this article, we will have explained the necessary steps to install and configure Apache on Debian 10. Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges. All the commands in this tutorial should be run as a non-root user.

Apache HTTP Server, also known as “Apache.” It is a web server famous for promoting the growth of the World Wide Web. Apache is the opensource, cross-platform, powerful, stable, reliable and free web server providing features which can be extended by the wide variety of modules. It is also used as a reverse proxy server in different scenarios.

Install Apache on Debian

Step 1. The first command will update the package lists to ensure you get the latest version and dependencies.

Step 2. Install Apache on Debian 10.

Apache Web server packages are available on Debian 10 official repositories. All that’s needed is execution of install command with sudo:

After completion of the above command, Apache is installed on your system. Run the following command to check apache service status:

Confirm Apache build and version:

Now that you have your web server up and running, let’s go over some basic management commands:

Following are the Apache important files and directories:

  • Apache main configuration file is located at /etc/apache2/apache2.conf
  • Apache main configuration files directory: /etc/apache2/
  • Ports where apache can listen are defined in /etc/apache2/ports.conf
  • Virtual Host files stored at /etc/apache2/sites-available and to activate each file should be linked to /etc/apache2/sites-enabled directory
  • Error log file located at /var/log/apache/error.log
  • Access log file located at /var/log/apache/access.log
  • Document root for web files /var/www/html/

Step 3. Adjust the Firewall for Apache Web Server.

It is important that you open TCP port 80 (www) and 443 (https) so that Apache on Debian 10 works. Type the following commands:

Step 4. Verify Apache Installation.

Open your favorite browser and open below URL to verify Apache installation:

Congratulation, you have learned how to install and configure Apache on Debian 10 Buster. If you have any question, please leave a comment below.