Docstoc

Introduction to Servers on the Web

Document Sample
Introduction to Servers on the Web Powered By Docstoc
					T5L3

Introduction to Servers on the Web
Introduction
This lesson is designed for you to gather information about servers and their use in a web environment. When you finish this lesson, you should be able to:       Describe what a server is. Identify popular server software. Describe the difference between relative and absolute path names. Describe common file naming conventions. Describe what MIME types are. Describe a generic procedure to upload files to a web server.

Without servers, the web would not exist. While you do not need to become a web server administrator for this course, you do need to obtain a certain amount of knowledge about them to successfully build web pages and sites. First, you need to know: What is a Server? Second, you should know about: Popular Server Software You also need to understand how HTML documents are stored on a server, and the common conventions that are followed: Absolute vs. Relative Pathnames File Naming Conventions MIME Types Finally, you need to know how to transfer HTML files, graphics, and other media files from your local computer to your server so they are available to the entire world wide web: Uploading Documents

Additional Resources
Webmonkey - Backends
http://www.hotwired.com/webmonkey/backend/?tw=backend

WebMonkey - Apache
http://www.hotwired.com/webmonkey/backend/backend_more.html - apache

1

T5L3

<devhead> - Servers
http://www.zdnet.com/devhead/filters/servers/

webreview.com - Servers
http://webreview.com/wr/pub/Servers

Web Server Features
http://webreview.com/pub/sections/appserver/index4.html

2

T5L3

What is a Server?

[[I developed this graphic - OK to use if you want - Brett]]

Nearly all web pages are delivered as follows. A remote server (it can be anywhere in the world) is connected to the Internet and thus to the World Wide Web. A server is a computer that can receive requests (for information) from other computers (called clients) and answer those requests. A client computer is connected to the World Wide Web by either a direct connection or via a modem. The client computer is running a piece of software called a browser that translates the electronic signals from the web into text, graphics, sounds, movies, and so on. Web servers answer requests from client computers running browser software. Web servers can serve HTML documents and execute other programs (like CGI files) upon request, using a protocol named Hypertext Transfer Protocol (HTTP). Please note that a modem connection to the WWW is much slower than a direct connection. This is reflected in the diagram with a smaller pipe. Just as more water can travel through a larger pipe in a set amount of time, so can more information pass through a direct connection than through a modem in a set amount of time. A special type of server for the web is named an application server. Application servers differ from plain web servers in that they can connect to many other resources outside the web environment. Application servers offer an integrated Web development platform that allow you to connect and manage a variety of enterprise resources such as Web servers, databases, and legacy application systems.

3

T5L3

Popular Server Software
Many popular web servers run on the Unix platform. However, there are web servers for Windows NT, Windows 95/98, and the Macintosh platforms as well. The pros and cons of different web servers and different delivery platforms is beyond the scope of this course. Listed below are some of the more common servers and some basic information about them. NCSA Server Publicly-available server software for the Unix platform. It is maintained by the National Center for Supercomputing Applications at the University of Illinois at UrbanaChampaign. Apache Powerful and free, Apache may be the most popular web server. It began on Unix, but is being ported to other platforms. CERN This Unix-based server is maintained by the World Wide Web Consortium ( http://www.w3.org/), and is free. Netscape Servers Netscape provides a variety of servers to meet different customer needs. They run on both Unix and NT platforms. Internet Information Server (IIS) This is a free server from Microsoft. It runs on Windows NT and 95/98 platforms.

4

T5L3

Absolute Versus Relative Pathnames
There are two different ways for an HTML document to call another HTML document, graphic, or other media element - using an absolute or a relative pathname. An absolute path is the entire path to a file. An absolute pathname looks like this: <A HREF="http://www.mypage.com/products/wombatchow.html">. Absolute pathnames are usually used when linking to a file that is located on a remote server. For example, if you want to link to another site entirely, you would probably use an absolute pathname. A relative path is a partial path to a file. A relative pathname looks like this: <IMG SRC="wombat.gif">. It’s *relative* to where we are at the moment in the directory structure. Relative paths are usually used when linking to a file that is stored on the same server as the calling file. For example, if you have an HTML file that displays a graphic, you may store the file and the graphic in the same place on the server. If so, you can use a relative path to call and display the graphic. Why should you use relative pathnames? It makes it easy to move an entire site from place to place without breaking links in the process. Imagine if you developed a web page on your local machine, and that page called a single GIF graphic. Using absolute pathnames, you would have to specify the exact location of the graphic , as in IMG SRC="c://mywebsite/wombat.gif">. When you moved this page and graphic to a server, you would have to change this to <IMG SRC="http://www.mypage.com/products/wombat.gif">. Imagine what this would mean, in a huge site with hundreds of links ! Using relative links, you can just specify the local storage relationship. In the above example, we could specify <IMG SRC="wombat.gif"> one time, and when we transferred the files up to the server, as long as they retained their relative positions, we would know the graphic would display properly when called. So, most of the time you should use relative links within a site you are developing. It makes your entire site portable.

5

T5L3

Server WebSite

pages myPage.htm

graphics chow.gif

A simple site. [[I developed this graphic - OK to use]]

Here is an example of a simple site, consisting of one HTML page and one GIF graphic. The HTML file is stored in the pages folder. The GIF graphic is stored in the graphics folder. Both these folders are inside the WebSite folder/directory. Notice the graphic is stored in a separate folder or directory than the HTML page. If both were stored in the same location, the HTML page could have called the GIF graphic like this: <IMG SRC="chow.gif ">. That won't work in this example. You need some way to specify that the graphic is in a different folder. This is easy to accomplish, by using two periods and the forward slash character to "back out" of the pages folder, then by specifying the folder/directory we wish to enter: <IMG SRC="../graphics/chow.gif"> This means..."go back up one level to the WebSite folder, then go down into the graphics folder and use the image called chow.gif." The ../ means "back up." What if you needed to back up two levels? Use "../../" to do so. What if you need to go down a level? Imagine that the folder/directory pages contained another folder/directory named links, and you wanted to call up an html page within the links folder named mylinks.htm. You would use the tag: <A HREF="links/mylinks.htm"> .

6

T5L3

File Naming Conventions
Different servers use different file naming conventions. For example, a Macintosh file named MyGreatWebPage.html might be converted to mygreatw.ebp on some Unix platforms! Obviously, this will cause great problems. The most recognized format for file names is the 8.3 scheme - eight (or less) characters, followed by a period, followed by a three-character extension that usually identifies the file type. It is also best to keep all characters in lower case, as upper case causes some servers problems. In the example above, renaming the file to mywebpg.htm should ensure it can be loaded onto any server without a problem. There are other things to avoid in filenames as well, such as spaces, and special characters, like ?, %, #. Don't ever use a colon (:) - that is used on a Macintosh to indicate a folder. Don't ever use a forward (/) or a backward (\) slash - they are used in Windows and Unix to indicate a subdirectory.

7

T5L3

MIME Types
Servers add a header to each document that identifies what type of file it is. When the browser receives it, it knows what to do with it; display it, download it to disk, and so on. The system used to identify media types closely resembles MIME (Multipurpose Internet Mail Extension), originally developed so e-mail programs could handle attached documents correctly. If you want to deliver media beyond HTML files and the standard GIF and JPEG files, chances are your server will need to be configured to serve these files with the proper MIME type. This is done differently for each server, although many of them use the file extension to identify the MIME type. In any event, you should contact your server administrator if you think a MIME type must be added to your server. If you have a file they should appear or download in a certain way and doesn't, the first thing to check is its MIME type setting. For more information on MIME types, please see the lesson on Browsers

8

T5L3

Uploading Documents
The most common procedure people perform on a server is uploading files to it, so they are available to the web. After all, it does you no good to create a web site and leave it on your local machine - nobody else will be able to view it! There are many ways to accomplish this task, but the most common method is called FTP - File Transfer Protocol. Special programs exist on the Macintosh, Windows, and Unix platforms to assist you in using FTP. It is impossible to list a specific method here; dozens exist. You need to find out which method is appropriate for your environment. Listed below are the generic steps you would use to transfer a file or group of files from a local machine to a server via FTP. 1. Launch the FTP program. 2. Locate the appropriate directory on the server where you want to store your files. 3. Specify the transfer mode. You can transfer files as text (ASCII), binary, or raw data. HTML files can be transferred as text or raw data. Graphics should be transferred as binary or raw data, as should other media files. If you transfer a file and it no longer acts as it should, chances are you have used the wrong transfer method. Delete the damaged file and try again. 4. Upload the files to the server. 5. Disconnect/quit from the FTP program. Always make sure you test the files after they are transferred to make sure the transfer worked properly. Make sure the web site can be accessed by all eligible web users.

9

T5L3

Summary
This lesson is designed for you to gather information about graphics and their use in a web environment. When you finish this lesson, you should be able to:       Describe what a server is. Describe popular server software. Describe the difference between relative and absolute path names. Describe common file naming conventions. Describe what MIME types are. Describe a generic procedure to upload files to a web server.

A short summary of these topics are listed below. If you cannot do these things, you should review the lesson at least once. If you are still having difficulty, you should consider other sources of information that compliment this lesson, such as textbooks, tutors, and instructors. What is a Server?     A server is a computer that can receive requests from other computers (called clients) and answer those requests. Web servers answer requests from client computers running browser software. A special type of server for the web is named an application server. Application servers offer an integrated Web development platform that allow you to connect and manage a variety of enterprise resources such as Web servers, databases, and legacy application systems.

Popular Server Software      NCSA Apache CERN Netscape Servers Internet Information Server (IIS)

Absolute Versus Relative Pathnames     An absolute path is the entire path to a file. An absolute pathname looks like this: <A HREF="http://www.mypage.com/products/wombatchow.html">. Absolute pathnames are usually used when linking to a file that is located on a remote server. A relative path is a partial path to a file.

10

T5L3

 

A relative pathname looks like this: <IMG SRC="wombat.gif">. It’s *relative* to where we are at the moment in the directory structure. Relative paths are usually used when linking to a file that is stored on the same server as the calling file.

File Naming Conventions   The 8.3 file naming convention works in all environments. The characters used should be letters and numbers only.

MIME Types    Servers add a header to each document that identifies what type of file it is. This header is called a MIME type. MIME types tell the server how to deliver the file, and they tell the browser how to handle the file once it's received.

Uploading Documents   The most common software used to transfer files from a local machine to a server is FTP (File Transfer Protocol) software. The most common FTP procedure is: 1. Launch the FTP program. 2. Locate the appropriate directory on the server where you want to store your files. 3. Specify the transfer mode. You can transfer files as text (ASCII), binary, or raw data. HTML files can be transferred as text or raw data. Graphics should be transferred as binary or raw data, as should other media files. If you transfer a file and it no longer acts as it should, chances are you have used the wrong transfer method. Delete the damaged file and try again. 4. Upload the files to the server. 5. Disconnect/quit from the FTP program.

11


				
DOCUMENT INFO
Shared By:
Categories:
Stats:
views:12
posted:1/4/2010
language:English
pages:11