Call a URL an EARL
“URL” stands for Uniform Resource Locator, and since I’m so lazy, I pronounce it as “Earl”. It saves you 7 syllables, and possible embarrassment if you accidentally said “uniform refund lecturer”. Also, being from the USA, when speaking, I would say “an EARL” rather than “a EARL” since EARL begins with a vowel. If I were going to actually say the letters separately, I would say ” a U R L”, instead of “an U R L”. If i am typing it in an email message, or, this post, for example, I would use “an URL”, because I type pretty much like I speak.
Testing servers
We coders and/or network managers use multiple protocols to do our jobs. There are web servers, ftp servers, mail servers, and database servers. You can at least test them to see if they’re up by using telnet, and knowing a few commands can help you test functionality.
HTTP
Web servers default to use port 80. They can be set to listen of other ports, but 80 is the default. If you set one up to run on port 8000, you would have to use http:///www.example.com:8000 to get there, AND the HTTP:// is required. Using anything other than the default port requires you to let the browser know to use the http protocol.
So, let’s test the web server to see it it’s up:
telnet www.microsoft.com 80
If it’s not able to connect, you’ll get an error message, but in this case, we all know that Microsoft should always be up (?). Now test the functionality of it:
GET /
You should see some html there, like at least a <html><head><title>Microsoft Corporation</title> all the way down to the </html> tag.
The web server is up and functioning. Notice that the connection is immediately closed.
FTP
FTP is an entirely different protocol, and uses two different ports. THE DEFAULT ports are 21 for the commands, and 20 to transfer the data. We’ll only test the command port here.
telnet www.microsoft.com 21
Telnet to ftp.microsoft.com on port 21, and type “HELP” and hit enter. You’ll see a listing of all valid commands that their server supports.
220 Microsoft FTP Service
help
214-The following commands are recognized (* ==>’s unimplemented).
ABOR
ACCT
ADAT *
ALLO
APPE
….
So, the ftp server is up and functional. Whether or not you are authorized to get or put files is a matter of authentication.
SMTP
This is simple mail transport protocol, or just mail talk. The DEFAULT port is 25. Talking to your mail server is just as easy as HTTP and FTP. Telnet to yourmailserver.com on port 25. You should see a 220 greeting message like this (all lines with a numeric code at the beginning of the line came from the server):
220 Welcome Road Runner. WARNING: *** FOR AUTHORIZED USE ONLY! ***
ehlo austin.rr.com
250-hrndva-omtalb.mail.rr.com says EHLO to 70.114.203.216:56199
To send a message, use the commands shown below. :
mail from:<squeek@austin.rr.com>
250 MAIL FROM accepted
rcpt to:<squeek@austin.rr.com>
250 RCPT TO accepted
data
354 continue. finished with “\r\n.\r\n”
this is a test message
hit return, then a period, then a return to end the message, as you see above (\r\n.\r\n)
I can hit enter as many times as I want to
but enter, then . then enter, and I’m done.
.
In this case, my server refused the message, because I didn’t actually log in using my username/password. We wouldn’t want to let everybody and their chihuahua send SPAM via this server, correct?
Databases
We can do the same with databases, but the actual commands used are pretty complex, so I won’t go into that. The default port for Microsoft SQL server is 1433, and for MySQL it’s 3306.
The server that I have MSSQL Server on won’t come up. It worked the last time I turned it on, but this time it didn’t. That’s when things usually break, folks – when you turn them on.
OK, for MySQL:
telnet 127.0.0.1 3306
You should get a bit of garbage, but you should at least see the version of MySQL you’re using. I get 5.5.16, which is correct.
Ports
Most of us in the business already know this stuff, but for the others…
“So what are all of these port numbers” you ask? Think of them as doors into your house (server). Harold (the web server) only answers the front door, answers one request at a time, and promptly closes the door (as we saw above when testing – the connection is immediately closed).
Freddie (FTP) only listens to the back door, waits for a request, and (hopefully) sends you a file. He doesn’t close the door like Harold does, because you might want to ask for another file.
Sammy (SMTP mail server) only answers the side door. If you show him your identification, he will then accept a message from you to be sent to someone else. Like Freddie, he leaves the door open, in case you want to send another message.
To repeat: Web servers default to port 80. FTP servers default to port 21. SMTP servers default to port 25. A server can have multiple web servers, web sites, ftp services, and smtp servers; all you have to do is use different port numbers on each service. Universities used to use multiple ports on their one web server to differentiate between the different departments. They may still do that; I’m not in college any more.
Keep in mind that if you add too many doors, the house (server) will eventually fall down.