Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save AnythingLinux/8ae75f155b70638da0ba5b23b1c62424 to your computer and use it in GitHub Desktop.

Select an option

Save AnythingLinux/8ae75f155b70638da0ba5b23b1c62424 to your computer and use it in GitHub Desktop.
Install Apache web server on an Ubuntu 24.04 LTS Server
sudo apt update
sudo apt upgrade
sudo apt install apache2
sudo ufw allow in "Apache Full"
apache2 -v
nano /etc/apache2/apache2.conf
# Add ServerName 127.0.1.1 into the middle of this file
ServerName 127.0.1.1
# Find this line by ctrl+w /var/www/ and update AllowOverride All
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
# Save and exit ctrl+s and ctrl+x
sudo service apache2 start
sudo systemctl enable apache2
sudo service apache2 restart
sudo service apache2 reload
sudo service apache2 status
apachectl configtest
# Troubleshoot
Fix Internal Server Error The server encountered an internal error:
sudo a2enmod rewrite
sudo systemctl restart apache2
sudo chown -R www-data:www-data /var/www/html
# Error Log
sudo tail -f /var/log/apache2/error.log
@AnythingLinux

Copy link
Copy Markdown
Author
Screenshot from 2026-08-20 23-36-48 Screenshot from 2026-08-20 23-37-17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment