Uninstalling & Reinstalling Apache2 On Ubuntu 22.04

To uninstall Apache2 on Ubuntu 22.04

$ sudo apt-get purge apache2

Reinstall Apache2 on Ubuntu 22.04

$ sudo apt-get install apache2

Make sure that Apache2 has been correctly installed and is working

$ systemctl status apache2.service