Skip to content

Instantly share code, notes, and snippets.

@UbuntuEvangelist
Last active September 13, 2021 19:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save UbuntuEvangelist/5c16cda557c95f134276a5da2a26feeb to your computer and use it in GitHub Desktop.
Save UbuntuEvangelist/5c16cda557c95f134276a5da2a26feeb to your computer and use it in GitHub Desktop.
How To Install the Apache Web Server on Ubuntu 20.04 [Quickstart]
# !/bin/sh
sudo -i
apt update
apt upgrade
apt install apache2
ufw allow in "Apache Full"
apache2 -v
service apache2 restart
systemctl enable apache2
service apache2 stop
nano /etc/apache2/apache2.conf
# Add ServerName 127.0.1.1 anywhere
ServerName 127.0.1.1
# Find 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 sctr+x
service apache2 start
service apache2 restart
service apache2 reload
service apache2 status
# Visit: http://localhost/
# For uninstall Apache2
sudo systemctl stop apache2
sudo apt purge apache2.*
sudo apt-get --purge remove apache2
sudo apt-get purge apache2-utils
sudo apt-get purge apache2.2-bin
sudo apt-get purge apache2-common
sudo rm -rf /etc/apache2
sudo rm -rf /etc/apache2
sudo rm -rf /usr/lib/apache2
sudo rm -rf /usr/include/apache2
sudo apt autoremove
sudo apt clean
sudo apt update -y
sudo apt upgrade -y
sudo dpkg -S `which apache2`
apache2 --version
sudo reboot
#apache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment