Skip to content

Edoardo Vignati

– Always looking for something awesome –

Menu
  • About me
  • Studies
  • Publications
  • Skills
  • Portfolio
  • Projects
  • Career
  • Blog
Menu

Hide Apache and PHP version

Posted on 08/02/201921/06/2022 by Edoardo

Sometimes,  the most easy way for an hacker to exploit your server is just to know the version of the web server that you are running on your machine.

The first thing to do when you setup for example Apache, is to hide this information. In fact, the default setting is to show all the information about the web server in pages like 500, 403 or 404 etc…

It can be also useful to hide the version of your PHP in the HTTP response header.

How to do these? Just edit the Apache configuration file (usually /etc/apache2/apache2.conf)

$ sudo vim /etc/apache2/apache2.conf

If you can’t find it you can run:

$ locate apache2.conf

and simply add (or edit)

# To hide Apache signature
ServerSignature Off
# To hide PHP version
ServerTokens Prod

and remember to restart your Apache server

$ sudo systemctl restart apache2

In many versions of Apache you cannot completely remove the Server header, in these cases if you can override the server signature as it follows:

SecServerSignature "MyPersonalWebServer"

If you would like to setup a new web service on your server checkout the following post!


Buy Me A Coffee


This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  1. Edoardo on [SOLVED] XMLHttpRequest error in Flutter web is a CORS error06/01/2023
  2. Fabi on [SOLVED] XMLHttpRequest error in Flutter web is a CORS error20/12/2022
  3. Edoardo on How to install hplip on Ubuntu28/11/2022
  4. Alex K on How to install hplip on Ubuntu28/11/2022

© 2023 Edoardo Vignati | Powered by Minimalist Blog WordPress Theme
Manage Cookie Consent
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
Manage options Manage services Manage vendors Read more about these purposes
View preferences
{title} {title} {title}