HTTP or web servers provide the ability to host web site content. Unless there is a need to run the system as a web server, it is recommended that the package be deleted to reduce the potential attack surface.
Solution
Run the following command to remove apache2 : # apt purge apache2