Jump to content

[SOLVED] Changing "server" header with PHP?


Recommended Posts

You will find a number of web sites that suggest that you can simply use the Header set notation to modify the Server header on Apache 2.0. This not true,

 

If you're using Apache 1.3, the answer is that you have to edit the source code and recompile Apache. In particular, you'll need to edit the file src/include/httpd.h. Look for these lines:

  #define SERVER_BASEPRODUCT  "Apache"

  #define SERVER_BASEREVISION "1.3.31"

Change those to whatever amuses you. Recompile.

 

For Apache 2.0, the situation is similar, but different. Edit the file include/ap_release.h and look for these lines:

#define AP_SERVER_BASEPRODUCT "Apache"

#define AP_SERVER_MAJORVERSION "2"

#define AP_SERVER_MINORVERSION "0"

#define AP_SERVER_PATCHLEVEL "50"

 

If you happen to be running mod_security (you really should be), you can modify the Server header using the SecServerSignature directive:

SecServerSignature "MadTechie/2.0

 

GoodLuck

--MadTechie

Thanks that isn't what I am looking for though.

 

I am looking for a way to modify this header in PHP, dynamically, per page.

 

I am not looking for a way to just remove some certain information, and for this change to always have to be applied exactly a certain way to every single page on my website including non-PHP pages, and can only use on a host that not only allows Apache to be used as the web server but also allows me to delete the apache executable file and replace it with my own, customized one (almost NO hosts will even consider allowing this).

 

I have been searching for days and any help would be greatly appreciated.

 

Again, I am looking for a way to do this in PHP.

 

I just want to modify this header in PHP, just like I can modify other headers in PHP.

 

I would also like to edit the Date header but this is not nearly as important.

 

Thank you for taking the time to read this =D

the only ways i know of are listed above, any module would have to be setup on the server, (so your need access to it), and if you have access then you could just use

ServerSignature Off

 

you could use modsecurity, but your have to readup on it

 

see here find "Server identity masking"

 

hope that helps as thats the best i can offer

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.