![]() |
VOOZH | about |
One of the most dominant forces in web server software is the Apache HTTP Server, often shortened to Apache. This free and open-source project, overseen by the Apache Software Foundation, has been a major player in shaping the Internet since its launch in 1995. Installing an Apache web server on Ubuntu or Debian is a straightforward process, but the specific commands might differ slightly depending on your Linux distribution. In this article, we will install Apache Web Server on various Linux distributions like Ubuntu, Debian, etc.
grep -E '^(VERSION|NAME)=' /etc/os-release sudo apt update && sudo apt upgrade sudo apt install apache2 -y sudo systemctl enable apache2 sudo mkdir /var/www/html/test_websiteecho ' <html>
<head>
<title>Example</title>
</head>
<body>
<h1 style="color:green">GFG</h1>
<p>This is a Apache Test Server for Ubuntu and Debian</p>
</body>
</html>' | sudo tee /var/www/html/test_website/index.html
sudo echo '<VirtualHost *:80>
ServerName web.testingserver.com
DocumentRoot /var/www/html/website
DirectoryIndex index.html
ErrorLog /var/log/httpd/example.com_error.log
CustomLog /var/log/httpd/example.com_requests.log combined
</VirtualHost>' >
/etc/httpd/conf.d/web.conf
sudo chown -R apache: apache /var/www/html/test_website
sudo chmod -R 755 /var/www/html/test_website
Link: http://localhost/