Why this matters for PCI DSS
PCI DSS 4.0 Requirement 2.2 mandates that system components are configured securely and that all unnecessary services and functions are removed or disabled. Requirement 2.2.5 specifically calls out that "if any insecure services, protocols, or daemons are present" they must be justified, documented, and have additional security features enabled.
None of the items above have a legitimate business case on a public e-commerce server, which is why removing them is the simplest path to compliance.
How to fix it
Apache — in your main config:
TraceEnable Off
ServerTokens Prod
ServerSignature Off
<Directory /var/www/html>
Options -Indexes
</Directory>
# Remove WebDAV modules:
sudo a2dismod dav dav_fs dav_lock
nginx — TRACE is not enabled by default. To strip the version from the banner:
http {
server_tokens off;
autoindex off;
}
Wrap unsupported methods to return 405:
if ($request_method !~ ^(GET|HEAD|POST|PUT|DELETE|OPTIONS)$) {
return 405;
}
IIS — disable TRACE and remove the Server header:
<system.webServer>
<security>
<requestFiltering>
<verbs allowUnlisted="true">
<add verb="TRACE" allowed="false" />
<add verb="OPTIONS" allowed="true" />
</verbs>
</requestFiltering>
</security>
<security><requestFiltering removeServerHeader="true" /></security>
</system.webServer>
For X-Powered-By in PHP, edit php.ini: expose_php = Off. In ASP.NET, remove the header in web.config via <httpProtocol><customHeaders><remove name="X-Powered-By" />.
Verify with: curl -I -X OPTIONS https://example.com/ and curl -I -X TRACE https://example.com/.