Reducing the information leaked by Apache makes automated fingerprinting harder and keeps version strings out of routine scans. Minimal banners do not fix vulnerabilities, but they do remove easy hints that help attackers match a target to known exploits. Many hardening baselines expect this basic reduction in exposed server details.

Two different mechanisms control what gets exposed. The Server HTTP response header is governed by ServerTokens, which determines whether the header includes only Apache or also includes version, OS, and module details. The HTML footer shown on server-generated pages (directory listings and default error documents) is governed by ServerSignature.

The steps below assume a Debian or Ubuntu layout with /etc/apache2 and the apache2 systemd unit name. Hidden banners still leave other identifying headers (application frameworks, reverse proxies, WAFs) untouched, so use this as a complement to patching, removing unused modules, and tightening configuration.

Steps to hide Apache server signatures:

  1. Open a terminal with sudo privileges.
  2. Find the current ServerTokens and ServerSignature settings in the Apache config tree.
    $ sudo grep -RIn --include='*.conf' -E '^[[:space:]]*Server(Tokens|Signature)\b' /etc/apache2
    /etc/apache2/conf-enabled/security.conf:12:ServerTokens OS
    /etc/apache2/conf-enabled/security.conf:23:ServerSignature On
    /etc/apache2/conf-available/security.conf:12:ServerTokens OS
    /etc/apache2/conf-available/security.conf:23:ServerSignature On
    ##### snipped #####

    RHEL-style installs usually use /etc/httpd and the httpd unit name.

  3. Open /etc/apache2/conf-available/security.conf for editing.
    $ sudoedit /etc/apache2/conf-available/security.conf

    sudoedit uses $EDITOR and writes changes as the file is saved.

  4. Set ServerTokens to Prod in /etc/apache2/conf-available/security.conf.
    ServerTokens Prod

    Prod reduces the Server header to Apache rather than a detailed banner.

  5. Set ServerSignature to Off in /etc/apache2/conf-available/security.conf.
    ServerSignature Off

    ServerSignature controls the footer on server-generated error pages and directory listings.

    Avoid multiple active ServerTokens or ServerSignature lines across included files, since the last one read takes effect.

  6. Save the file.
  7. Close the editor.
  8. Enable the security configuration snippet.
    $ sudo a2enconf security
    Conf security already enabled
  9. Test the Apache configuration syntax.
    $ sudo apache2ctl configtest
    Syntax OK
  10. Restart the Apache service to apply the changes.
    $ sudo systemctl restart apache2

    Restarting apache2 briefly interrupts active connections.

  11. Verify the Server header no longer includes a version string.
    $ curl -sI http://127.0.0.1/
    HTTP/1.1 200 OK
    Date: Mon, 29 Dec 2025 07:14:14 GMT
    Server: Apache
    Upgrade: h2,h2c
    Connection: Upgrade
    Last-Modified: Sun, 28 Dec 2025 06:15:52 GMT
    ETag: "29af-646fd0ef6f600"
    Accept-Ranges: bytes
    Content-Length: 10671
    Vary: Accept-Encoding
    Content-Type: text/html
    ##### snipped #####

    Use the public hostname or the relevant VirtualHost address to validate what external clients actually see.

  12. Verify the default error page has no server signature footer.
    $ curl -s http://127.0.0.1/does-not-exist
    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
    <html><head>
    <title>404 Not Found</title>
    </head><body>
    <h1>Not Found</h1>
    <p>The requested URL was not found on this server.</p>
    </body></html>

    A custom ErrorDocument may return different HTML, but the Apache signature footer should remain absent.