Yo Jeremy...How the heck did you change your response headers????
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Yo Jeremy...How the heck did you change your response headers????
Hi,
Scanning http://www.linuxquestions.org with id serve from grc.com shows that you running "Server: Jeremys HTTPD (OS??)
".
Lets assume your running apache. Maybe you can help me.
1) Did u change httpd.h?
2) Did u change something else?
3) If its httpd.h, is there a way to reflect the changes without recompiling
4) If i have to recompile, is there a way to get the necessary scripts to recompile. Oracle http uses apache server. But it does not install with the necessary scripts to recompile.
Please help me since i Have been searching and trying to figure this out for almost a month
THanks
Distribution: Debian, Red Hat, Slackware, Fedora, Ubuntu
Posts: 13,597
Rep:
I read and post everywhere
As for how I made the web server do that, I wouldn't recommend what I did. You can edit the apache source to return whatever you want though. Offhand I wouldn't know the exact file to edit, but I quick look at the source should tell you.
You usually would look for a line like "#define VERSION" for 2.x series I think it's in include/httpd.h. Else you could try using apache-mod_headers (mod_headers.so) to change headers, but I havent got any experience with that.
Changes in httpd.h can't work w/o recompiling.
Hey guys,
I will take a look at apache-mod_headers (mod_headers.so) to see if i can find a way to do this and then ill let youz know. Most normal situations you can just edit httpd.h. But as i stated before, i cant recompile.
Well the module is not good because the main goal is to change the server version.
Taken from apache::
The Header directives are processed just before the response is sent by its handler. These means that some headers that are added just before the response is sent cannot be unset or overridden. This includes headers such as "Date" and "Server".
So what the F. I simply want to change the server thats shown for the response header. Nothing is ever easy. Ill take any more suggestions.
Thanks
If I telnet in to my apache server and give the command:
GET / HTTP 1.0
(followed by a blank line)
At the top bit it says something like
Server: Apache/1.3.20 (Unix)
Now if I scan the executable httpd I can find that exact same string.
strings httpd | grep "Apache/1.3.20 (Unix)"
So I guess if you can't recompile all you would have to do is use a hex editor to modify that string. Make sure you backup the original file just in case you totally mess it up. And remember the string you replace it with should be the same length. If it's shorter you can always replace the last few characters with spaces.
You'll also find more of them if you run the command
strings httpd | grep -i "apache"
I don't know when each one is used but I'll leave that to you to figure out.
well well well....I finally did it. Hey Mik!!! You the man.
I downloaded a free trial hex editor. The file to edit is httpd binary. I edited and changed all references of my server version and waaaaa laaaaa.
I start apache like this.
/bin/apachectl start
in the dir /bin there is a file called httpd. Thats the one to change just in case someone that reads this wants to do it.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.