Apache httpd Security Tips

ServerSignature Off
ServerTokens Prod

Raspberry Pi Raspbian Location: /etc/apache2/conf-available/security.conf

Update regularly

httpd -v
yum update httpd
apt-get install apache2

Disable /icons/ directory listing

  • Edit /etc/httpd/conf.d/autoindex.conf
  • Comment line: # Alias /icons/ “/usr/share/httpd/icons/”
  • Disabling icons listing prevents non-loading image in diretory listings!

HTTPOnly and Secure cookie flag

Check cookie page using: https://gf.dev/secure-cookie-test

Add the line below to the file /etc/httpd/conf/httpd.conf (CentOS 7 – VestaCP)

Header edit Set-Cookie ^(.*)$ $1;HttpOnly;Secure

Restart Apache

service httpd restart

Windows & Linux & Mac Uptime

Learn run time before last boot.

Windows:

systeminfo | find "System Boot Time:"

or

Task Manager -> Performance

Linux & Mac:

uptime

Note: System boot time is wrong on Windows 10.

Solution:

  1. Press Windows key + r
  2. Type services.msc
  3. Click Windows Time
  4. Alternate click and then click Properties
  5. Change Startup type to Automatic
  6. Click Start if the service isn’t started