Apache (httpd) is the most widely used web server in the world.
Install
apt update
apt install apache2 -yStart and Enable
systemctl start apache2
systemctl enable apache2Verify
Visit http://YOUR_IP_ADDRESS in your browser. You should see the Apache default page.
Firewall
ufw allow "Apache Full"Key Files
- Config:
/etc/apache2/apache2.conf - Sites:
/etc/apache2/sites-available/ - Logs:
/var/log/apache2/ - Web root:
/var/www/html/
Useful Commands
apachectl configtest # Test configuration
a2ensite mysite # Enable a site
a2dissite mysite # Disable a site
a2enmod rewrite # Enable a module