New Perspectives On Web Design

(C. Jardin) #1

CHAPTER 8 How to Fix The Web: Obscure Back-End Techniques and Terminal Secrets


These lines are mostly HTTP headers. The HTTP/1.1 200 OK says that
the server also speaks version 1.1 of HTTP and gives the successful HTTP
response code 200. Other common responses are 500 for Internal Server
Error and 404 for File Not Found. It then continues with the HTML. If the
Connection header specified “keep-alive” then telnet will wait for your
next request and you’ll need to type Control + ] and then “quit” to exit.
If the Connection header said “close” then it will finish by itself and say
“Connection closed by foreign host” at the bottom.

finDing YouR webSiTe
The 200 code means that your home page is okay, and you should be able to
visit it in your browser. However, it may not show what you expected, and
your fabulous Widget 3000 page may still be absent.

viRTual hoSTS anD STReaMS
As mentioned above, many servers host multiple websites. One of these is
the default website. It is the website you get when you visit the server by IP
address http://80.72.139.101/ instead of by name, or when you leave off the
Host: line in the HTTP request while telnetting. The rest of the websites
are known as virtual hosts. Every one of these websites has a physical
location on the server known as its document root. To further investigate
your website woes, you need to discover its document root.
Fortunately and sensibly, most server management packages like
Plesk store their virtually hosted websites according to their domain
name, so you can usually just find directly on the domain name. The / in
the command below tells find to search the whole file system, the -type d
looks only for directories, and the -name part searches for any directories
containing “smashingmagazine”. The asterisks are wild cards. You’ll
need to either escape them \*smashingmagazine\* or put them in quotes
“*smashingmagazine*”:
Free download pdf