Welcome to
The DFN Weekly

Server Knows Best

By

Old Tom

OT Scripts

Hey! You think this article is so basic that you can't be bothered? Read the last paragraph - NOW. But, if you're ready for a view of the basics that you haven't seen before, start right here at the beginning!

If you need help with your desktop PC, it makes a difference as to whether that computer is a Windows box, a Macintosh, or an Atari. Right? It's the same with your server. Is it unix/linux, Microsoft, or something else?

So. How do you know what server software you have? At first glance, the answer seems easy: You just ask. If you're reading this article, though, that's not the real question, is it? The question is, how do you find out what someone else's server software is?

Why do you care?

Someone asks you a question. You give an answer, and then find out it was a Macinstosh question, and you gave a Windows answer. The person who asked, not recognizing the importance of the distinction, attempted to follow the advice, with puzzling and silly results.

Of course no Macintosh person will be misguided enough to ask a Windows person a computer question. But, with your server, the distinction is not so obvious. Your server is "out there" somewhere. What you see is your connection to it. The ftp program is there on your desktop. Your graphics programs are there on your desktop. Your page editor is there on your desktop.

Your work environment is not your server. Your work environment is your desktop PC. Who cares what your server is, so long as it runs your web pages okay?

In the adult world, as you know all too well, you do care. Hotlinking happens. Sitesuckers exist. At some point you'll be using CGI scripts on your server, or some other form of dynamic content.

At that point, you'll need to know more about your server. And that means you'll need to know what kind of server you've got. Hotlinking happens from Day One - even though you might not be aware of it.

If you know this, you know enough to ask your hosting company what kind of software is on your server. But... what if you don't know?

Or, more to the point, what if the person who does not know, asks you a question? The obvious answer is to explain to them, how to ask their hosting company the question. But, as we know all too well, that level of help isn't very productive. Like as not, that person is going to feel stupid for asking the question, and the hosting company may well encourage that impression.

So... how do you help this person? Can you just assume they're on a unix/linux server running Apache and answer them accordingly? If they're not, and they attempt to follow your advice, where is your credibility?

The answer is simple: Just go to their server, and ask it. Get a URL. From that URL you have a domain name. With the domain name, you can ask the server.

Meanwhile, however, I do a couple more things when a new person comes along with a question. I look up their domain registration, and I check their hosting company.

What does the domain registration tell me? First and foremost, it gives me a "bullshit level." For example, raw newbies don't have cloaked domain registrations. Nor are they usually the registered owners of their own domain servers. Nor are they usually registered in a corporate or partnership name.

Second, the domain registration put together with my impression from viewing the page source of their site, tells me how to best answer their question. I can place my answer in terms of what's already familiar to them. And, I can suggest that they're really asking the wrong question, and attempt to get to the real question.

If they are a raw newbie, I can tell who their webhosting company is, from the domain registration. How? By knowing that the webhosting company very probably owns the nameserver(s) listed on the registration.

For example, someone wanders in looking for suggestions on his first-ever tgp gallery page. The domain registration is three days old, and it looks like he's on a non-adult host charging three dollars a gig, but ten dollars a gig for overage. Do you really think meta tags are the first thing we need to worry about here? Not hardly. Not with 60k pictures getting listed with al4a.

By the way, if the above "due diligence" pegged your Bullshit Meter, you might want to take another moment to do further checking with AltaVista and Google. Use the link:domain.com search with AltaVista to see what turns up; use various search terms from the domain and from the domain registration with Google, to see what you see.

However, we still have that one essential question unanswered: What server software are you running? You certainly don't want to humiliate yourself by assuming one thing, and having it turn out to be another.

The answer is very, very simple. The answer is for you to directly ask the server. Unfortunately simple answers on Windows PCs are NOT simple. First I'll show you what it looks like on linux, and then show you how to do the same thing from your Windows MS-DOS thingy. My typing is in green, and the server's responses are in blue.

telnet mydomain.com 80
Trying 127.0.0.2...
Connected to mydomain.com (127.0.0.2).
Escape character is '^]'.
HEAD / HTTP/1.0
Host: mydomain.com
  you must type a blank line here
HTTP/1.1 200 OK
Date: Tue, 30 Jul 2002 15:56:34 GMT
Server: Apache/1.3.19 (Unix) (Red-Hat/Linux) mod_ssl/2.8.1 OpenSSL/0.9.6 DAV/1.0.2 PHP/4.0.4pl1 mod_perl/1.24_01
Last-Modified: Fri, 26 Jul 2002 11:01:42 GMT
ETag: "1cb536-8-3d412c16"
Accept-Ranges: bytes
Content-Length: 8
Connection: close
Content-Type: text/html
Connection closed by foreign host.

The above tells me that mydomain.com is hosted on a Red Hat Linux system running the Apache server. I get that information from the line beginning with Server:.

Here's how you do the same thing from the MS-DOS thingy on Windows ME:

  1. type 'telnet' to bring up the separate telnet window.
  2. In the telnet window, choose the first item on the Connect menu, Remote System... .
  3. For 'Host Name' enter the domain name. (You may use vnwr.com for practice.) For 'Port' enter 80. Press the 'Connect' button.
  4. You are now typing blind. It won't tell you that you're connected. Just wait until the hourglass cursor changes back to the text insert cursor. Just start typing. You won't see a thing, but type anyway.
  5. Type the two lines:
    HEAD / HTTP/1.0
    Host: domain.com
    followed by a blank line. For 'domain.com' use the same domain name that you used in the Remote System... dialog box. telnet will respond with the information you need, and a popup saying 'Connection lost'.

If you want to see the entire web page, use GET instead of HEAD. For some servers the above two lines (HEAD and Host:) are insufficient; but even so you should get an indication of what the server software is, which is all you care about.

For that matter, if HEAD and Host: do not generate the expected response, that's another indication that you need to be careful in how you answer beginners' questions. Things are more complicated than you had at first assumed.

By the by, once you learn that little trick of connecting to a server, you have discovered the tip of the iceberg. How do you know if a url is redirecting - twice? What cookie is actually getting set? Why did that ErrorDocument get triggered? You can use this trick to instantly find your answers. (Why this trick provides those answers, should become obvious as you try it.)

Are you a bit more advanced? Have you wondered how to test your htaccess file? You can test and prove your setup line by line, using that little trick I call Server Knows Best.

Old Tom

The DFN Weekly Staff
Jojasa ... Chief Editor - Wingnut ... Asst. Editor
VNWR Staff
Voltar ... President - Old Tom ... Vice President
Jojasa ... Vice President - LadyB ... Vice President

  Next Page

©2002 VNWR. All rights reserved.