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:
# sudo apache2 -v
Now that you have your web server up and running, let’s go over some basic management commands:
sudosystemctlstartapache2.service ## <-- Start the server ##
sudosystemctlrestartapache2.service## <-- Restart the server ##
sudosystemctlstopapache2.service ## <-- Stop the server ##
sudosystemctlreloadapache2.service ## <-- Reload the server config ##
sudosystemctlstatusapache2.service ## <-- Get the server status ##
Following are the Apache important files and directories:
- Apache main configuration file is located at
- Apache main configuration files directory:
- Ports where apache can listen are defined in
- Virtual Host files stored at
/etc/apache2/sites-availableand to activate each file should be linked to
- Error log file located at
- Access log file located at
- Document root for web files
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.