If you are using Ubuntu or Debian
Edit file /etc/apache2/conf-enabled/security.conf
Change “ServerTokens OS” to “ServerTokens Prod”
and
Change “ServerSignature On” to “ServerSignature Off”
Restart apache.
If you are using CentOS, RHEL or fedora
Edit file /etc/httpd/conf/httpd.conf
Change “ServerTokens OS” to “ServerTokens Prod”
and
Change “ServerSignature On” to “ServerSignature Off”
Restart apache.
If there are no entries of these lines, add both lines in the file.
Restart apache
Edit file /etc/apache2/conf-enabled/security.conf
Change “ServerTokens OS” to “ServerTokens Prod”
and
Change “ServerSignature On” to “ServerSignature Off”
Restart apache.
If you are using CentOS, RHEL or fedora
Edit file /etc/httpd/conf/httpd.conf
Change “ServerTokens OS” to “ServerTokens Prod”
and
Change “ServerSignature On” to “ServerSignature Off”
Restart apache.
If there are no entries of these lines, add both lines in the file.
Restart apache