LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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


Reply
  Search this Thread
Old 01-16-2002, 11:08 AM   #1
ForumKid
Member
 
Registered: Dec 2001
Posts: 195

Rep: Reputation: 30
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
 
Old 01-16-2002, 08:44 PM   #2
ForumKid
Member
 
Registered: Dec 2001
Posts: 195

Original Poster
Rep: Reputation: 30
Well then.............does anyone know how?
 
Old 01-16-2002, 08:54 PM   #3
Scotty2435
Member
 
Registered: Dec 2001
Location: Waco, Texas USA
Distribution: Redhat 7.1
Posts: 232

Rep: Reputation: 30
i'd put this in the website sugggestions page Jeremy reads and posts there I think
 
Old 01-16-2002, 09:04 PM   #4
jeremy
root
 
Registered: Jun 2000
Distribution: Debian, Red Hat, Slackware, Fedora, Ubuntu
Posts: 13,597

Rep: Reputation: 4080Reputation: 4080Reputation: 4080Reputation: 4080Reputation: 4080Reputation: 4080Reputation: 4080Reputation: 4080Reputation: 4080Reputation: 4080Reputation: 4080
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.

--jeremy
 
Old 01-17-2002, 01:40 AM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
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.
 
Old 01-17-2002, 10:10 AM   #6
ForumKid
Member
 
Registered: Dec 2001
Posts: 195

Original Poster
Rep: Reputation: 30
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.

Thanks
 
Old 01-17-2002, 05:17 PM   #7
ForumKid
Member
 
Registered: Dec 2001
Posts: 195

Original Poster
Rep: Reputation: 30
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
 
Old 01-18-2002, 03:13 AM   #8
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 47
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.
 
Old 01-18-2002, 05:35 AM   #9
ForumKid
Member
 
Registered: Dec 2001
Posts: 195

Original Poster
Rep: Reputation: 30
Hi,
I found a few. Changed them and still nothing.

Question: Is there a way to just compile httpd.h somehow. When httpd.h is compiled, where is the object. And can the object be modified.

My security book says the headers are coming from httpd.h. I changed and somehow i have to recompile the sucker.
Thanks again
 
Old 01-18-2002, 06:05 AM   #10
ForumKid
Member
 
Registered: Dec 2001
Posts: 195

Original Poster
Rep: Reputation: 30
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.

I thank everyone.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Hi,Jeremy vanhelsing Linux - Software 3 06-05-2004 04:51 AM
Apache source code hack - Server response headers 2.0.49 fireman949 Linux - Software 2 05-24-2004 10:31 AM
Change RedHat 9 OS response serpisors Linux - General 8 02-29-2004 09:37 AM
change port# response from dns charon's coin Linux - Networking 1 08-24-2003 08:44 PM
Jeremy: You're Not sensible futurist General 20 04-08-2002 06:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration