Published January 25, 2018 by

Turn off shows Apache version, OS and Port information at 404 not found

Apache displays its version, Server OS and Port Number where any page not found in websites.

In order to prevent Apache web server from displaying this information, we have to modify 'server signature' available in the Apache configuration file.

We have also set 'ServerTokens Prod' that tells the web server to return the only apache and suppress the OS major and minor version

Edit apache virtual host file.

# vim /etc/httpd/conf/httpd.conf                   ## for centos/redhat
# vim /etc/apache2/apache2.conf                  ## for ubuntu/debian

Add following line into virtual host file

ServerSignature Off
ServerTokens Prod

Restart Apache

# service httpd restart                                           ## for centos/redhat
# systemctl restart apache2                           ## for ubuntu/debian

Now apache shows 404 page not found look like this: