Last active
August 20, 2026 17:54
-
-
Save AnythingLinux/8ae75f155b70638da0ba5b23b1c62424 to your computer and use it in GitHub Desktop.
Install Apache web server on an Ubuntu 24.04 LTS Server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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
commented
Aug 20, 2026
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment