![]() |
Apache is an open-source web server that’s available for Linux servers free of charge. Installing an Apache web server on Linux is a straightforward process. In this article, we will install Apache Web Server Debian 11 (Bullseye). Steps to Install Apache Web Server in LinuxStep 1: Update Your Systemsudo apt update && sudo apt upgrade
![]() Updating system to latest packages Step 2: Install Apache Web Serversudo apt install apache2 -y
![]() installing Apache Web Server Step 3: Enable the Servicessudo systemctl enable apache2
![]() enabling system services for Apache Web Server Step 4: Test the Server by Hosting Simple WebsiteFirst, we will create a directory for our test website using following command. sudo mkdir /var/www/html/test_website/
echo '
sudo gedit /etc/apache2/sites-available/test_website.conf
<VirtualHost *:80> ![]() saving configuration
sudo chmod a+wr /var/www/html/ -R
Step 5: Enable the siteAfter creating config file, we need to enable the site. We use the a2ensite command followed by the name of site configuration file. This creates a symbolic link from the sites-available directory to the sites-enabled directory, effectively enabling the site. syntax: sudo a2ensite <site_config>
sudo a2ensite test_website.conf
sudo systemctl reload apache2
http://localhost
![]() testing website If the above mentioned steps performed correctly, Apache Web Server will run successfully! However, If it didn’t work, then you can uninstall Apache Web Sever and can start installation again. Steps to Uninstall Apache Web Server
sudo apt purge apache2 -y
![]() Uninstalling Apache Web Server ConclusionIn this article, we have installed and configured the Apache Web Server on Debian 11. We have outlined the fundamental steps, encompassing updating package lists, installing the software, verifying its operation, and hosting test website. So install Apache Web Server on your Linux now! FAQs – How to install Apache Web Server on Debian 11?1. What is Apache, and why is it used?
2. What are virtual hosts, and when are they used?
3. What are some best practices for managing multiple websites with Apache?
|
Reffered: https://www.geeksforgeeks.org
Web Technologies |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 17 |