Debian

How To Install the Apache Web Server on Debian 11 Bullseye

Apache is the HTTP open-source web server, designed for modern operating systems. It is the web server that responds to the queries of internet users in the form of web pages and files. It has a safe and secure file-sharing feature, which means using this webserver, the users can put the files in the root directory and can share them with other users. Various versions of Apache have been introduced and Apache2 is referred to as Apache 2.0 which is the upgraded version with the addition of compile and run time configurations.

In this guide, we will provide you the installation procedure of the Apache Web server on Debian 11.

How to Install the Apache Web Server on Debian 11

Apache web server is available in the default repository of the Debian and you can install it by running the below-given command in the terminal:

sudo apt install apache2

Once the process of installation is finished, run the following command to confirm the installation. This command will check the status of the apache2 on Debian system:

sudo systemctl status apache2

Managing the Process of Apache2 on Debian 11

Now, you have installed and setup the Apache2 server, you can use the basic systemctl commands to control the server on your Debian system:

To start the Apache web server on Debian, execute the following command:

sudo systemctl start apache2

To stop the server, run the below command in the terminal:

sudo systemctl stop apache2

If you have stopped the server, you can start it again with the following command:

sudo systemctl restart apache2

Setting up Virtual Host on Debian

To setup the Apache2 on Debian run the start command and go to your default browser. Type localhost in the address bar and hit Enter key. You should see the default page of Apache 2 on your screen.

This means the server is running. To host the web page, you need to modify the configuration file from var/www/ directory.

Bottom Line

Apache is one of the most liked and commonly used web servers in almost all modern Linux operating systems. This server allows publishers to publish their content over the internet. Apache has tons of features and they can be enhanced using the additional modules. In the above section of the guide, we have demonstrated the procedure of the installation and managing the Apache web server on Debian 11.

About the author

Zainab Rehman

I'm an author by profession. My interest in the internet world motivates me to write for Linux Hint and I'm here to share my knowledge with others.