Table of Contents
CHAPTER 1 Advertising on the Internet
APPENDIX A An Overview of UNIX
1.1 The Internet: A New Information Media
CHAPTER 2 The VirtuaLand VirtualServer
1.2 Demographics of the Internet
1.3 How to Advertise on the Internet
1.4 How to Get the Word Out
2.1 Introduction to the VirtuaLand VirtualServer System
CHAPTER 3 The Virtual Anonymous FTP Service
2.2 How the VirtuaLand VirtualServer System Works
2.3 A Tour of the VirtuaLand VirtualServer
3.1 Introduction to FTP
CHAPTER 4 The Virtual EMail Service
3.2 Anonymous FTP vs. FTP
3.3 The Name of the Virtual Anonymous FTP Service
3.4 Your Anonymous FTP Directory
3.5 Making an "incoming" Directory for Customers
3.6 Monitoring Anonymous FTP Activity
3.7 Log In Banners and Directory Messages
3.8 Creating Non-Anonymous FTP Accounts
4.1 Introduction to EMail
CHAPTER 5 The Virtual Web Service
4.2 A Tour of the Virtual EMail Handling System
4.3 Creating EMail Aliases
4.4 Creating EMail Lists
4.5 Creating Email Autoresponders
4.6 Error Messages
5.1 Introduction
CHAPTER 6 The Virtual POP Service
5.2 Virtual Web Server Configuration Files
5.3 Creating Web Pages
5.4 Using the Common Gateway Interface (CGI)
5.5 Monitoring Your Virtual Web Server Log Files
5.6 Generating Automated Getstats Reports
5.7 Using WWW Stat as an Alternative to Getstats
5.8 Resetting Your Virtual Web Server Log Files
6.1 Introduction to POP
CHAPTER 7 The iManager Server Extension and iRoot Plug-in
6.2 Creating POP Accounts for Email Users
6.3 Changing a Mailbox Password
6.4 Removing a POP Email Account
6.5 Listing POP Email Account Users
6.6 Configuring the POP Client Software
7.1 The iManager Extension
CHAPTER 8 Helpful Commands and Useful Information
7.1.1 Installing the iManager Extension
7.1.2 Running the iManager Extension
7.1.3 Editing a File with iManager
7.1.4 Deleting a File with iManager
7.1.5 Copying a File with iManager
7.1.6 Moving a File with iManager
7.1.7 Linking a File with iManager
7.1.8 Changing the Permissions of a File with iManager
7.1.9 Uploading a New File to your Server with iManager
7.1.10 Making a New Directory with iManager
7.2 The iRoot Plug-in
7.2.1 Installing the iRoot Plug-in
7.2.2 Running the iRoot Plug-in
7.2.3 Adding Email and FTP Users - vadduser
7.2.4 Changing Email and FTP Users' Passwords - vpasswd
7.2.5 Removing Email and FTP Users - vrmuser
7.2.6 Adding an Email Alias
7.2.7 Deleting an Email Alias
7.2.8 Updating Your Aliases File - vnewaliases
7.2.9 Changing Your Server Root Password - passwd
7.2.10 Creating and Installing a Digital Certificate for SSL Encryption
A.1 Overview
A.2 Why Use Unix?
A.3 Essential Commands and Concepts
A.3.1 Login
A.4 The Unix Philosophy
A.3.2 The Shell, Commands and Arguments
A.3.3 On-line Manuals
A.3.4 I/O re-direction: stdin, stdout, stderr, pipes
A.3.5 Special characters: Interrupt, End-Of-File, Quoting, `Job Control'
A.3.6 Files, Permissions, Search PATH
A.5 A `Typically Unix' Solution
A.6 More about Pipelines and Concurrent Execution
A.7 Other Especially Useful Unix Programs to Read About
A.8 Other Sources of Information
To say that the Internet has become a "hot" topic is an understatement. The Internet has grown up with computer professionals but is now used by many diverse groups. Its origins are in research and educational institutions with its advocates and designers being the main contributors. The number of Internet users has suddenly, this year, reached a critical mass. The number of users has grown to over 30 million and businesses are now just tapping its potential. Thanks to the Clinton Administration, the Information Superhighway (the layman's term for Internet) has become part of everyone's vocabulary and not just the vocabulary of engineers. Everyone has been sold on the excitement of the Internet, usually without a clue what it means.
The Internet is becoming an inexpensive way for businesses to communicate ideas and information. Using print, radio, and television to disseminate knowledge and information is expensive, especially considering the chance it has to be seen or heard. For small businesses advertising on a continual basis nationally is simply out of reach. The audience a small business can reach has been limited by its advertising budget. Now it is feasible for a small business to advertise nationally or even globally. The Internet provides this inexpensive means of communication for businesses or anyone who has a personal computer and some basic skills.
Business people know that you approach advertising in the local newspaper differently from advertising on television and differently again on radio. Each medium has its own idiosyncrasies. You can not run the audio portion of a TV commerical on radio, for example, nor would you video tape two people recording a radio commerical and show it as a television commercial. The Internet is a new medium and it's important to know how it works, and, consequently, understand its business potential.
More than 30 million people and 5 million servers are now connected to the Internet. Roughly 1,133,000 services are at educational sites, 175,000 services at goverment sites, and the remaining 1,300,000 services are at business and personal sites. Internet traffic is growing at a monthly rate of about 6 percent. In January, 1988, Internet traffic consisted of 85 million packets. In December, 1994, Internet traffic had grown to more than 86 billion packets -- an increase of 1000 percent in 7 years.(1)
The Internet Business Center made the following data available collected from the 10th Annual Software Publishing Association Conference(2):
The following table summarizes the distribution of Internet users:
----------------------------------------------------- Specified Group Percentage of Internet Users----------------------------------------------------- Age Under 20 17% 21-25 29% 26-30 27% 31-35 8% 36-40 11% 41-50 6% Over 50 2% Educational Background Bachelor's degree 34% Master's degree 23% Some college experience 19% Location North America 72% Europe 23% Australia 3% Occupation Technical professionals 27% Students 26% Researchers 14% Managers 7% Gender Male 90% Female 10% Affiliation Educational institution 51% Commercial institution 31% Government institution 7% Children in Household 0 70% 1 11% 2 12% 3+ 7% -----------------------------------------------------
Some companies have found out the hard way that the Internet user community has an unwritten rule about advertisements; do not force them on anyone. The last thing you want to do is force your message on users who did not ask for it. Broadcasting EMail to a large number of people, or by inserting advertisements into newsgroup discussions are examples of forced advertising. Committing this kind of indiscreation, more often than not, will subject your company to flaming and, maybe, Email bombing. Flaming is the equivalent of hate mail and Email bombing is getting a lot of it. Flaming and Email bombing can range from nasty letters to absurd service requests that jam and cripple your Internet service.
The central theme to your marketing approach on the Internet should be to provide information and direct sales to interested parties. Ideally, the information you provide can and should include something in addition to product and service literature -- information that anyone could find interesting. If your business is selling computers, for example, you might offer information about the speed of the newest CPUs on the market. If your business is selling cars, you might offer information about newest safety laws and tests.
One practice your company is familiar with is direct user feedback from its advertisements. Your company may have had phone calls and mail in response to advertisements. Internet feedback is more plentiful and more immediate. Consequently, it is more important to obey Internet etiquette otherwise the negative feedback could be overwhelming.
You may want to consider the following guidelines when advertising on the Internet:
A company needs to know its audience. Advertising to the correct target audience returns the greatest sales per advertising dollar. Knowing your audience also enables you to structure the information on your product/service to the customer's needs. The easier the information is to access, the more the customer satisfies those needs. An easy-to-use interface that offers information of value to your target audience should be the overall goal of your Internet marketing plan.
Don't skimp on the information you offer. If you do not offer much information, your company might not attract much attention. Rather, your company should strive to create a presence on the Internet; it should strive to be the resource for information in its field. You might publish, for example, technical manuals, installation guides, and service notes. Or you might make available information that seems only tangentially related to your product/service, but is of great interest to Internet users.
The Internet offers businesses, from small to large, a reasonably priced access to global markets and business communications. Profits from Internet sales are possible due to small advertising costs, and recognition as a global player with product/service expertise is also possible.
Advertising in the standard media of television, radio, and printed matter is based on a central principle: a balance of cost and distribution -- the more people an advertisement can reach, the more expensive the advertisment. Advertising on the Internet dispenses with this central principle. By contrast Internet advertising is largely a one-time cost -- a global catalog of information about your products and/or services. Considering that over 30 million people are connected to the Internet now and growing rapidly, the cost is quickly becoming more reasonable. Like any advertising, however, if all you do is stick a note in a bottle, and hope someone rescues it from the sea (or Internet) then the return on your investment is in jeopardy.
Once you have created an Internet information service you need to let people know that it is available. This section has a few tips that you can use to help get the word out. Be sure, however, to not force your advertising on people. To avoid this you may want to use the following guidelines:
The following are some of the USENET newsgroups and mailing list that you may want to post messages to. Be sure to read the group's FAQ (Frequently Asked Questions) and understand the nature and scope of the group or list before posting. Many readers of these groups can become very irritated with those who don't normally read the group and post strictly for their own commercial benefit.
The following Web sites allow you to register your server and provide back-pointers to your web page free of charge. Be sure to register with all the indexing and searching services rather than just the general malls. The indexing and searching services will direct people interested in your product/service to your web page quickly. The key to success with these services is registering the right key words and having your web page connected with an efficient and effective server. With the growing size of the Internet, malls are becoming more inconvenient for finding what you want even if they offer their own indexing and searching capability. Customers will quickly realize that searching a few hundred web pages on a mall index is less productive than searching thousands of regisered sites on the Internet with a global indexing and searching service.
These sites provide free (or almost free) links to web sites of special, specific, or local area interests. If your information service fits one of the following then you should consider registering you site with them. Unlike general malls, special or specific malls are more useful to a customer looking for information on a particular product or service.
The following sites will give links to your web (for a price). Before paying to be linked in be sure to ask a lot questions like how many hits they are getting, where their hits are coming from, which pages or links are getting the hits and so forth. Even if a site is claiming a lot of hits most of them could be in one or two areas of the mall. The mall owners should be able to give you this information. Of course, even with this data it would be hard to verify the actual number of hits a mall is getting. Some malls, however, sell links based on the number of "hits" or accesses they refer to your site. Accesses then could be easily verified by your own web accounting reports.
Your personal VirtuaLand VirtualServer will allow you establish an Internet presence with a high speed connection at a fraction of the cost. Normally, to establish a presence on the Internet, it would require you to purchase a high speed Internet connection, costly equipment, and maybe a support staff. With the VirtuaLand VirtualServer System you get the Internet services you want without the worries and costs of an Internet connection and your customers will not be able to tell the difference.
Without VirtuaLand VirtualServer technology you normally would have to do the following to establish a presence on the Internet for your company (see Figure 1):
FIGURE 1 A Typical High Speed Internet Connection
Depending on the ISP, speed of the connection, equipment and software you buy it may cost between $5,000 to $10,000 just to establish a server on the Internet and between $1,000 to $20,000 a month for ISP and common carrier charges.
The VirtuaLand VirtualServer System uses the idea of sharing a server and a high-speed Internet connection with other companies and, therefore, significantly reducing the cost of establishing an Internet presence (see Figure 2). Most companies that have high-speed connections do not use the full potential bandwidth of their Internet connection continuously. However, to avoid delays to their customers they will purchase the fastest Internet connection they can afford. For smaller companies this is usually a 56Kbit/sec or fractional T1 frame-relay (time-shared) connection. With slower connections customers may noticed significate network delays during peak usage hours to these sites, however, larger companies with faster connections (such as a full, dedicated T1 or better) the customer will not experience these delays. With a VirtuaLand VirtualServer you have access to a high-speed connection to the Internet at a fraction of the cost and your customers will not be able to tell the difference.
FIGURE 2 The VirtuaLand VirtualServer System
For office electronic mail (Email) services the VirtuaLand VirtualServer System can save your business money. Since each employee would have his or her own mailbox on the VirtuaLand VirtualServer a small office can get away with only purchasing one or two dial-up accounts with an ISP and sharing these accounts. For example, consider a small office of 5-10 employees. For about $20-$30 per month individuals can purchase dial-up accounts that give them between 40-450 hours(6). Rather than purchasing a dial-up accounts for each employee (normally what is required for individual mailbox) you could purchase one or two accounts and configure the mail client software on each employee's computer to get their mail from the VirtuaLand VirtualServer using the employee's Email username and password. The computers, however, would share the one or two dial-up accounts to get access to the Internet. For example, a ten employee company this could save up to $250 per month in just Internet access charges.
The VirtuaLand VirtualServer System may not be for everyone. It allows a company to establish a high-speed Internet presence or test the potential of Internet marketing without incuring the high costs of bringing a high-speed connection and server to the office. In other words, it allows a company to test the Internet waters before committing high start up costs of equipment without the sacrifice of starting with an inferior Internet service.
If your company after a period of time of being on a VirtuaLand VirtualServer has developed a very popular web page (on the order of 10,000-30,000 hits or accesses a day) you will want to consider getting your own Internet connection and/or server to better support your customers' needs. Internet Servers, Inc. can help you if want to have your own dedicated server offsite. Internet Servers will setup, manage, and secure this server for you while saving you money in lease-line and systems management costs. Contact the Internet Servers for more information concerning these dedicated server products and services.
The VirtuaLand VirtualServer System uses the idea of multiplexing a single UNIX server into multiple virtual machines. Each VirtuaLand VirtualServer user will get their own set of virtual services that they may customize to their liking or needs. Each VirtuaLand VirtualServer has its own unique domain name and IP (Internet Protocol) address. When a request comes in, the VirtuaLand VirtualServer System will determine which VirtuaLand VirtualServer will service the request based on this unique IP address and then invoke the appropriate service to respond to the request. Therefore, since the VirtuaLand VirtualServer will invoke a unique server based on the designation address and port number of an IP request, each VirtuaLand VirtualServer user may have his own custom configuration or data files for their set of virtual services. Also these VirtuaLand VirtualServers will log events to the user's own log directory so that they may make access accounting summaries and generate individual reports.
The VirtuaLand VirtualServer System currently offers the following Internet services:
Other services are being added to the VirtuaLand VirtualServer System and will be announced very soon. These include NetscapeTM compatible encryption for secure transaction processing. The following chapters will explain the above services and how to efficiently use them.
Please note that the VirtuaLand VirtualServer does not support virtual shell accounts. However, it is possible to have individual mail accounts which are accessable by each user using the Post Office Protocol or POP. There is no limited to the number of these accounts (other than storage) and they would be created by your company's VirtuaLand VirtualServer administrator.
The VirtuaLand VirtualServer administrator is an user who is in charge of maintaining your VirtuaLand VirtualServer. He or she will be given a username and a password to the VirtuaLand VirtualServer administrator account. This username and password gives the administrator access to a normal shell account on a UNIX server which is home to your VirtuaLand VirtualServer. The VirtuaLand VirtualServer administrator responsibilities include:
It is important to assign someone as the VirtuaLand VirtualServer adminstrator who has a little UNIX and programming experience (or who is at least is willing to learn about UNIX and programming). Since each VirtuaLand VirtualServer account is given full access to all the configuration files it is fairly easy to paint yourself into a corner(7). However, it is much easier to maintain a VirtuaLand VirtualServer system than a full UNIX system, since most of the work is done for you.
The following is a short tour of the virutal server from the VirtuaLand VirtualServer adminstrator's point of view. When you are given a VirtuaLand VirtualServer account you will be given the following information about your server:
Once you log in to the actual server as the VirtuaLand VirtualServer administrator you will see the following directories:
These directories represent your VirtuaLand VirtualServer's root directory even though the command pwd (print working directory) it reports something like /usr/home/<administrator_login_name>. It is important to remember that the directory /usr/home/<administrator_login_name> gets translated to simply / when any of the virtual services (such as httpd, sendmail, pop, or ftpd) run. For example, when you develop CGI's (Common Gateway Interfaces) for your virtual httpd you need to use the path /usr/local/etc/httpd/ rather than the path /usr/home/<administrator_login_name>/usr/local/etc/httpd/.
The majority of Internet network traffic (about 36 percent) is FTP. Email comprises only about 6 percent of Internet traffic, probably because it is most often used within a local network. Today, FTP is still the workhorse of Internet tools.
Connecting to a remote computer using FTP is similar to using TELNET or rlogin, except that you do not have all the tools of a shell, and your access to files, called archives, is limited. You can use FTP to transfer files. The files can be of any type. For example, they might be text files or binaries--FTP doesn't really care. Nor does it care about the platforms of the two computers. You might, for example, transfer files between a Sun workstation and a PC (with a FTP client). Part of the reason FTP is so popular is that FTP clients are so easy to acquire for every platform.
FTP is great for transferring files but terrible for browsing. If you have worked with a file structure of any size, you know how difficult it can be to navigate through it. Although file names can be descriptive they're not descriptive enough. Some FTP administrators even put README or INDEX files in every directory to give the user some clue as to what is grouped in that directory. FTP archives, however, are easier to set up than WWW sources, since you do not need to transfer your documents into HTML.
The virtual system only supports Anonymous FTP or FTP that anyone can access without a password. With anonymous FTP you just enter anonymous or ftp for the username and usually your Email address as the password.
Normal FTP, on the other hand, does require you to enter a valid username and password. This type of FTP is not supported by the virtual FTP server but changes to web pages, configurations files, etc. can be done with the administrator login name and password. However, the VirtuaLand VirtualServer administrator will need to ftp to the VirtuaLand VirtualServer host name (i.e. www.yourdomain.com) or IP address.
There is a de facto, but not required, standard for naming FTP and other services. They are the names users will try first and are the easiest to remember. The format for the FTP service is:
Where domain represents the domain name of your FTP server (often your company's name) and type represents the type of organization (i.e. edu is used for educational institutions, com is used for businesses, net is used for network services providers, org is used for non-profit organizations, and gov is used for government entities).
By default, if your domain name is registered by Internet Servers, Inc. then your virtual anonymous FTP services will be in the standard form above. Naming your FTP service abc.domain.type or zzz.domain.type is not illegal but it is not a good idea.
Other services follow a similar naming convention. For example, World Wide Web servers are named www.domain.type and Post Office Protocol (POP) servers are named pop.domain.type. Again Internet Servers will use these names by default for the respective services.
3.4 Your Anonymous FTP Directory
Using anonymous FTP is the safest way to grant access to the virtual FTP service because it is restricted to the ftp directory in your home directory. With this restrictive access and by assigning permissions correctly you can limit the harm they can do.
Your ftp directory in your home directory contains two sub-directories:
In some cases it would be desirable to allow your users to upload files to your virtual anonymous FTP server. Separating these files into their own directory is a form of damage control. If someone uploads a virus hopefully its damage is confined to the incoming directory. If you see no reason to permit uploads then there is no reason to create one, so simply skip the rest of this section.
It is recommended that the incoming directory be given only write and execute permissions. This permission set is somewhat inconvenient because it prevents customers from looking at files others have uploaded to the server. On the other hand, it prevents other users from perverting or deleting those same files. A byproduct of allowing users to read other's uploaded files (having the read permission set) is that they can upload completely unrelated files on your VirtuaLand VirtualServer. These uploaded files can be bland or blasphemous. For the sake of your company's image, you wouldn't want to inadvertently support a porn or WaReZ (pirated software) archive on the Internet.
To make an incoming directory do the following:
Files that are uploaded to the incoming directory will be owned by anonftp, therefore, you must change it to be owned by your virtual adminstrator account. To do this use the vchown command. vchown simply changes the ownership of file owned by anonftp to be own by your virtual account adminstrator. For example:
This would change the file uploaded.file from being owned by anonftp to being own by the virtual account adminstrator.
The messages file located in your usr/logs directory contains important information describing how much your virtual anonymous FTP server has been used. This information, however, may not be in a very readable form. A program by the name xferstats can be used to make a summary of your anonymous FTP activity as shown in Figure 3.
xferstats may be run periodically by the cron facility. This can be done as follows:
# Crontab file (see crontab(5)) # Every Sunday morning at 2:13am process FTP xferstats and "nuke" message file 13 2 * * sun /usr/local/bin/xferstats -m user@xyz.com -n
% crontab cfile
For more information on cron type man crontab and man 5 crontab at the VirtuaLand VirtualServer's UNIX prompt.
TOTALS FOR SUMMARY PERIOD Aug 16 TO Aug 17Files Transmitted During Summary Period 3Bytes Transmitted During Summary Period 762
Systems Using Archives 0
Average Files Transmitted Daily 2
Average Bytes Transmitted Daily 381
Daily Transmission Statistics
Number Of Number of Average Percent Of Percent Of
Date Files Sent Bytes Sent Xmit Rate Files Sent Bytes Sent
--------------- ---------- ----------- ---------- ---------- ----------
Aug 16 2 508 508.0 KB/s 66.67 66.67
Aug 17 1 254 0.3 KB/s 33.33 33.33
Total Transfers from each Archive Section (By bytes)
---- Percent Of ----
Archive Section Files Sent Bytes Sent Files Sent Bytes Sent
------------------------- ---------- ----------- ---------- ----------
/pub 3 762 100.00 100.00
Hourly Transmission Statistics
Number Of Number of Average Percent Of Percent Of
Time Files Sent Bytes Sent Xmit Rate Files Sent Bytes Sent
--------------- ---------- ----------- ---------- ---------- ----------
03 1 254 0.3 KB/s 33.33 33.33
05 2 508 508.0 KB/s 66.67 66.67
Some FTP servers have messages that are displayed just after you log in or change into a new directory. These messages give the user helpful information about your FTP site or the directory they just changed in to. For example, you may want to give a short description of the files in a directory or information about the server they just logged in to.
To create a message that is displayed to the FTP user just after they log in, create a file named ".welcome" in your ~/ftp/pub directory:
yourserver: {8} % cat > ~/ftp/pub/.welcome
Welcome to ACME Rockets Inc Anonymous FTP Server!
Please send any questions, comments, or problem reports about
this server to ftp@acme-rockets.com.
^D (Control-D)
To create a message that is displayed to the FTP user when they change into a directory, create a file named ".message" in the directory that you want the message to appear. For example, if you offer a demo version of software that your company sells you could create a directory called demo with a file named ".message" in that directory:
yourserver: {10} % mkdir ~ftp/pub/demo
yourserver: {11} % cat > ~/ftp/pub/demo/.message
This directory contains demo versions of ACME Rocket's products:
missile.zip - Missile CAD(tm) Version 1.0 (DEMO)
nuke.zip - Thermo Nuclear War Simulator(tm) Version 2.1 (DEMO)
^D (Control D)
If your VirtuaLand VirtualServer is configured to handle non-anonymous FTP accounts, it is quite simple to add FTP accounts for your users. This allows you to create accounts that can be used to upload or download web content, files into the anonymous FTP file area, or in private FTP upload/download area. The most important thing for you to decide is what type of access you want your users to have.
The most common use for non-anonymous FTP on the VirtuaLand VirtualServers is for companies who want to resell some of their space to their clients and allow them to upload and maintain their own home pages. Another use for non-anonymous FTP is for companies that have valuable information that they want to make available via FTP for only those that have been given a specific password. Adding Non-Anonymous FTP accounts uses the same procedure as adding POP Mail accounts. Creating this FTP account will also create an Email POP account. If you do not wish the user to access Email on your server, simply do not tell them about the Email account.
To add the Non-Anonymous FTP accounts, log into the server using the virtual administrator login name and password and use the vadduser command (or the iroot program). For example:
yourserver: {2} % vadduser
Email User Names are up to 8 characters and consist of upper or lower
case alphabetic characters or digits. They must start with an
alphabetic character and should generally be all lower case.
Email User Name: biff
Now enter a password for this user's POP mail account. For security
reasons you may want to use a password that is longer than 6 characters
and that has at least one non alphabetic character. The password will
*not* be echoed to the screen and you will be required to type it twice.
POP password:
After entering the FTP user's name, the password, and the full name for the account, the FTP option, and the FTP upload quota, it will be added. This will setup the electronic mailbox for the user and the FTP account selected.
Let's take a look at what the home directory possibilities are.
The first option allows you to create the home directory under your /usr/home directory. If the directory were called test, it would be created at /usr/home/test. This would be an ideal place for you to create an FTP directory for users to upload information to your server that your system administrator would verify and place in the proper directory structure.
The second option allows you to create the home directory under your /usr/local/etc/httpd/htdocs directory. If the directory were called test, it would be created at /usr/local/etc/httpd/htdocs/test. This is ideal if you wanted to allow user test to update his own home pages. He would have FTP access to the test directory, and anything below that he created. However, he would not be able to access anything above the test directory. His home pages would be found at http://www.yourcompany.com/test.
The third option would be used if you wanted your user to be able to upload files to your anonymous FTP archive. The directory created for the user test would be /ftp/pub/test. Files in this directory could only be added and deleted by the user test, but anyone would have access to download these files.
The FTP upload quota allows you to limit how much of your VirtuaLand VirtualServer's disk space one of your users may use. If they try to upload more than what their remaining quota allows, they will receive a FTP error message.
As a common feature on local networks, you may already be familiar with Electronic Mail or EMail. You can send and receive letters across local network or Internet lines when available. You can even broadcast messages to many people at once. The Internet has mailing lists that you can retrieve from or broadcast to. You might, for example, broadcast a message to an entire newsgroup or discussion group. Of course, you want to broadcast messages sparingly. Flooding newsgroups with EMail about your company every week is not proper Internet etiquette. Doing so would likely provoke the ire of Internet users.
The advantage of using EMail as a way to communicate over the Internet is its immediacy. Most people on workstations have a mail client running. Rather than waiting for people to fire up their browsers and search across the Internet to find your company's home page, EMail can arrive at their workstation immediately. Again, it is not proper Internet etiquette to broadcast EMail to a wide body of users in order to promote your company. Instead, you could use EMail to foster your company's relationships with its established clients.
The Virtual EMail System is directly based on sendmail 8.6.12 (don't worry if this does not mean anything to you). Your virtual sendmail uses the following configuration files and directories:
EMail aliases allow you to forward electronic mail sent to a mail user name on your VirtuaLand VirtualServer to be sent to another electronic mail address. For example, you could make all the mail sent to webmaster@your_virtual_server.com sent to you@xyz.edu. To do this do the following:
You do not need to create a mail account as described in section 6.2 in order to have an EMail alias. After an alias is created the mail is not stored on the VirtuaLand VirtualServer and is simply forwarded.
It is sometimes convenient to create a single email address that is an alias for many EMail addresses (an electronic mailing list). There are two ways to do this. First, you can add multiple EMail addresses separated by a comma to a single line in the etc/aliases file as described above. For example:
myfriends: joe@xyz.com, fred@foobar.edu, mary@abc.org
Of course, this only works for small lists. For larger lists you can use :include: and a separate file for the aliases. To do this for your mailing list do the following:
myfriends: :include:/etc/mylist
You may want to setup Email addresses that your clients can mail to that will automatically send them a reply with information on a particular subject. You may also want to have an Email address that sends a reply to the sender informing them that their message has been received. These are various types of autoresponders that can be setup on your VirtuaLand VirtualServer system quite easily. Simply follow these steps in a telnet session:
With the above example, when your customer sends you mail at "info@yourcompany.com" it will be received at name@yourcompany.com and send back whatever you have in the ~/.autoreply file. By the way, you can use the "-m" option to specify a different message file (i.e. "autoreply -m /etc/mymessage" would send the file /etc/mymessage instead of the default ~/.autoreply). You will need to use this option when setting up more than one autoreply message.
The "-f" allows you to change who the autoreply message will be from. In the example above the "From:" field the customer gets will read info-reply@yourcompany.com. This way your customer can reply to your message without getting the autoresponder again. You will also need to create an alias for info-reply.
the "-a" specifies who autoreply can reply for; this should be the same as what is to the left of the ":" in the etc/aliases file.
Note that in the example above mail sent to info@yourcompany.com will also be sent to name@yourcompany.com. Without the name@yourcompany.com, the mail from the customer would not be seen by anyone. Of course, you can leave this off if the Email address is used only for sending an automated response to the customer that requires no other interaction.
If something is not working the way you think it should be then take a look at the usr/log/messages file for error messages. The virtual email server will log messages to this file. Also, all mail that comes in or goes out is logged in this file. This is a good way to keep track of mail usage on your VirtuaLand VirtualServer.
The World Wide Web project has taken the Internet by storm inspite of earlier criticism. A World Wide Web (WWW, or Web) service makes accessing your information easier for your customers. WWW services provide all the power your company needs to make exciting and motivating presentations. Accessing WWW services has been a problem because transferring the large graphical files over slow connections was intolerable. Now with the newer MODEM's (14.4 to 28.8 Kbps) and the cheaper rates for SLIP (Serial Line Internet Protocol) or PPP (Point-to-Point Protocol) Internet connections make graphical interfaces available to even individual home users. Netcom's PPP connection, for example, is only a few dollars more per month ($20) than the text-based connection. Netcom's graphical client, Netcruiser, allows you to surf the net with nothing more than a MODEM. That means all home users can access your company's WWW service with a small investment for equipment and service and that is good news for your business.
The Virtual Web Service is based on the NCSA HTTP (Hyper-Text Transfer Protocol) server(8). The httpd files are located in usr/local/etc/httpd in your home directory. Please note that the directory www in your directory is a symbolic link to the directory usr/local/etc/httpd. Therefore, a quick way to get into the usr/local/etc/httpd is to simply do a cd www from your home directory. The following sub-directories are located within your usr/local/etc/httpd directory:
The virtual web server configuration files are pre-configured for you when you get a VirtuaLand VirtualServer account, however, you may need to customize these files a little to take advantage of some advance features. The following sections give an overview of the contents of these files. For most web pages you should not have to change these files from the Internet Server default setup. Therefore, you may want to quickly scan these sections and refer back to them when needed.
The httpd.conf files is for general configuration of the virtual httpd. Table 2 describes some of the parameters in httpd.conf.
TABLE 2. httpd.conf Parameters
-------------------------------------------------------------------------------------- Parameter Description-------------------------------------------------------------------------------------- AccessConfig filename filename is either an absolute pathname or a partial path name relative to ServerRoot that specifies the location of the access.conf configuration file. The default is AccessConfig conf/access.conf. AgentLog filename filename is the file where you want to keep record of the client agent software. The directive is for statistical pur poses and tracing of protocol violations. The default is AgentLog logs/agent_log. ErrorLog filename filename is either an absolute path name or a partial path name relative to ServerRoot that specifies the location of the error log file. The virtual web server includes infor mation such as segmentation violations, bad scripts, timed out clients, and .htaccess files that attempt to default access.conf directives. The default is ErrorLog logs/error_log. IdentityCheck [on | off] Determines if the remote user is logged in as himself. This directive only works if the client application is run ning an RFC 931-compliant identity daemon (unlikely). The default is IdentityCheck off. ResourceConfig filename filename is either an absolute path name or a partial path name relative to ServerRoot that specifies the location of the srm.conf configuration file. The default is Resource Config conf/srm.conf. ServerAdmin email_address email_address specifies the webmaster's address. The default is ServerAdmin webmaster@<your domain name>. ServerName hostname hostname specifies the domain name of your server or a DNS alias. The default is ServerNameName www.<y our domainname>. ServerRoot pathname pathname defines the absolute path of the root of your server above which users cannot trespasss. The default is ServerRoot /usr/local/etc/httpd. (Remember that the path /usr/home/<login name> gets translated to simply / when the VirtuaLand VirtualServer runs.) TimeOut seconds seconds defines the maximum amount of time (in sec onds) the service waits for the client to submit a request once it has been connected, and the maximum amount of time the service should wait for the client to accept a request. The default is TimeOut 1800. TransferLog filename filename is either an absolute path name or a partial path name relative to ServerRoot that specifies the location of the log that records data, such as host, date, and file name, of service requests. The default is TransferLog logs/access_log. TypesConfig filename filename is either an absolute path name or a partial path name relative to ServerRoot that specifies the location of the MIME configuration file. The default is TypeConfig conf/mime.conf. --------------------------------------------------------------------------------------
The srm.conf (server resource management) configuration file specifies the location in which the service finds your scripts and documents. The following table describes the parameters found in the srm.conf.
---------------------------------------------------------------------------------------------- Parameter Description---------------------------------------------------------------------------------------------- AccessFileName filename filename specifies the name of the file that you can include in any directory that specifies access permissions for that directory. The default is AccessFileName .htac cess. AddDescription text fileID Associates descriptive text with a type of file defined by extensions, a file name, an absolute path name, or a file name using wild cards (for example AddDescription "image file" *.gif). AddEncoding kind ext Specifies that files with ext are of type kind so that appropriate actions can be taken. For example, if the file is compressed, the browser can automatically uncom press it (for example, AddEncoding compress Z). AddIcon path name1 name2... Specifies the icon to display with a kind of file; used when browsers display FTP menus. AddIconbyEncoding path name1 ... Performs the same task as AddIcon except that the encoded information determines the icon used. AddIconType path type1 type2 ... Performs the same task as AddIcon except that the MIME type determines the icon used. AddType kind ext Supersedes MIME definitions for the specified exten sions (ext) found in the mime.types file. Alias name path Substitutes path for name in path names. DefaultType type Specifies the default MIME type. The default is Default Type text/html. DefaultIcon pathname pathname specifies the default icon to use when Fancy Indexing is on. The default is DefaultIcon /icon/ unknown.xbm. DirectoryIndex filename Specifies the filename to return when the URL request does not specify a file or the request is just your service (for example, http://www.virtualand.net). The default is DirectoryIndex index.html. DocumentRoot path path specifies the absolute path to the directory from which the virtual web server retrieves documents. The default is DocumentRoot /usr/local/etc/httpd/htdocs. (Remember when the virtual web server runs the path / usr/home/<your login name> will become simply /.) FancyIndexing [on | off] Adds icons, file name data, headers, and footers to lists of files automatically indexed. The default is FancyIn dexing on. HeaderName filename Specifies the filename to be used at the top of a list of files automatically indexed. The default is HeaderName HEADER. IndexIgnore kind1 kind2 ... Specifies kinds of files to be ignored during file process ing. The default is IndexIgnore */.??* *~ *# */ HEADER* */README. IndexOptions option1 option2 ... Specifies a variety of indexing parameters, including FancyIndexing, IconsAreLinks, ScanHTMLTitles, Sup pressLastModified, SuppressSize, and SuppressDescrip tion. OldScriptAlias name path Performs the same task as Alias (backward compatibility for HTTP V1.0). ReadmeName filename filename specifies the footer information to attach to automatic directory indexes. The default is Readme Name README. Redirect pathname URL Remaps pathname of document to new URL. There is no default for this directive. ScriptAlias name path Is similar to Alias but used for scripts. This directive substitutes path for name in path names. ----------------------------------------------------------------------------------------------
The access.conf configuration files define what service features are available to all WWW browsers. The default is to make everything available to all browsers. Many of the parameters in the access.conf are sectioning directives. They stand out because they use angle brackets.
Sectioning directives have a beginning and ending delimiter, for example:
The above example enforces extra restrictions on the directory /usr/local/etc/httpd/cgi-bin using the AllowOverride directive. The AllowOverride directive may use one of the following directives:
The directives enabled by the AuthConfig are defined as the following:
The directives enabled by Options include the following:
Limit sectioning directive may include the following:
Any directive between the delimiters apply to the listing following the first delimiter. For example:
In this example, the sectioning directive, Limit, determines who can retrieve information from the service, which, in this case is "allow from all."
The default homepage for your VirtuaLand VirtualServer account is located in the file usr/local/etc/httpd/htdocs/index.html or, simply, www/htdocs/index.html. Your VirtuaLand VirtualServer account includes access to many popular UNIX editors including pico, vi, emacs and others. You can also edit your web pages on your PC and upload them to the VirtuaLand VirtualServer.
The details of HTML is beyond the scope of this document. however, there are many good tutorials and references available both on-line and in book form including the following:
HTML editors help you quickly create web pages for your server. Some are WYSIWYG (What You See Is What You Get) type editors and help you get your page just right. The following are HTML Editors for MS Windows:
The following are sources for tool and HTML editors for the Macintosh:
Other WWW tool archives:
Graphics, icons, and backgrounds:
The Common Gateway Interface (CGI) allows you to extend your VirtuaLand VirtualServer. CGI allows you to support the situations when the client wants to send information to the VirtuaLand VirtualServer for more complicated processing. In general, web servers don't process information themselves but rather hand off the work to gateway programs. The CGI specification defines the mechanisms by which HTTP servers communicate with gateway programs. Therefore, you need to understand the HTTP protocol and the CGI specification to write server-side gateway programs and client HTML documents that use these programs.
Advanced CGI development is beyond the scope of this document. Some example CGIs are described in later sections, however, for more information about CGIs see:
You can also write you own CGI using the following languages:
Please keep in mind when you write your own CGIs that your VirtuaLand VirtualServer's home directory (/usr/home/<your login name>/) becomes the root directory (/). Therefore, you do not need to include /usr/home/<your login name> in the full, absolute paths in your scripts or programs. You can test your CGIs interactively with the virtual command. For example:
In this example, the program mycgi runs in the virtual environment and is given the arguments arg1, arg2, and arg3.
Active images, or sometimes called, clickage images allow your users to click on different areas of an image and have different things happen, depending on where they clicked. For example, the active image could be a map of a building and clicking on a room will take you to an information page on that room.
To create an active image follow the steps below:
<A HREF="http://some.site.com/cgi-bin/imagemap/my_mapfile"> <IMG SRC="image.gif" ISMAP> </A>
my_mapfile: /usr/local/etc/httpd/htdocs/my_mapfile.map
You can add other mappings in imagemap.conf by just adding another line. For example:
my_mapfile: /usr/local/etc/httpd/htdocs/my_mapfile.map my_2ndmap: /usr/local/etc/httpd/htdocs/my_2ndmap.map
Adobe Photoshop A commerical graphics program available from most software stores.
Paintshop Pro A very good shareware program from ftp://gatekeeper.dec.com/pub/micro/msdos/win3/desktop/psp30.zip
Mapedit A freeware program that directly creates map files from ftp://sunsite.unc.edu/pub/packages/infosystems/WWW/tools/mapedit (See http://sunsite.unc.edu/boutell/mapedit/mapedit.html for more information.)
The general form for a map file entry is:
method URL x1,y1 x2,y2 ... xn yn
# Map file (htdocs/my_mapfile.map) for image.gif circle /room1.html 50,20 50,30 rect /room2.html 25,78 40,85 poly /room3.html 45,38 35,50 40,72 50,75 60,72 65,50 55,38 point /room4.html 10,20 point /room4.html 11,20 point /room4.html 10,21 point /room4.html 11,21 default /default.html
Here is how each of the different methods of defining clickable regions work:
circle <URL> <center point> <edge point> This maps the region inside the circle to the <URL>. <center point> is the X,Y coordinate for the center and <edge point> is the X,Y coordinate for a point on the edge of the circle.
point <URL> <X,Y> This maps a single point <X,Y> to the <URL>. This is often used with other point methods for small areas as in the example above.
poly <URL> <X1,Y1>, <X2, Y2>, ... <Xn,Yn> This maps the region defined by a multisided polygon to the given <URL>. The polygon is automatically closed with a line from the last point <Xn,Yn> to the first point <X1, Y1>.
rect <URL> <Upper left Corner> <Lower right corner> This maps the region inside a rectangle defined by <Upper left corner> and <Lower right corner> to the <URL>.
default <URL> This maps the region not defined by any of the above within an image to the <URL>.
It is often useful to have your customers give you feedback (hopefully in the form of more product orders). The Common Gateway Interface can be used to collect this infomation. This section shows one way to do this with a simple form processing program.
The formmail.pl program is a perl script that processes information that a user enters into an on-line form and then sends that information to an email address you specify. To set up an on-line form using formmail.pl do the following:
cp /usr/local/contrib/formmail.pl ~/www/cgi-bin/formmail.pl chmod 755 ~/www/cgi-bin/formmail.pl
<FORM ACTION="/cgi-bin/formmail.pl" METHOD="POST"> <INPUT TYPE=hidden NAME="recipient" value="you@youraddres.com"> <INPUT TYPE=hidden NAME="subject" value="Customer Feedback"> <INPUT TYPE=hidden NAME="username" value="webpage@webaddress.com">
In the example above, the line with NAME equal to recipient specifies who the mail is sent to, subject specifies what you want the subject of your mail to be and username specifies who the mail is from.
<PRE> Name: <INPUT NAME="Name" SIZE="40" MAXLENGTH="40"> Address: <INPUT NAME="Address" SIZE="60" MAXLENGTH="60"> City: <INPUT NAME="City" SIZE="20" MAXLENGTH="30"> State: Zip: <INPUT NAME="State" SIZE="2" MAXLENGTH="15"> <INPUT NAME="Zip" SIZE= "7" MAXLENGTH="7"> Phone #: <INPUT NAME="Phone #" SIZE="14" MAXLENGTH="14"> Comments: <TEXTAREA NAME="Comments" ROWS="12" COLS="48"></TEXTAREA> </PRE> <INPUT TYPE="SUBMIT" NAME="Request"><INPUT TYPE="RESET"> </FORM>
If you have been "surfing" the Web much you may have noticed that some web pages have dynamic information that changes every time you access the page such as the number of times the page has been accessed, the current date and time and so forth. This feature is called Server Side Includes or Server Includes. This section, which is the final CGI example, shows how to implement a Server Side Include to display the number of "hits" on a web page. This is done with a little perl script written by Jonathan Lewis called "c4.pl". To setup a web page hit counter do the following:
yourserver: {4} % cp /usr/local/contrib/c4.pl ~/www/cgi-bin
yourserver: {5} % cp /usr/local/contrib/lock.pl ~/www/cgi-bin
yourserver: {6} % chmod 755 ~/www/cgi-bin/c4.pl
yourserver: {7} % chmod 755 ~/www/cgi-bin/lock.pl
Options Indexes FollowSymLinks Includes AddType application/x-httpd-cgi .cgi addType text/x-server-parsed-html .html
yourserver: {9} % cat > index.count
0
^D (the control-D character)
Over <!--#exec cgi="/cgi-bin/c4.pl" --> Internet Customers Served.
It is useful to monitor your VirtuaLand VirtualServer's web usage. This is a good way to get feedback on how your VirtuaLand VirtualServer is being used by potential customers. The virtual web server log files are kept in the www/logs directory, however, you will want to use a program to digest this information into something useful. The program getstats(10) can help you do this. Getstats can be used either interactively (from the command line) or periodically in "batch mode" using cron like xferstats (see Chapter 3). For interactive just type the getstats command at the Unix prompt with the appropriate report option(s). For example:
yourserver: {4} % getstats <report option>
Currently there are twelve major types of reports this program can produce. You can use as many options as you like to create combinations of reports. The following is some of the type of reports that can be generated using getstats:
HTTP Server General Statistics Local date: Fri Feb 11 18:17:07 PM PST 1994 Covers: 02/09/94 to 02/11/94 (3 days). All dates are in local time. Requests last 7 days: 4495 New unique hosts last 7 days: 358 Total unique hosts: 358 Number of HTML requests: 1854 Number of script requests: 472 Number of non-HTML requests: 2169 Number of malformed requests (all dates): 5 Total number of all requests/errors: 4500 Average requests/hour: 90.2, requests/day: 2164.7 Running time: 11 seconds.
HTTP Server Monthly Statistics Covers: 10/30/93 to 11/08/93 (9 days). All dates are in local time. Each mark (#) represents 1000 requests. ---------------------------------------------- Oct (10/30/93): 569 : # Nov (11/04/93): 2 : ....
HTTP Server Weekly Statistics Covers: 12/28/93 to 01/27/94 (32 days). All dates are in local time. Each mark (#) represents 500 requests. ---------------------------------------------- Week of 12/27/93: 1878 : ### Week of 01/03/94: 5606 : ########### Week of 01/10/94: 23287 : ############################################## ....The -w option will produce a weekly report of server use. The dates in the report are always the Monday of that particular week.
HTTP Server Daily Summary Covers: 12/28/93 to 01/27/94 (32 days). All dates are in local time. Each mark (#) represents 1000 requests. ---------------------------------------------- Mon: 16018 : ################ Tue: 13219 : ############# Wed: 9904 : ######### ....
HTTP Server Daily Statistics Covers: 12/28/93 to 01/27/94 (32 days). All dates are in local time. Each mark (#) represents 100 requests. ---------------------------------------------- 12/28/93 (Tue): 88 : 12/29/93 (Wed): 258 : ## 12/30/93 (Thu): 591 : ##### 12/31/93 (Fri): 775 : ####### ....
HTTP Server Hourly Summary Covers: 12/28/93 to 01/27/94 (32 days). All dates are in local time. Each mark (#) represents 200 requests. ---------------------------------------------- midnite: 1266 : ###### 1:00am: 1206 : ###### 2:00am: 1238 : ###### ....
The -hs option produces an hourly summary, which shows the aggregate number of requests for a particular hour.
HTTP Server Hourly Statistics Covers: 12/28/93 to 01/27/94 (32 days). All dates are in local time. Each mark (#) represents 20 requests. ---------------------------------------------- 12/28/93 (Tue) 3:00 pm: 39 : # 4:00 pm: 12 : 5:00 pm: 36 : # ....
The -h option produces an hourly report, which shows the number of requests per hour, the day of the week, and the total number of requests for each day.
HTTP Server Full Statistics Sorted by number of requests. Covers: 12/28/93 to 01/27/94 (32 days). All dates are in local time. # of Requests : Last Access (M/D/Y) : Hostname ---------------------------------------------- 6994 : 01/26/94 : kmac 1751 : 01/26/94 : eitech 1096 : 01/27/94 : jhvh-1 ....
HTTP Server Request Statistics Sorted by number of requests, 1560 unique requests. Covers: 12/28/93 to 01/27/94 (32 days). All dates are in local time. # of requests : Last Access (M/D/Y) : Request ---------------------------------------------- 4260 : 01/27/94 : /eit.home.html 3330 : 01/27/94 : /graphics/stripe.bottom.gif 2831 : 01/27/94 : /graphics/ball.black.gif ....
HTTP Server Domain Statistics 1 level, sorted by domain name, 22 unique domains. Covers: 02/09/94 to 02/10/94 (2 days). All dates are in local time. # reqs : # uniq : Last Access (M/D/Y) : Domain ---------------------------------------------- 180 : 28 : 02/10/94 : (numerical domains) 27 : 1 : 02/10/94 : .at 28 : 3 : 02/10/94 : .au 22 : 2 : 02/10/94 : .ca ....
HTTP Server Tree Report Covers: 12/28/93 to 01/07/94 (12 days). All dates are in local time. # of Requests : Last Access (M/D/Y) : Dir/File ---------------------------------------------- 55 : 01/07/94 : /reports 51 : 01/07/94 : /ht93 562 : 01/07/94 : /demos 487 : 01/07/94 : /asiceda ....
The -dt option generates a directory tree report, which cannot be sorted. The number of requests and last request date for directories and files is displayed. The request count for directories is the amount of requests for that directory plus the sum of all requests for the files and subdirectories under it.
If you find this report is empty, try using the -dr option without specifying a directory. This will tell getstats to make a tree report without verifying that the files and directories reported in the log file actually exist.
HTTP Server Error Report (All Dates) ---------------------------------------------- kmac [Thu Dec 30 23:20:21 1993] get / foo kmac [Thu Dec 30 23:20:37 1993] get foo / kmac [Thu Dec 30 23:20:55 1993] get http://www.eit.com/ foo
example: getstats -a -fb
This will create all reports sorted by number of requests, with the exception of the full report, which is sorted by byte traffic, and the error report, which must be specified on the command line.
getstats may be run periodically by the cron facility. This can be done as follows:
# Crontab file (see crontab(5)) # Every Sunday morning at 2:13am summarize the WWW stats and reset the log 13 2 * * sun /usr/local/bin/getstats -d -n | /usr/bin/mail -s "Web Stats" user@xyz.com
% crontab cfile
For more information on cron type man crontab and man 5 crontab at the VirtuaLand VirtualServer's UNIX prompt.
You should set up a cron tab to automatically compute the daily statistics and send you a daily report, a weekly report, and a monthly report. Additionally, you should "Nuke" the getstats log file at the start of every month to free up more disk space. This cronfile will do this for you, or you can use the vnukelog command (see "The vnukelog Command")
58 23 * * * /usr/local/bin/getstats -d -f | /usr/bin/mail -s "Web Daily Stats"
stats@yourdomain.com
59 23 * * 7 /usr/local/bin/getstats -w -f | /usr/bin/mail -s "Web Weekly Stats"
stats@yourdomain.com
01 00 1 * * /usr/local/bin/getstats -w -f -n | /usr/bin/mail -s "Web Monthly Stats"
stats@yourdomain.com
If you do not like the getstats program, feel free to load wwwstat.pl from the Contrib directory (see "The Contrib Directory"). This program is a bit more powerful than getstats and has a Web interface.
There are many other commercial stat programs out there that are also more inclusive than the ones we provide. You are certainly welcome to download any of them and install them on your server.
Your log files can grow quite large and quite fast, especially if your site is getting a large number of hits per day. The size of these files can eat into your disk quota and tie up needed space.
To reset your log files, use the vnukelog command (see "The vnukelog Command").
Post Office Protocol or POP allows users to read their Internet EMail without having to log into a server and learn a cumbersome EMail program and/or operating system. Instead the user continues to use the operating system he or she is familiar with and a compatiable POP client. Now a company or individual can choose from many high quality, low cost, POP clients for nearly every major operating system, including Windows, MacOS and OS/2.
The Virtual POP service allows a company, new to email systems, to inexpensively establish an Internet EMail box for each employee which is activated by their own individual password. This is because with the VirtuaLand VirtualServer a company does not need to purchase an expensive commerical gateway or pay for the excessive dedicated Internet connection. Commerical SMTP (the Internet EMail protocol) gateways for Novell or Microsoft EMail systems can cost thousands of dollars to install.
With the Virtual POP server ISP costs can be lowered significantly by having the employees access their email with a shared dial-up Internet connection. For example, a small company could purchase a single dial-up account for the company. Rather than sharing the ISP's single POP EMail box included with the account the company could configure each individual employee's computer to use an unique mailbox off the company's virtual POP server giving each member of the company their own individual Internet mail address. Each employee would have their own unique EMail account username and password but would share the dial-up or ISP account username and password. The EMail account username and password is configured in the POP client software as shown in section 6.5.
To create POP accounts for email users, log into the server using the virtual administrator login name and password and use the vadduser command. For example:
yourserver: {2} % vadduser
Email User Names are up to 8 characters and consist of upper or lower
case alphabetic characters or digits. They must start with an
alphabetic character and should generally be all lower case.
Email User Name: biff
Now enter a password for this user's POP mail account. For security
reasons you may want to use a password that is longer than 6 characters
and that has at least one non alphabetic character. The password will
*not* be echoed to the screen and you will be required to type it twice.
POP password: <biff's password>
Retype POP password: <biff's password again>
Now enter the EMail User's full name. Please use less than 80 characters
and no ':' characters.
Full Name: Bifford McLean
Email User added successfully.
After entering the email user's name, the password, and the full name for the account it will be added. This will setup the electronic mailbox for the user.
From time to time users will forget their POP account password. You can not recover this password but you can reset the password to something else with the vpasswd command. For example:
In this example, the email user biff's password is changed.
To remove an unwanted email user account use the vrmuser command. For example:
In this example, biff's POP email account is removed.
To view a list of your current Email/FTP account users use the vlistuser command. At a telnet command prompt type:
yourserver: {1} % vlistuser
In general, the POP client needs to be configured to get its mail from the VirtuaLand VirtualServer and to use the VirtuaLand VirtualServer as a SMTP relay host. This section shows how to configure two popular POP client software packages (Eudora and Pegasus Mail) for the PC. Please note that both Eudora and Pegasus Mail are also available for the Macintosh and are similarly configured.
Eudora for both the Macintosh and PC is available from ftp://ftp.qualcomm.com/Eudora. Eudora comes in two forms: freeware and a commercial version. The commercial version has many enhancements but costs a little money (for more information send mail to eudora-sales@qualcomm.com).
Eudora for Windows is shown in Figure 4. To configure Eudora to use the VirtuaLand VirtualServer son.org for the email user Pamela I would do the following:
Once this is done Eudora is ready for the email user. When Eudora is invoked it will prompt the user for his or her EMail password (see sections 6.2 and 6.3).
FIGURE 4 Eudora for Windows
FIGURE 5 Eudora's Configuration Dialog
Microsoft's Internet Exchange and Netscape's Mail client are both able to be configured to receive Email from your virtual POP server. The settings will be similar to those listed in "Configuring Eudora" on page 38. For more specific information on these programs, see their respective help files contained with the programs.
We have developed the iManager server extension and iRoot plug-in. These programs provide users with a web interface to many common administrative and maintenance tasks associated with a VirtuaLand VirtualServer. These extensions enable the user to maintain his or her server from a web interface without ever needing to log on to the VirtuaLand VirtualServer in a telnet or FTP session. A user can now do many tasks easily and efficiently from their browser of choice.
These programs are available for users to load onto their server from the Server Extensions directory (contact us for exact location). These extensions can be used in conjunction with remote web authoring tools such as FrontPage from MicrosoftTM. With these tools a secretary can be the webmaster for her company.
The rest of this chapter will introduce you to the simplicity and functionality of the iManager extension and iRoot plug-in.
The iManager extension will enable you to do the most common tasks associated with maintaining the files on your server with a nice web interface. This extension will reduce your need to telnet to your server to change file properties. The iManager will execute many commands for you that are commonly used so you can keep your Unix knowledge to a minimum. These tasks include:
To install iManager, telnet to your VirtuaLand VirtualServer and perform the following steps:
You can now use the iManager utility on your server by accessing the URL:
http://your_domain_name/cgi-bin/admin/gateway.cgi
You can either open the URL with your browser directly, or link the URL to either text or an image on one (or more) of your web pages.
The iManager extension is also run from your web browser. Enter the following URL into your web browser substituting
http://www.
This page will prompt you for your root password. Simply enter your VirtuaLand VirtualServer root password and click on the Start iManager button. When iManager is started, you will see a screen that shows you your current working directory on your server followed by a list of entries in that directory. You can move around the directories by modifying the Path Specification box and clicking on the Change Directory button. If you want to change to a directory below your current working directory, you can also simply click on the directory name that is in the list below the Change Directory button.
If your list of entries within your current working directory contains a graphic file or a home page file, you can click on the name of that file to bring up a small browser window that will show you the graphic image or the home page file. You will also notice that the list of entries shows you not only the name, but also the file size, the date the file was last modified, the mode or permissions of the file, and a series of options to edit, delete, copy, move, link, or chmod (change permissions) for that file. These options will be discussed in more detail below.
The iManager extension allows you to edit the text files, such as html files, from within your web browser. This is useful if you need to make a quick change and do not want to telnet to your server to do it.
When you start iManager and look at the list of entries you will notice the column titled Edit. The entries will either have ED, CD, or a blank in this column. If the entry has ED, then it is an editable text file. Click on the ED to begin editing. If the entry has the CD option in the Edit column, then you know the entry is a directory. By clicking on the CD you will change to that directory as your current working directory and a new entry list will appear. If the entry has no option in the Edit column, then you know that the file is neither a directory nor an editable file. Graphic images will appear like this.
The iManager extension also allows you to delete files and directories from your server without actually telneting to your server to do it.
When you start iManager and look at the list of entries you will notice the column titled Delete. All the file and directory entries below will have the RM listed in this column. The RM stands for the rm (remove) unix command. Clicking on the RM will take you to a screen to confirm that you want to delete the selected file or directory.
The iManager extension can copy files on your server to a new file and a new location.
When you start iManager you will see the column titled Copy. Click on the CP option for any of your files or directories and you will be taken to the Copy File or Copy Directory page. On this page you will be prompted to enter the name of the new copy you are creating for the file or directory you selected. You are also able to change the path for your copy if you would like to place it in a directory other than your current working directory.
Moving a file in iManager is also quite simple. When iManager is running you will see the column titled Move. Click on the MV option for any of your entries and you will be taken to the Move (Rename) File or Move (Rename) Directory page.
This page is very similar to the Copy File or Copy Directory page. However, this page uses the mv Unix command which actually moves the file or directory to a new location or renames the file or directory.
The iManager also allows you to link files with symbolic links. Symbolic links enable you to have one file actually point to another file. For example, if you have a few files with different names that are all actually the same file, you can link them all to one file. This way if you need to change this file you can change it once and it will affect all the linked files.
For a more extensive understanding of symbolic links see "Creating Symbolic Links".
To link a file with iManager, click on the LN under the Link column. This will take you to the Create Link to File or Create Link to Directory page. At this point you will be prompted to enter the name and path of the file you want to link to the file you selected.
If you have a file called index.html and want to link a new file called welcome.html to it, select the LN next to your index.html file. On the Create Link to File page enter the Filename as welcome.html. Now when someone accesses welcome.html from the web it will actually give them the index.html file. If you edit your index.html file, the welcome.html file will show the changes.
iManager allows users to change the permissions of files from their browser. To change the permission of a file click on the CM next to the filename. If you are unsure about what file permissions you need for a file or directory then leave them alone.
You can use iManager to upload a file for you from your local computer to your VirtuaLand VirtualServer without the need of an FTP client. From the iManager main screen go to the Upload File to Current Working Directory section. In this section enter the Local Filename of the file located on your computer that you want to upload to your VirtuaLand VirtualServer. You can use the Browse button if you need to look around your computer to find the proper file.
Then enter the Remote Filename or name that you will want to call the file once it is loaded onto your server. You can also change the Remote Path if want to upload the file to a directory other than your current working directory.
When you have selected the correct file and correct remote filename and path, click on the Upload File button.
Within iManager you are able to add a new directory to your VirtuaLand VirtualServer under your current working directory. Simply go to the Make New Directory section of iManager and enter the new directory name. Click on the Make New Directory button and it will be created.
The iRoot plug-in will enable you to do the most common tasks associated with maintaining your server. These tasks include:
To install iRoot, telnet to your VirtuaLand VirtualServer and perform the following steps:
tar -xvf /usr/local/contrib/iroot.tar
You can now use the iRoot utility on your server by accessing the URL:
http://your_domain_name/cgi-bin/admin/gateway.cgi or
You can either open the URL with your browser directly, or link the URL to either text or an image on one (or more) of your web pages. The iManager utility will look for the existence of the iRoot plugin and if found will include an authentication form for the iRoot utility.
The iRoot plug-in is run from your web browser. Enter the following URL into your web browser substituting
http://www.
This page will prompt you for your root password. Simply enter your VirtuaLand VirtualServer root password and click on the Start iRoot button.
Once you have the iRoot plug-in running, follow these steps:
Once you have the iRoot plug-in running, follow these steps:
Once you have the iRoot plug-in running, follow these steps:
Once you have the iRoot plug-in running, follow these steps:
Once you have the iRoot plug-in running, follow these steps:
Once you have the iRoot plug-in running, follow these steps:
Once you have the iRoot plug-in running, follow these steps:
Once you have iRoot running, go to the Digital Certificate section to create and install a digital certificate for your server.
A digital certificate allows you to have secure home pages via SSL (Secure Sockets Layer) Encryption. This is especially important if you are asking customers to enter their credit card data into your on-line forms.
For more information on digital certificates and encrypted home pages send us an Email request.
The VirtuaLand VirtualServer system is a powerful system that allows you to do many things that you simply cannot with a virtual "host." This chapter is designed to introduce you to some commands and information that will help you make the most out of your VirtuaLand VirtualServer.
The quota command is used to help you identify how much disk space you have on your VirtuaLand VirtualServer, and of that space, how much you have already used. At a telnet command prompt, simply type quota.
yourserver: {1} % quota
The command will output your blocks, limit, files, and file limit.
The vdiskuse command is useful in showing you where most of your disk space utilization is going. The command will return a listing of your directory structure along with the amount of disk space used in each directory.
To use the vdiskuse command, simply telnet to your server and type the following:
yourserver {1} % vdiskuse
If the output is too long to fit onto one screen, you can add the more command. The more command will show just one screen of information. When you hit the space bar the next screen will scroll into view.
yourserver {2} % vdiskuse | more
You can also have this report Emailed to you if you don't want to read it off your screen. Type this at the telnet command line and replace yourname@domian.com with your Email address:
yourserver {3}% vdiskuse | mail yourname@domain.com
Sometimes you will have files that are counted against your quota that you cannot see with the vdiskuse command. For example you will run quota and it will show you as using 25 Meg but vdiskuse will show you as using only 10 Meg.
This happens when you try to delete files that are opened for some reason. The most common cause of this is trying to delete your log files when they are actually being written to by the server. That is why it is so important to use the vnukelog command.
However, if this happens type the following at a telnet command prompt replacing
yourserver {4}% ps -aux | grep
It will return a list of processes that might have one that looks similar to this:
Look for processes that are over a day old such as this one and kill them by process id. The process id is the first number listed after your username. In the above example the process id is 4769. This will free up the space the locked files were taking:
yourserver {5}% kill
Your access log files will likely be your largest user of disk space. It is wise to reset or nuke your log files when they get large. (For more information on your log files see "Monitoring Your Virtual Web Server Log Files" on page 18) You can do this by simply typing vnukelog at a telnet command prompt.
yourserver: {1} % vnukelog
When users have trouble reaching their VirtuaLand VirtualServer, or their connection time is slow, the traceroute command can be used to find out where the trouble is. This command can be issued from the users local machine running Microsoft's Windows 95, or from the VirtuaLand VirtualServer itself if you are able to telnet to the server.
The traceroute command follows the data route from the machine where you begin the route to the machine you route to. The route returns many different bits of information, but the most important thing to look for are asterisks ( * ). These indicate packet loss along the route. Packet loss along the route translates to slow, or completely inaccessible service.
If the packet loss occurs from your ISP computer systems, you can call them and ask why things are so slow. If it occurs somewhere in between your ISP and your VirtuaLand VirtualServer, you will need to wait it out or try another ISP that might have an alternate route. If the packet loss occurs within the VirtuaLand VirtualServers computers, send Email to us to see when it will be cleared up.
To run the command from your VirtuaLand VirtualServer, simply telnet in and type /usr/sbin/traceroute www.domain.com (substituting your ISP's domain name for www.domain.com). For example, if you were having trouble connecting from your service provider whose domain name was acmenet.com, you would type the following on your VirtuaLand VirtualServer:
yourserver: {1} % /usr/sbin/traceroute www.acmenet.com
If you were having trouble even logging in to your VirtuaLand VirtualServer, you can run a traceroute from your Windows 95 machine. At a DOS prompt you type tracert www.domain.com. You would substitute www.domain.com with the domain name of your VirtuaLand VirtualServer. For example, if your VirtuaLand VirtualServer domain name was acmenet.com, you would type the following:
C:\Windows>tracert www.acmenet.com
As a VirtuaLand VirtualServer reseller/client, you have access to a large array of programs that can really enhance the functionality of your VirtuaLand VirtualServer. These programs are all located in the "contributed" area, or /usr/local/contrib. This /usr/local/contrib is not a directory within your directory structure, but a directory of the host machine root from which you are able to copy programs.
The programs and utilities that are located in the /usr/local/contrib are not directly supported by our technical support since they were largely developed by third parties. Many of the contributed programs come with a large amount of documentation that should be reviewed and understood. Furthermore, many of the programs have license agreements that you should make yourself familiar with and agree to.
For the most current listing of programs available for you in the Contrib directory Email us. The following is a list of programs and their functionality at the time of this printing:
You will also find links to our free CGI library and Java Applet examples at this site.
You might find it necessary at one time or another to create symbolic links between files, or even directories. On the VirtuaLand VirtualServer system, we have created a symbolic link for the usr/local/etc/httpd directory. The link is simply www. From your home directory, you can type cd www and it will place you in the same directory as if you had typed cd usr/local/etc/httpd.
Links can be for your convenience in navigating around your site, or can be used to create a series of home pages that actually point to a different page. One of the most used links on the VirtuaLand VirtualServer system is the link to the index.html.
The default home page that comes up for each directory of your web server is the file named index.html. If you do not have an index.html file, then a directory listing will come up in the users web browser. However, some people do not want to call their default page index.html for various reasons. There are two ways around this. First, you can change the DirectoryIndex parameter in your srm.conf file (see Section 2.2.2 on page 10), or you can create a simple symbolic link.
To create the link, telnet to your server and go to the directory where your files are located. Assuming you have a file called welcome.htm and you want it to be the default home page for that directory, type this at the command prompt:
yourserver: {1} % ln -s welcome.htm index.html
This will establish a link that points index.html to welcome.htm.
Unlike a traditional introduction to Unix, the emphasis of this one is on philosophy and brevity. When you understand how the creators of Unix intended you to use it, you'll approach Unix on it's "best side". This introduction intends to help a new Unix user get started on the right foot quickly. For more information, readers are referred to the Unix manuals and other listed references. As little detail as possible has been duplicated from the manual.
In some ways, Unix is "old technology" - it was invented in the late 1960's for a small computer with a 64K-byte address space, it is largely character oriented (not graphic). Why is it still here? Why is it spreading to more and more systems from PC's to Cray Supercomputers? One answer is that Unix is written in a mostly machine independent way (in the high level language "C") and is therefore more easily moved to new machines. Once Unix has moved, a large base of applications also moves easily and your investment in learning Unix continues to pay off. Another answer is that many problems are still character oriented (or at least can be approached that way) and for these problems, like a sharp tool in the hands of a skilled user, Unix really helps you get your work done. Also, you can use Unix from any kind of terminal and over dial-up phone lines or computer network connections.
In the space below, I hope to convey, with a minimum of specific information, the essence of "The Unix Philosophy" so that you can use and enjoy Unix at its best. To try to summarize in just two sentences (for those who really believe in such brevity): Unix comes with a rich set of connectable tools which, even if they don't directly address the problem at hand, can be conveniently composed (using the programmability of the command interpreter) into a solution. Unix also imposes relatively few arbitrary limits and assumptions on the user or the problem domain and has thereby proven to be a suitable platform on which to build many useful and highly portable research and commercial applications.
Before I can realistically hope to say more about Unix in general, or give meaningful examples, I must briefly explain some Unix commands and concepts. These descriptions are intentionally minimal. You will soon see how to find more detail in the manuals.
Unix is a multi-user operating system. This means that several users can share the computer simultaneously. To protect each user's data from damage by other users, Unix requires each user "login" to the system to identify him/herself (with a login name) and authenticate him/herself (with a password). During the login process, a user's defaults and "terminal type" are usually established. The mechanism Unix uses to allow concurrent users also allows each user to have more than one program (also called "process" or "commands") running concurrently. You will see shortly how convenient this is.
Once you have logged in, you will be running a program called your "login shell". The shell is a program which executes the commands you type in and prompts you when it is ready for input. One of the nice features of the Unix shell is that it is a powerful programming language unto itself, however one need not program it to use Unix. There are several different "shell" programs in common use: csh (c-shell), sh (bourne-shell), ksh (korn-shell), vsh (visual-shell) to name a few. Most people use "csh".
Unix commands consist of a program name followed by options (or arguments) to that program (if any). One or more spaces follow the program name and separate arguments. Each program examines its argument list and modifies its behavior accordingly. By convention, arguments which begin with a dash are called "switches" or "flags" and they are used to request various non-default program behavior or to introduce other arguments. It is occasionally important to remember that it is the shell which does filename expansion (such as turning "*.old" into "a.old list.old program.old"). Programs normally don't ever see unexpanded argument lists. Many Unix programs can also take implicit arguments. These are available (to every program you run) via the "environment". Your "terminal type", stored in an environment variable called TERM, is an example of this. The manual for each program you use should list the environment vari-ables it examines and the manual for your shell explains environment variables in detail.
Before getting into any specific commands and examples, note that most Unix systems have both on-line and printed manuals. Many commands will be mentioned below in passing without explanation. It is assumed that the interested reader will look them up in the manual.
The on-line manuals generally contain only the numbered sections of the printed manuals. The tutorials and in-depth articles are usually only in printed form. This introduction intends to reproduce as little of the information contained in the Unix manuals as possible. For more information on any Unix command, type "man command" ("man man", for example gets you "the manpage" for the on-line manual command: man). (Note: if you are prompted with the word "more", you are interacting with the "more" program. Three quick things to know: you may type a space to get the next screenful, the letter "q" to quit, or "?" for a help screen.)
Among other things, the man-page for the "man" command points out that "man -k word" will list the summary line of all on-line man-pages in which the keyword: word is present. For example, "man -k sort", will produce something like this:
This tells you that section 1 (user commands) of the manual has man-pages for comm, look, sort, sortbib, tsort. Use the man command on any of these to learn more. The other numbered sections of the Unix manual are for system calls, subroutines, file formats, etc. You can find out about each section of the manual by saying, for example, "man 2 intro". Enough about manuals.
By convention, whenever possible, Unix programs don't explicitly specify from-where to read input or to-where to write output. Instead, programs usually read from "standard input" (stdin for short) and write to "standard output" (stdout). By default, standard input is the keyboard you logged in on and standard output is the associated display, however, the shell allows you to re-direct the standard output of one program either to a "file" or to the standard input of another. Standard input can be similarly redirected. Perhaps Unix's greatest success comes from the ability to combine programs easily (by joining their standard inputs and outputs together forming a pipeline) to solve poten-
tially complex problems.
"Standard error" (stderr) is not usually re-directed, hence programs which write warnings, prompts, errors, etc. to stderr will write them to the display even when normal input and output is usefully re-directed. (Note that since I/O devices are implemented as files on Unix, I/O re-direction also works to and from physical devices.) The syntax for I/O re-direction is fully described in the manual for the shell you are using (probably csh).
The following are some simple examples of I/O re-direction. For clarity, the shell's ready-for-input-prompt has been shown as "Ready%" and explanations have been inserted in italics. Everything the user would type is shown in slightly bold type after the Ready% prompt.
Running the "date" command prints today's date and time on standard output
Put the standard output from the date command in a file called "myfile"
Use the word-count program to count the number of lines, words, characters in "myfile"
Pipe the output of the date command directly into the word count command. Note that commands in a pipeline such as this can run simultaneously.
Use output from one program as command line arguments to another
Look in the on-line dictionary for words beginning with "pe" and count how many are found
Pipe those 294 lines through cat -n to insert line numbers and then through sed to select only lines 5-8
Now, from those 294 words, select only those containing "va" somewhere and re-direct them into the argument list of the echo command
Grep (search) through all files with names ending in ".c" for lines beginning with "#define". (Grep -l lists the file names containing the lines which match instead of the lines themselves). These file names are redirected to form the command line of the vi editor - hence, edit all ".c" files which contain "define" statements.
When a program reads from a file or from a pipe it can tell when there is no more to read. This condition is called reading the "end-of-file" or EOF. When standard input is a terminal, the EOF must be explicitly typed because the program must otherwise assume you are still typing. Normally EOF is typed as a CONTROL-D (indicated in print as ^D). Think of the control key as another SHIFT key - it must be pressed and held when the D is typed. If the EOF is not the first thing on a line, two must be typed.
If you are running a program and you wish to interrupt it completely, you can often do so by typing ^C. You can try this with the "wc" program (run wc then interrupt it):
run wc then type EOF
Note that both ^D and ^C ended the program however, ^D allowed the program to finish normally but ^C killed it (and produced no output). If, for some reason, you want to type a special character such as ^C and actually have it sent to your program and not generate an interrupt, you can "quote it" by typing a backslash (or sometimes a ^V) before it. The backslash also "quotes" shell "meta-characters" such as asterisk, question mark, double-quote, backslash, etc.
"Job control" is the name given to an extremely convenient feature of many modern versions of Unix. Job control allows one to suspend a program and resume it later. If you are in the middle of running some program when the phone rings, you can type ^Z to suspend the program (and get back to your shell prompt) without interrupting or exiting that program. After you handle the phone call, you can type "fg" to resume the original program right where you left off. Unix permits one to have a fairly large number of suspended jobs and to resume them in any order. Csh's "jobs" command displays which jobs are stopped. (In some ways, job control is "a poor man's window system"; however, even on Unix systems with windows, many people find job control indispensable.) For more information on job control, see the "csh" man-page.
Unix files exist in directories. Every user has a "home directory", which is the "current directory" after logging in. A user can make "sub directories" with the "mkdir", command and make them the current directory with the "cd" command. You can print your current directory with the "pwd" command and you can refer to the parent directory as ".." (two dots). You can get back to your home directory by typing "cd" with no arguments.
Files and directories have permissions called "modes" which determine whether you, "your group", or everyone can: read, write, or execute the file. Permissions are changed with the "chmod" command. The main reason for bringing this up now is to point out that a collection of commands which can be typed to the shell can also be put in a file, given a name, made executable and subsequently invoked as a new command by that name. This type of file is called a "shell script" and is one of the main ways Unix is customized to the work habits and chores of its users.
When a user types a command, s/he usually doesn't type the full (and unambiguous) path name of the program: (/bin/date for example) but instead types only the last component of the path name, date, thus requesting the system to search for it. To achieve predictability and efficiency, the system searches only those directories listed in your PATH environment variable and it searches them in that order. By placing your own version of a program in a directory you search before the system directories, you can override a system command with your own version of it.
Your version can be anything from an entirely different program to a simple shell script which supplies some arguments you always use and then calls the standard version. The command "echo $PATH" will print the value of the PATH environment variable to stdout. The procedure for setting environment variables such as PATH differs from shell to shell. See the man-page for the shell you use.
Well, so much for the nitty-gritty. I will now try to explain "The Unix Philosophy" in a bit more detail. Basically, the idea is that rather than have a custom program for each little thing you want to do, Unix has a collection of useful tools each of which does a specific job (and does it well). To get a job done, one combines the pieces either on the command line or in a shell script. For example, on Unix, a user would not expect an application to provide an input text editor. Instead, one would expect to be able to use one's favorite (and standard) "text editor" (probably "vi", perhaps "emacs") for all instances of editing text. Electronic mail, C programs, shell scripts, documents-to-typeset can all be edited with the same text editor. By convention, applications invoke the text editor you have specified in your EDITOR environment variable.
Even though Unix editors are generally very powerful and capable programs, they too recognize that they are just tools and they allow you to pipe all or part of your "editor buffer" through any pipeline of Unix commands in order to do something special for which there isn't a built-in editor command. (The editor buffer is that private copy of your file to which the editor makes changes before you save them.)
Unlike most other operating systems, Unix has only one "file type". Any program which can read or write standard I/O can read/write any "file" (even if it is a device such as a terminal, printer or disk). Granted, not every program can make sense out of the data in every file, however, that is strictly between the program and the data - nothing imposed by Unix. The single file-type contributes greatly to the modular/re-usable pipes-and-filters approach to problem solving.
So, what is to be learned from all this? Just that it is good to construct solutions to your problems in as general and modular a fashion as possible. You will undoubtedly find that a somewhat general program (or shell script) you wrote as part of the solution to one problem will be just what you need as part of the solution to some future problem and it will be simple to hook up.
Let's assume the following problem, inspired by a real-world situation. You are a professor of English and someone walks into your office with an old manuscript claiming it is an undiscovered work by Shakespeare. You postulate (correctly) that you can use statistics about frequency of word usage to help determine its authenticity. The problem, therefore, is to come up with a histogram (count) of the number of times each word is used.
You could, of course, write a program from scratch in C or FORTRAN to do it, however a partial solution comes to mind using "awk", a programmable text processing tool which has 2 particularly useful features: 1) lines are read and processed automatically; 2) arrays can have text-string subscripts. So, if you hadn't already written a "histogram" shell script, you write one now. (Keep it around, you will find a use for it again.) The file "histogram" has the following contents (de-mystified somewhat below):
For each line with NF > 0 (NF is awk-talk for number-of-fields-on-this-line, hence for each non-empty line), add 1 to that particular counter hereby associated with the-text-on-this-line ($0 is awk-talk for the-text-on-this-line). Then, at the END of input, for each unique input line; print that line preceded by the count of how many times it was seen.
So, now the task is simply getting the input into a format where all punctuation marks are removed and each word appears on a line by itself. Again, you could write a program to do it; you could manually reformat the text with an editor; or you could notice that Unix has a translate command "tr" which will do just what you want when used in two steps as shown:
The first "tr" command has options -dc (delete the complement of the indicated characters) so it will delete from standard input all characters except those which are listed (letters, apostrophe, space, and octal 012 (newline)). The resulting output has no punctuation. The second "tr" translates all spaces into newlines, thus causing at most one word to be on each line.
Piping the output of these two commands into "histogram" will give us word counts. Piping the output of histogram into "sort -n" will sort the histogram in numerical order. Putting the whole thing in a file and making it executable makes it available as conveniently as if it had been built into Unix.
Here then is some sample input and the output our script produces:
And the output of tr ... | tr ... | histogram | sort:
Note that other simple solutions to the problem exist. Our awk-based histogram program can be replaced by "sort | uniq -c" (but that is less intuitive than the awk solution and not necessarily any better). Also, "sed" could have been used in place of either or both of the "tr" commands. (Sed is much more powerful than tr however the sed command line would have been less intuitive.)
Probably the two biggest advantages of concurrent execution of commands in a pipeline are: 1) No disk space is required for intermediate data which flows through pipelines. 2) output can start coming out the end of the pipeline before the entire input is processed through the first program in the pipeline.
For example, imagine you want to compute a histogram for a very large file which is compressed and your disk is too full to hold the uncompressed version. You can uncompress it to standard output and pipe that directly into your histogram pipeline.
Now imagine you have a pipeline which takes 30 minutes to compute and produces data which takes 30 minutes to print. If you first computed and then printed, it would take 60 minutes. If you re-direct the output of the pipeline to the printer, the whole process only takes 30 minutes. (Note: you can output directly to a device such as a printer but in a multi-user environment the normal printing mechanism is to spool the output in a file (with "lpr") and print it after the computation finishes.)
On Unix you can run any number of programs "in the background", which means that the shell doesn't wait for them to finish before giving you a new prompt. Read more about this in the manual for your shell.
You can also have programs started for you automatically at certain times of the day, week, month, etc. (read about "at" and "cron") or when certain events happen, such as when electronic mail arrives.
Since it is not the intent to duplicate information from the Unix manual in this introduction I won't give many details about the following programs, however, I would like to point them out so you can look them up in the manual if you are interested. Most manual pages have a "SEE ALSO" section at the end. Consider yourself invited to read up on those programs as well. (If you really want to know everything, look up every program in every directory in your $PATH!)
7.1.3 Editing a File with iManager
7.1.4 Deleting a File with iManager
7.1.5 Copying a File with iManager
7.1.6 Moving a File with iManager
7.1.7 Linking a File with iManager
7.1.8 Changing the Permissions of a File with iManager
7.1.9 Uploading a New File to your Server with iManager
7.1.10 Making a New Directory with iManager
7.2 The iRoot Plug-in
7.2.1 Installing the iRoot Plug-in
http://your_domain_name/cgi-bin/admin/vs/gateway.cgi 7.2.2 Running the iRoot Plug-in
7.2.3 Adding Email and FTP Users - vadduser
While using the vadduser Wizard or any of the iRoot Wizards, you can use the Prev and Next buttons to navigate forward and back to make any changes you need to before you complete the final step.
7.2.4 Changing Email and FTP Users' Passwords - vpasswd
7.2.5 Removing Email and FTP Users - vrmuser
7.2.6 Adding an Email Alias
7.2.7 Deleting an Email Alias
7.2.8 Updating Your Aliases File - vnewaliases
7.2.9 Changing Your Server Root Password - passwd
7.2.10 Creating and Installing a Digital Certificate for SSL Encryption
CHAPTER 8 - The iManager Server Extension and iRoot Plug-in
8.1 Overview
8.2 The quota Command
8.3 The vdiskuse Command
8.3.1 Dead Processes Taking Up Disk Space
8.4 The vnukelog Command
Successfully deleted messages log.
Successfully deleted access_log.
Successfully deleted error_log.
Successfully deleted agent_log.
Successfully deleted referer_log.
8.5 The traceroute Command
8.6 The Contrib Directory
This script is an easy way to handle form content and have it mailed to some specified address. The form can also be modified to send an auotmated response back to the remote client.
PGP(tm) uses public-key encryption to protect E-mail and data files. PGP is well featured and fast, with sophisticated key management, digital signatures, data compression, and good ergonomic design.
This script is an easy way to handle form content and have it mailed to some specified address encrypted with your PGP(tm) public key. The form can also be modified to send an automated response back to the remote client.
A simple CGI to perform lookups on domain names.
WWW Board is a web bulletin board message system. The script provides some administrative utilities to manage the bulletin board.
A CGI program to keep record of the raw hits of a web page. It generates a GIF image of the number of hits and returns to the browser as an in-lined image.
An access statistics package with a web interface. 8.7 Creating Symbolic Links
APPENDIX A An Overview of UNIX
A.1 Overview
A.2 Why Use Unix?
A.3 Essential Commands and Concepts
A.3.1 Login
A.3.2 The Shell, Commands and Arguments
A.3.3 On-line Manuals
comm (1) - select or reject lines common to two sorted files
look (1) - find lines in a sorted list
qsort (3) - quicker sort
qsort (3F) - quick sort
scandir, alphasort (3)- scan a directory
sort (1) - sort or merge files
sortbib (1) - sort bibliographic database
tsort (1) - topological sort
A.3.4 I/O re-direction: stdin, stdout, stderr, pipes
Ready% date
Wed Mar 22 13:06:30 PST 1989
Ready%
Ready% date > myfile
Ready%
Ready% wc < myfile
1 6 29
Ready%
Ready% date | wc
1 6 29
Ready%
Ready% echo My computer, `hostname`, thinks today is `date`
My computer, samburu, thinks today is Wed Mar 22 13:06:30 PST 1989
Ready%
Ready% look pe | wc
294 294 2548
Ready%
Ready% look pe | cat -n | sed -n 5,8p
5 peaceful
6 peacemake
7 peacetime
8 peach
Ready%
Ready% echo I found these: `look pe | grep va`.
I found these: Pennsylvania Percival pervade pervasion pervasive.
Ready%
Ready% vi `grep ^#define *.c`
The depiction of an interactive session with the "vi" editor is omitted.
Ready%
A.3.5 Special characters: Interrupt, End-Of-File, Quoting, `Job Control'
Ready% wc
sample input
^C
Ready%
Ready% wc
sample input
^D
1 2 13
Ready%
A.3.6 Files, Permissions, Search PATH
A.4 The Unix Philosophy
A.5 A `Typically Unix' Solution
awk `
NF > 0 { counts[$0] = counts[$0] + 1; }
END { for (word in counts) print counts[word], word; }
`
tr -dc "a-zA-Z' \012" | tr " " "\012"
One black bug bled blue black blood
while another blue bug bled black.
1 One
1 another
1 blood
1 while
2 bled
2 blue
2 bug
3 black
A.6 More about Pipelines and Concurrent Execution
A.7 Other Especially Useful Unix Programs to Read About
A.8 Other Sources of Information
Footnotes
©1996-97 VirtuaLand Network Solutions
1997 - All Rights Reserved