1

Three days ago I noticed that my localhost on port 80 was occupied by an Apache server. I uninstalled it and started to find out if it was a sign of some kind of malware.

I found out from the logs:

  1. I definitely didn't install it myself, because there was no apt-get install apache2 command or anything similar in bash

  2. As I found out from the system logs, this server was installed along with the packages that are included in the git dependencies. That said, git was already previously installed on the system. That said, apache2 (I checked via apt-cache rdepends) was not a dependency of any other package.

  3. In the interval that apache2 with dependencies was installed, I was installing docker using the tutorial from the official site. After installing apache2 directly, I started the docker installation.

    sudo apt-get install apt-transport-https ca-certificates curl gnupg lsb-release sudo apt-get install docker-ce=5:20.10.9~3-0~ubuntu-focal docker-ce-cli=5:20.10.9~3-0~ubuntu-focal containerd.io 

apache2 dependencies in "secret" installing

apache2 dependencies in "secret" installing

end of "secret" installation and beginning of docker installing

end of "secret" installation and beginning of docker installing

logs from the day Apache2 was installed

0

1 Answer 1

2

With default apt settings, installing git-all causes apache2 to be installed because git-all depends on gitweb which recommends apache2 (or lynx or a package providing httpd).

Removing git-all wouldn’t automatically remove apache2; you’d have to run apt autoremove (and if any other installed package even suggests apache2, it wouldn’t be removed anyway).

2
  • Thanks for the constructive answer! Bottom line: is Apache2 needed for gitweb to work properly or can it be removed from the system without any consequences? Commented Nov 26, 2021 at 18:21
  • gitweb provides a web interface to git repositories, and relies on a web server. It can work with servers other than apache2, so you can remove apache2; but if you don’t want any web server, you might as well remove gitweb as well. Commented Nov 26, 2021 at 19:18

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.