sudo apt purge apache2
sudo apt remove apache2
sudo apt autoremove

To check if something related apache2 still remain in my os.

sudo find /  -name  'apache*'
ls /usr/lib/apache2/modules
httpd.exp             mod_authnz_ldap.so      mod_cgid.so          mod_file_cache.so           mod_lua.so             mod_proxy_http2.so     mod_slotmem_plain.so
libphp7.0.so          mod_authz_core.so       mod_cgi.so           mod_filter.so               mod_macro.so           mod_proxy_http.so      mod_slotmem_shm.so
mod_access_compat.so  mod_authz_dbd.so        mod_charset_lite.so  mod_headers.so              mod_mime_magic.so      mod_proxy_scgi.so      mod_socache_dbm.so

Why so many apache2's module can't be removed?


Because you only removed the package apache2 and not all related packages.

$ dpkg -S /usr/lib/apache2/modules/mod_access_compat.so
apache2-bin: /usr/lib/apache2/modules/mod_access_compat.so

mod_access_compat.so is in apache2-bin. the php module obviously is from PHP.

Use dpkg -S to check what packages the files come from.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.