Display or list web server headers
If you are looking to debug a problem with HTTP server and would like to see HTTP requests / header responses in raw format, use shell tools or Firefox extensions.
Why do I need to dig out web server headers?
[a] Help debugging web application.
[b] See which kind of web server the remote site is using.
[c] See the cookies sent by remote site
[d] Learn http protocol and much more
Let us see Linux / UNIX command line tools to dig out headers.
wget command
wget command is not just downloading utility. It can be served as debugging tool. You need to pass -S option to wget command, which will print the headers sent by HTTP servers and responses sent by FTP servers.
$ wget -S http://theos.in
Output:
--01:32:15-- http://theos.in/
=> `index.html'
Resolving theos.in... 74.86.49.131
Connecting to theos.in|74.86.49.131|:80... connected.
HTTP request sent, awaiting response...
HTTP/1.0 200 OK
Connection: close
X-Pingback: http://theos.in/xmlrpc.php
Content-Type: text/html; charset="UTF-8"
Date: Thu, 16 Aug 2007 20:02:16 GMT
Server: lighttpd
Length: unspecified [text/html]
[ <=> ] 44,214 32.56K/s
01:32:17 (32.50 KB/s) - `index.html' saved [44214]
If you are just intrested in headers pass --spider option to wget. With this option wget behave as a Web spider, which means that it will not download the pages, just check that they are there.
$ wget -S --spider http://theos.in/
Other command line tools
UNIX / Linux offers so many options. You can try out old good telnet command, lynx browser, curl command and other tools:
$ lynx -head -dump http://theos.in/
$ curl -I http://theos.in/
You can use telnet as follows:
$ telnet theos.in 80
Output:
HEAD /index.php HTTP/1.1
Firefox extension
If you are using Windows or just wanted to get information on fly, try firefox extension - LiveHTTPHeaders. It adds a 'Headers' tab in 'View Page Info' of a web page. You can also see a tool in the 'Tools->Web Development' menu to be able to display http headers in real time while pages are being downloaded from the Internet or web server. It also allows you edit request headers and replay an URL (good for testing web app security).
Download LiveHTTPHeaders
=> Visit project download page here
Other options
You can use specialized tools such as WireShark network protocol analyzer or tcpdump for the same purpose.
Want to stay up to date with the latest Linux tips, news and announcements? Subscribe to our free e-mail newsletter or RSS feed to get all updates.
You can Email this page to a friend.
You may also be interested in other helpful articles:
- How do I monitor Linux/BSD system over time without scrolling output?
- Howto: build Linux kernel module against installed kernel w/o full kernel source tree
- Linux Iptables Firewall: Log IP or TCP Packet Header
- nixCraft FAQ Roundup
- Allow normal user to watch tv via xawtv
Discussion on This Article:
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!
Tags: apache_headers, curl_command, http_headers, lighttpd_headers, LiveHTTPHeaders_plugin, lynx_command, ms_iis_headers, view_web_server_headers, wget_command



I want to design a tool using php that can allow anyone to check any website’s server information like hosting server, ip address and other thing from server header. I haven’t worked on Linux though, can you help me in that?