March 4, 2023 . 1 MIN READ
A simple and straightforward method that worked for me is outlined below:
Stop Apache2
Uninstall Apache2 and its dependent packages
or
Remove unused dependencies
Check for remaining configuration files
Remove leftover configuration directories
If the output shows something like:
remove the directory and any remaining configuration files:
This will completely remove Apache2 from your Ubuntu server.
Reference:
https://phpcod.com/how-to-remove-apache2-from-ubuntu-server/