modern-web-design-and-development

(Brent) #1

When you visit a website, your Web browser communicates with the Web
server software behind the scenes, sharing caching information, sending
and receiving cookies, encrypting and decrypting, unzipping and generally
managing your browsing experience.


You can bypass all of this and talk directly to the Web server software by
using the telnet command, available on Windows, Linux and Mac. It will
tell you conclusively whether your Web server software is alive. The
command ends with the port, which is almost always 80 :


ping@MyUbuntu:~$ telnet http://www.stockashop.co.uk 80

If all were well, then your Web server software would respond with a couple
of lines indicating that it is connected and then wait for you to tell it what
to do. Type something like this, followed by two blank lines:


GET / HTTP/1.1
Host: http://www.stockashop.co.uk

The first / tells it to get your home page; you could also say GET /
products/index.html or something similar. The Host line tells it which
website to return, because your server might hold many different websites.
If your website was working, then your Web server software would reply
with some headers (expiry, cookies, cache, content type, etc.) and then the
HTML, like this:

Free download pdf