3

Ok, so I uninstalled apache2 (long story ... ).

sudo service apache2 stop
sudo apt-get purge apache2 apache2-utils apache2.2-bin apache2-common

whereis apache2

Then I deleted all of the directories that were listed with sudo rm -rf

Now I am trying to re-install apache2 and nothing seems to work.

sudo apt-get install apache2

returns "apache2 is already the newest version"

Some searches led me to try

sudo apt-get install apache2 -d --reinstall

Which showed nothing updated:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 93 not upgraded.
Need to get 0 B/208 kB of archives.
After this operation, 0 B of additional disk space will be used.
Download complete and in download only mode

whereis apache2

Returns

Apache2:

and nothing else.

Now I am stuck. Any ideas on how I can get apache back up?

I should also add that my distro is Raspbian Jessie

Output from dpkg -L apache2

/.
/etc
/etc/apache2
/etc/apache2/mods-enabled
/etc/apache2/conf-enabled
/etc/apache2/sites-enabled
/etc/apache2/apache2.conf
/etc/apache2/conf-available
/etc/apache2/conf-available/security.conf
/etc/apache2/conf-available/localized-error-pages.conf
/etc/apache2/conf-available/serve-cgi-bin.conf
/etc/apache2/conf-available/charset.conf
/etc/apache2/conf-available/other-vhosts-access-log.conf
/etc/apache2/envvars
/etc/apache2/magic
/etc/apache2/mods-available
/etc/apache2/mods-available/slotmem_plain.load
/etc/apache2/mods-available/speling.load
/etc/apache2/mods-available/autoindex.conf
/etc/apache2/mods-available/include.load
/etc/apache2/mods-available/authn_dbm.load
/etc/apache2/mods-available/mpm_worker.load
/etc/apache2/mods-available/reqtimeout.conf
/etc/apache2/mods-available/session_cookie.load
/etc/apache2/mods-available/log_forensic.load
/etc/apache2/mods-available/cgid.load
/etc/apache2/mods-available/proxy.load
/etc/apache2/mods-available/status.conf
/etc/apache2/mods-available/access_compat.load
/etc/apache2/mods-available/actions.conf
/etc/apache2/mods-available/buffer.load
/etc/apache2/mods-available/heartmonitor.load
/etc/apache2/mods-available/proxy_wstunnel.load
/etc/apache2/mods-available/mpm_prefork.load
/etc/apache2/mods-available/info.load
/etc/apache2/mods-available/dbd.load
/etc/apache2/mods-available/lbmethod_bybusyness.load
/etc/apache2/mods-available/authnz_ldap.load
/etc/apache2/mods-available/rewrite.load
/etc/apache2/mods-available/proxy_scgi.load
/etc/apache2/mods-available/userdir.load
/etc/apache2/mods-available/usertrack.load
/etc/apache2/mods-available/cgi.load
/etc/apache2/mods-available/mpm_event.conf
/etc/apache2/mods-available/alias.conf
/etc/apache2/mods-available/proxy_ajp.load
/etc/apache2/mods-available/ident.load
/etc/apache2/mods-available/ldap.conf
/etc/apache2/mods-available/dav_fs.load
/etc/apache2/mods-available/proxy_fdpass.load
/etc/apache2/mods-available/dialup.load
/etc/apache2/mods-available/sed.load
/etc/apache2/mods-available/mpm_event.load
/etc/apache2/mods-available/lbmethod_heartbeat.load
/etc/apache2/mods-available/ldap.load
/etc/apache2/mods-available/xml2enc.load
/etc/apache2/mods-available/mime.conf
/etc/apache2/mods-available/remoteip.load
/etc/apache2/mods-available/filter.load
/etc/apache2/mods-available/mime_magic.conf
/etc/apache2/mods-available/heartbeat.load
/etc/apache2/mods-available/lbmethod_byrequests.load
/etc/apache2/mods-available/unique_id.load
/etc/apache2/mods-available/autoindex.load
/etc/apache2/mods-available/authz_user.load
/etc/apache2/mods-available/mpm_prefork.conf
/etc/apache2/mods-available/info.conf
/etc/apache2/mods-available/cache_socache.load
/etc/apache2/mods-available/setenvif.conf
/etc/apache2/mods-available/authn_file.load
/etc/apache2/mods-available/slotmem_shm.load
/etc/apache2/mods-available/cache_disk.load
/etc/apache2/mods-available/deflate.load
/etc/apache2/mods-available/dav.load
/etc/apache2/mods-available/proxy_balancer.conf
/etc/apache2/mods-available/deflate.conf
/etc/apache2/mods-available/proxy_connect.load
/etc/apache2/mods-available/echo.load
/etc/apache2/mods-available/dir.conf
/etc/apache2/mods-available/actions.load
/etc/apache2/mods-available/authz_owner.load
/etc/apache2/mods-available/dump_io.load
/etc/apache2/mods-available/setenvif.load
/etc/apache2/mods-available/file_cache.load
/etc/apache2/mods-available/env.load
/etc/apache2/mods-available/ext_filter.load
/etc/apache2/mods-available/mime.load
/etc/apache2/mods-available/negotiation.load
/etc/apache2/mods-available/ssl.conf
/etc/apache2/mods-available/dav_lock.load
/etc/apache2/mods-available/dir.load
/etc/apache2/mods-available/cache.load
/etc/apache2/mods-available/ssl.load
/etc/apache2/mods-available/auth_digest.load
/etc/apache2/mods-available/authz_groupfile.load
/etc/apache2/mods-available/substitute.load
/etc/apache2/mods-available/authn_core.load
/etc/apache2/mods-available/proxy_ftp.conf
/etc/apache2/mods-available/socache_shmcb.load
/etc/apache2/mods-available/userdir.conf
/etc/apache2/mods-available/auth_basic.load
/etc/apache2/mods-available/suexec.load
/etc/apache2/mods-available/session_crypto.load
/etc/apache2/mods-available/allowmethods.load
/etc/apache2/mods-available/dav_fs.conf
/etc/apache2/mods-available/reflector.load
/etc/apache2/mods-available/charset_lite.load
/etc/apache2/mods-available/mpm_worker.conf
/etc/apache2/mods-available/session_dbd.load
/etc/apache2/mods-available/authz_core.load
/etc/apache2/mods-available/proxy_ftp.load
/etc/apache2/mods-available/proxy_express.load
/etc/apache2/mods-available/vhost_alias.load
/etc/apache2/mods-available/headers.load
/etc/apache2/mods-available/ratelimit.load
/etc/apache2/mods-available/proxy_http.load
/etc/apache2/mods-available/log_debug.load
/etc/apache2/mods-available/authz_host.load
/etc/apache2/mods-available/authz_dbm.load
/etc/apache2/mods-available/proxy.conf
/etc/apache2/mods-available/cache_disk.conf
/etc/apache2/mods-available/data.load
/etc/apache2/mods-available/status.load
/etc/apache2/mods-available/request.load
/etc/apache2/mods-available/mime_magic.load
/etc/apache2/mods-available/proxy_html.conf
/etc/apache2/mods-available/alias.load
/etc/apache2/mods-available/proxy_balancer.load
/etc/apache2/mods-available/proxy_html.load
/etc/apache2/mods-available/proxy_fcgi.load
/etc/apache2/mods-available/negotiation.conf
/etc/apache2/mods-available/reqtimeout.load
/etc/apache2/mods-available/authn_socache.load
/etc/apache2/mods-available/expires.load
/etc/apache2/mods-available/lbmethod_bytraffic.load
/etc/apache2/mods-available/auth_form.load
/etc/apache2/mods-available/authnz_fcgi.load
/etc/apache2/mods-available/authz_dbd.load
/etc/apache2/mods-available/authn_anon.load
/etc/apache2/mods-available/cgid.conf
/etc/apache2/mods-available/macro.load
/etc/apache2/mods-available/socache_memcache.load
/etc/apache2/mods-available/session.load
/etc/apache2/mods-available/asis.load
/etc/apache2/mods-available/lua.load
/etc/apache2/mods-available/socache_dbm.load
/etc/apache2/mods-available/authn_dbd.load
/etc/apache2/ports.conf
/etc/apache2/sites-available
/etc/apache2/sites-available/000-default.conf
/etc/apache2/sites-available/default-ssl.conf
/etc/logrotate.d
/etc/logrotate.d/apache2
/etc/bash_completion.d
/etc/bash_completion.d/apache2
/etc/cron.daily
/etc/cron.daily/apache2
/etc/default
/etc/default/apache2
/etc/init.d
/etc/init.d/apache2
/usr
/usr/lib
/usr/lib/cgi-bin
/usr/share
/usr/share/lintian
/usr/share/lintian/overrides
/usr/share/lintian/overrides/apache2
/usr/share/bug
/usr/share/bug/apache2
/usr/share/apache2
/usr/share/apache2/ask-for-passphrase
/usr/share/apache2/apache2-maintscript-helper
/usr/share/doc
/usr/share/doc/apache2
/usr/share/doc/apache2/README.backtrace
/usr/share/doc/apache2/README.multiple-instances
/usr/share/doc/apache2/migrate-sites.pl
/usr/share/doc/apache2/copyright
/usr/share/doc/apache2/examples
/usr/share/doc/apache2/examples/setup-instance
/usr/share/doc/apache2/examples/secondary-init-script
/usr/share/doc/apache2/examples/apache2.monit
/usr/share/doc/apache2/PACKAGING.gz
/usr/share/doc/apache2/README.Debian.gz
/usr/share/doc/apache2/changelog.Debian.gz
/usr/share/doc/apache2/NEWS.Debian.gz
/usr/share/doc/apache2/changelog.gz
/usr/share/man
/usr/share/man/man8
/usr/share/man/man8/apache2ctl.8.gz
/usr/share/man/man8/a2enmod.8.gz
/usr/share/man/man8/a2ensite.8.gz
/usr/share/man/man8/a2enconf.8.gz
/usr/share/man/man1
/usr/share/man/man1/a2query.1.gz
/usr/sbin
/usr/sbin/a2enmod
/usr/sbin/apache2ctl
/usr/sbin/a2query
/var
/var/lib
/var/lib/apache2
/var/cache
/var/cache/apache2
/var/cache/apache2/mod_cache_disk
/var/log
/var/log/apache2
/var/www
/var/www/html
/lib
/lib/systemd
/lib/systemd/system
/lib/systemd/system/apache2.service.d
/lib/systemd/system/apache2.service.d/forking.conf
/usr/share/bug/apache2/control
/usr/share/bug/apache2/script
/usr/share/man/man8/a2disconf.8.gz
/usr/share/man/man8/apachectl.8.gz
/usr/share/man/man8/a2dismod.8.gz
/usr/share/man/man8/a2dissite.8.gz
/usr/sbin/apachectl
/usr/sbin/a2disconf
/usr/sbin/a2enconf
/usr/sbin/a2dissite
/usr/sbin/a2ensite
/usr/sbin/a2dismod
  • 1
    Please edit the question adding the output of dpkg -L apache2 – Rui F Ribeiro May 26 '17 at 7:18
3

Resolved!

Ultimately, I found another post for something similar, and one of the responses worked for me:

sudo apt-get remove --purge apache2*
sudo apt-get --reinstall install apache2.2-common
sudo apt-get --reinstall install apache2

I think a more robust "purge" approach with the wildcard as well as the re-install of apache2.2-common was the trick.

  • Worked like a charm! – Sujeet Kumar Dec 11 '18 at 11:10
0

purge should have taken care of everything rm -rf likely broke something or things were already broken if purge did not work and reported no error. I recommend re-installing then running your setup script.

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.