Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 18th, 2000, 02:26 AM
#6 #6 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2000
Location: Melbourne, Victoria, Australia
Posts: 104 #6 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Send a message via ICQ to #6
Hi,

Does anyone know how to get the server ID from an external web server? Like what they do on the Netcraft web server survey, how it returns the string saying Apache 1.3.14 / PHP 4.0.3 FreeBSD etc etc etc?

Is there a HTTP request or something?

Reply With Quote
  #2  
Old October 18th, 2000, 03:17 AM
freebsd
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Start here -> http://www.netcraft.com/os/accuracy.html

To get that locally, try $ENV{'SERVER_SOFTWARE'}

Don't forget to check out -> http://www.apache.org/docs/mod/core.html#servertokens

For security reasons, many servers tend to hide the SERVER_SOFTWARE or set it to minimal.

[This message has been edited by freebsd (edited October 18, 2000).]

Reply With Quote
  #3  
Old October 19th, 2000, 02:37 AM
#6 #6 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2000
Location: Melbourne, Victoria, Australia
Posts: 104 #6 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Send a message via ICQ to #6
Hmm thanks.

I had a look at the netcraft page and it doesn't actually explain how to get the response. Does the server send it's id with EVERY http response eg GET request or do you have to pass a specific http header or something?

[This message has been edited by #6 (edited October 19, 2000).]

Reply With Quote
  #4  
Old October 19th, 2000, 01:34 PM
freebsd
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
>>I had a look at the netcraft page and it doesn't actually explain how to get the response

I thought I gave you this link -> http://www.netcraft.com/os/accuracy.html Such link is to DETERMINE the OS since most of the time, the value is just "Apache/1.3.12 (Unix) " UNIX doesn't tell you whether it's FreeBSD or Linux or something else as there is NO WAY to get the accurate result. So netcraft actually uses a PROXY server, specifically SQUID, to look up the cache for the Server OS.

>>do you have to pass a specific http header or something?

Hehe, how about showing you a working example in Perl?

#############################################
#!/usr/local/bin/perl

use LWP::UserAgent;
my $URL = "http://www.devshed.com";
my $ua = new LWP::UserAgent;
$ua->timeout(60);
$ua->agent("Testing " . $ua->agent);
my $req = new HTTP::Request GET => $URL;
my $res = $ua->request($req);
my $mess = $res->server;

if ($res->is_success) {
&output_status($mess);
exit;
}
else {
&output_status("is_success Failed");
exit;
}

sub output_status {
my (@messages) = @_;
print "Content-type: text/htmlnn";
my $message;
foreach $message (@messages) {
print $message;
}
}
#############################################

The result should be:

InfoWest.COM-CUSTOM-Apache/2.5.6

That's the server software for infowest.com, where Devshed.com hosts at.

If you go to: http://www.netcraft.com/whats/?host=www.devshed.com

You would get: www.devshed.com is running InfoWest.COM-Custom-Apache/2.5.6 on FreeBSD

You see the difference is the OS (FreeBSD) which is determined by the Squid Proxy Server's cache as mentioned in http://www.netcraft.com/os/accuracy.html

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > Server Identification


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway