What We Will Cover
Log Tails
Questions From Lesson 2?
- How much bandwidth did people calculate they needed?
- How many people have a domain name?
- Any questions about the quiz questions?
- Can review your results once the assignment period has expired
- Includes answers to questions
- Do not forget to submit your assignments before the due date!
- Do not forget to turn in all your exercises
- Check what you submitted -- some people put files in the wrong place
back to top
3.1: Server Users and Directories
Objectives
At the end of the lesson the student will be able to:
- Enable users to publish documents on a server
- Describe how urls are mapped to files
|
- Will cover general web server information in preparation for installation next week
back to top
3.1.1: Document Directories
- Purpose of a web server (
httpd) is to provide access to HTML documents
- Want to allow server to access only files meant for publishing
- By default, most web servers enable a single directory for web documents
- Any files put in this directory, or any subdirectories, will be available via a browser
- This directory is called the document root directory
- On Apache:
htdocs directory
- On IIS:
C:\Inetpub\wwwroot
- Others:
html_docs or htmldocs
- Never make root directory of your file system a document root directory -- Why?
Mapping URLs to Files
http://www.yourdomain.com/fun.html
Creating subdirectory named mysub will appear on file system as
C:\apache\htdocs\mysub
And on web server as
http://www.yourdomain.com/mysub/
Virtual Directories
- To access files outside this directory, must create an alias or virtual directory
- Alias maps a URL to another directory anywhere on the server
- Web server then knows to look for documents in these virtual directories
- When the server receives URL with a subdirectory, it checks the list of virtual directories
- If the URL subdirectory is the name of a virtual directory, the server looks in the corresponding ("mapped") directory for files
- If no virtual directory is available, then the server looks in the document root directory for the requested subdirectory
More Information
back to top
3.1.2: Server Users
- A server has accounts for local users that need to do things on server
- Server users typically create web materials for access by visitors
- Each server user should have his or her own account
- UNIX and Windows NT provide user-level access to files and resources
- User-level access controls which files users can access and what they can do to those files
- Account access usually controlled by username and password
- System administrators create accounts for users and give them their own directories to work in
back to top
3.1.3: User Directories
- Users log in to a server with their username and password
- Typically start in their home directory
- Users usually have a place to put files that are accessible on the web
- If only publishing files on the web, home directory itself might be available to the web server
- Usually special subdirectory in user’s home directory used specifically for HTML files
public_html
.html
webroot
- Some systems need permissions set on new file before web server can display it
- After uploading files, should always check the file by looking at it with a web browser
back to top
Lab Exercise 3.1
Instructions
- Start a text file named exercise3.txt
Will be adding to this file during the lesson -- save it often.
- Prepare the exercise header as described in the HowTo on submitting exercises
- Label this exercise: Lab 3.1
- Use the next 5 minutes to answer the following questions.
- Do not submit exercises until all from today's lesson are finished
Exercise Questions
- What are user accounts?
- How can a user make a document available on the web?
- How are URLs mapped to files on the server?
back to top
3.2: Server Administrators
Objectives
At the end of the lesson the student will be able to:
- Describe the roles and responsibilities of a system administrator
|
- Webmasters often required to perform system administration
- Overriding task of web server administrator is to make sure the server doesn't go down
back to top
3.2.1: Servers And Daemons
Daemons? Oh My!
- Daemon stands for Disk and
Execution Monitor
- They are long-running background processes that answer requests for services
- Term originated with Unix, but most operating systems use daemons in some form
- In Windows NT, 2000, and XP, daemons are called "services"
Setting Up Daemons
- When setting up system will need to install and configure appropriate services
- In Unix, the names of daemons conventionally end in "d"
- Examples include
inetd, nfsd, sshd, named, and lpd
- Apache daemon is called
httpd
- UNIX runs most daemons at startup
- Startup scripts are placed in
/etc/rc* directories
- After startup, a daemon listens for requests on a specified port
- Web server should be one of the last scripts to start during the boot process, if possible
Setting Up Services
- Daemons known as services on Windows NT, 2000, and XP
- Control panel allows the system administrator to start and stop services
- On XP: from Start, right-click on My Computer
- Select Manage from the list
- Can set services to start automatically when the system boots
back to top
3.2.2: Patches and Service Packs
- Another duty of system administrator is to keep server software up to date
- Patches often released for UNIX systems that fix bugs and security problems and provide enhancements
- Microsoft similarly releases fixes for Windows
- Microsoft also bundles fixes into service packs that fix many problems at once
back to top
3.2.3: Backup And Recovery
- System administrator should ensure that everything on the server is backed up regularly
- Most common problem: users (or your boss) inadvertently delete important files
- Full backup saves every file on your server
- Incremental backup saves only the files that have changed since the last full backup
- Need to perform full backup before incremental backups -- why?
- Textbook has discussion of backup plans on p. 90
back to top
3.2.4: Accounts and Quotas
- System administrator needs to maintain user accounts
- Create accounts for new users
- Delete accounts of users that no longer need access
- Maintain integrity of user accounts
- Can give users quotas to prevent taking up too much space on your file system
back to top
3.2.5: Other Responsibilities
Other common duties include:
- Installing and upgrading hardware and software
- Network configuration (changing IP addresses, etc.)
- Configuration testing (Does that new software work with our system?)
- Monitoring system security and availability
- Analyzing log files
back to top
Lab Exercise 3.2
Instructions:
- Label this exercise: Lab 3.2
- Use the next 5-10 minutes to answer the following questions.
- Do not submit exercises until all of them from today's lesson are finished
Exercise Questions
- Why is a good system administrator needed to ensure the integrity of your server?
- Develop a short backup strategy for your server.
back to top
Quiz
The Quiz/Exercise is open book, open notes and screen on. It is NOT open neighbor's books, notes, computer or quiz.
You may use your computer to work out the problems
You have 15 minutes to complete the test.
The link to WebCT is here.
Quiz Tips
- Study before the quiz: review lesson notes and the textbook
- If you get stuck on a question, make your best guess and return later
- Save after every answer. You can always return and change your mind.
- Try Site Search to find facts
- If you are equally uncertain between two choices, go with first impression
- Use the full time available
- Remember that the time remaining is from the last time you saved an answer. If you have not saved an answer recently, the time remaining is wrong! You can press refresh/reload (or F5 in IE) to update the time remaining.
- More quiz tips: Basic Rules For Taking a Multiple-Choice Test
back to top
3.3: Document Hierarchy
Objectives
At the end of the lesson the student will be able to:
- Describe how documents are linked and organized in the file system
- Describe how the web server locates a requested document
|
back to top
3.3.1: File System Basics
- Files and directories organized in a file system
- File system determines:
- where files are stored on a computer’s storage device
- naming rules for files and file extensions
- security of files stored on the computer
- Many different types of file systems including:
- FAT/FAT16/FAT32
- Microsoft File Allocation Table for non-NT file systems
- NTFS
- Windows NT file system
- UFS
- UNIX file system
- HFS
- Macintosh hierarchical file system
- NFS
- Network file system
- Despite differences, all file systems provide a means to store and retrieve files
Notes
- Should use a short suffix on most files to determine type
- Most HTML files have an
.html suffix
- Text files often have a
.txt extension
- Old DOS/Windows had 8.3 naming convention
filename.ext
e.g.
index.htm
Most modern file systems provide access control mechanisms
back to top
3.3.2: Directories and Folders
- Windows supports the notion of drive letters
C:\
UNIX does not support drive letters
File system hierarchy starts at the root directory
/
Directory: special file which stores other files
Subdirectory: directory within another directory
Root directory: uppermost folder used to store all other files
Path: list of all directories that must be traversed to reach a file, usually separated by slashes
/root/dir/subdir/filename.ext
Absolute pathname: path to a file or directory from the root directory
Relative pathname: path to a file or directory from the current directory
Dot "." (or period) refers to current directory
./
Double-dot ".." refers to parent directory
../
How should links to other documents from an HTML page be specified -- absolute or relative paths? Why?
back to top
3.3.3: Resolving URLs
A web server handling a request goes through the following steps:
- Browser forwards an URL to web servers requesting a document
- Server parses the URL and determines:
- hostname (for virtual hosts)
- path
- file
- Server checks for any aliases matching the path
- If alias or virtual directory found, server attempts to locate file there
- If no alias, server looks in root directory for subdirectory matching the path
- Which is faster to find -- virtual directory or subdirectory of the root directory?
back to top
Lab Exercise 3.3
Instructions:
- Label this exercise: Lab 3.4
- Use the next 10 minutes to answer the following questions.
- Do not submit exercises until all of them from today's lesson are finished
Exercise Questions
- What is the difference between an absolute pathname and a relative pathname?
- How should you specify links to other HTML pages on your server?
- What does the web server first do when it receives a request for a URL?
back to top
3.4: Directory Indexing
Objectives
At the end of the lesson the student will be able to:
- Describe directory indexes
|
- Can setup web server to show default files without requiring file names
- Default documents allow nicer-looking URLs
www.yahoo.com
www.yahoo.com/index.html
Default documents also provide some security
Can't see all files in a directory if there is an index file in place
Server administrator can choose any filename for directory indexes
Common index file names include: index.html, default. html, and welcome.html
back to top
3.4.1: Directory Indexing Example
- Several options when choosing how your web server views directories
- No directory browsing permitted. This means that there must be an index document; otherwise, no files are listed.
- Directory browsing permitted, but no default documents enabled. If there is no index document, all the files in a directory are listed.
- Indexes enabled. If there is a file with the correct name in a directory, it will be returned instead of a directory listing.
- For example, IIS uses the following panel to enable directory browsing
- If browsing is not enabled, would see something like the following:
- If directory browsing is enabled, and no index file in place, would see:
- If an index file is in place, would see the index file
- Should be careful if turning on directory browsing to prevent exposing sensitive files
- Parent directories must be secure
- Peer directories must be secure
- Cannot have sensitive information in browsable directory
- Usually easier to create an index page than to handle all the security issues
back to top
Lab Exercise 3.4
Instructions:
- Label this exercise: Lab 3.4
- Use the next 5 minutes to answer the following questions.
- Do not submit exercises until all of them from today's lesson are finished
Exercise Questions
- What is directory indexing?
- What are default documents?
- What document is returned when you just enter a domain name into a browser?
- Why is directory browsing sometimes a bad idea?
back to top
3.5: File and Directory Names
Objectives
At the end of the lesson the student will be able to:
- Choose appropriate names for files and directories
|
- Choosing a good directory structure and filenames will make your site easier to maintain and navigate
back to top
3.5.1: File and Directory Advice
- Organize your site by creating a layout for your directories
- Too many files in one directory is difficult to maintain
- Group similar files together in a directory
- images
- sounds
- style (css)
- Keep hierarchies shallow
- Fewer directories to navigate to reach destination
- Keep filenames short but descriptive
- Long names require too much typing
- Don't use spaces or special characters in file names
- Spaces may seem cool but they do not translate well to the web
- URLs cannot contain spaces
- Will need to encode any spaces or special characters
- For example: file named "
A Simple Filename.html" becomes
http://www.mydomain.com/A%20Simple%20File.html
Use dash "-" or underline "_" instead of spaces
Other characters with special meanings in URLs: ; / ? : @ = &
Only period in a filename should be right before the suffix
End files with a three- or four- letter suffixes
- Important for determining MIME types
- Also helps tell you determine the content of the file
- Note that directories usually do not need extensions
Use all lowercase characters in filenames
- Remember that UNIX is case sensitive whereas Windows is not
- Using all lowercase makes transitioning between systems easier
back to top
Lab Exercise 3.5
Instructions:
- Label this exercise: Lab 3.5
- Use the next 10 minutes to answer the following questions.
- Do not submit exercises until all of them from today's lesson are finished
Exercise Questions
On the Cabrillo web server, I create a file that contains spaces and mixed-case letters in its filename. The files is located at www.cabrillo.cc.ca.us/~eparrish/Spaces and Mixed-Cases.html. Use this file to answer the following questions.
- What happens when you enter the file name in the URL?
- What happens to the spaces and cases in the file name?
back to top
3.6: Transferring Files
Objectives
At the end of the lesson the student will be able to:
- Describe how files are transferred to a web server
- Describe FrontPage extensions
|
- Developers need a method of getting files from a development machine to web server
- This lab covers some of the common options
back to top
3.6.1: File Sharing
- If your server is on a local network can mount the server’s drives or partitions on client machines
- UNIX machines use NFS (Network File System) to provide access to files over a network
- Microsoft Windows Networking provides access by enabling file sharing
- Most servers will enable file sharing of some sort
- Real question is, "Can I safely enable file sharing?"
back to top
3.6.2: FTP
- Popular method of transferring files on the Internet is File Transfer Protocol (FTP)
- FTP provides a standard, error-free way to transfer files
- Popular FTP client for Windows (WS_FTP) shown below
- Can also use some browsers for FTP
- Howto's page contains link to Internet Explorer FTP Tutorial
(Netscape works about the same)
- Can also use
ftp programs on UNIX and Windows
- Textbook has list of commands for text-based clients on p.113
- What is a safer option than standard FTP?
back to top
3.6.3: HTTP Put
- HTTP has a PUT method for sending files to a web server
- Clients that support PUT are usually HTML authoring packages
- Unlike FTP, the PUT method has no error-checking protocol
- Only a few servers support PUT by default
- Be careful when enabling anything that gives people write access to your server
back to top
3.6.4: FrontPage Extensions
- Microsoft’s FrontPage product is a widely used HTML authoring package
- FrontPage allows users to create and manage individual web sites as "FrontPage Webs"
- Each Web can be stored on the server and accessed by FrontPage client
- Changes to any page is automatically updated on the server
- FrontPage Extensions are files and CGI programs added to the web server
- Extensions allow FrontPage client to connect to the server and synch a web site
- Extensions are available for Windows and UNIX web servers from Microsoft
back to top
Lab Exercise 3.6
Instructions:
- Label this exercise: Lab Exercise 3.6
- Use the next 10 minutes to answer the following questions.
- Do not submit exercises until all of them from today's lesson are finished
Exercise Questions
Understand How Files Are Transferred to a Web Server
- Find an anonymous FTP server and download something from it using the FTP client on your machine. One popular company that specializes in FTP is Ipswitch. You can access their FTP service at ftp.ipswitch.com. What happened?
- If you have access, try uploading files to your web server using an FTP client. You'll need to have an account with an ISP or a web server that will let you FTP to it. What happened?
Understand FrontPage Extensions
- How are FrontPage Extensions different from FTP?
- If you are using Windows and have a copy of FrontPage, what happens if you use it to connect to a server with FrontPage Extensions enabled?
back to top
Wrap Up
- When class is over, please shut down your computer
=> Logout => Shut Down
Due Next: N/A
- You may complete unfinished exercises at any time before the next class.
- Be sure to submit the file to the instructor before the beginning of the next class to receive credit.
- Instructions on submitting exercises are available from the HowTo's page.
back to top
Home
| WebCT
| Announcements
| Schedule
| Expectations
| Syllabus
| Help
| FAQ's
| HowTo's
| Links
Last Updated: 7/16/2003 4:45:35 PM
|