Install Apache2 web server

Installation

apt-get install apache2

Hints

DNS lookups

Doing reverse DNS hostname lookups on every request in apache (to have those domain names in the log file) is a bad idea as it will slow your server down, everybody seems to agree on that. Yesterday I noticed one of our servers doing just that, despite me not having remembered turning that feature on. Took me a bit of searching and cursing to find the culprit.

There are a few reasons why Apache (or Apache2) will start looking up hostnames:

  • HostnameLookups on somewhere
  • checking of allow / deny rules with domains instead of IP ranges, e.g. Allow from www.example.org or Deny from example.org
  • a rewrite rule with a condition like RewriteCond %{REMOTE_HOST} www.example.com (the last two I found on this thread)
  • using %h in a LogFormat directive instead of %a (%h will give you the hostname, no matter what HostnameLookups says, %a will give you the IP address)