| |
The Virtual Server System
CHAPTER 1 The Virtual Server
1.1 Introduction to the Virtual Server System
1.2 How the Virtual Server System Works
1.2.1 Virtual Internet Services Offered
1.2.2 The Virtual Server Administrator
1.3 A Tour of the Virtual Server
CHAPTER 2 The Virtual Web Service
2.1
Introduction
2.2 Virtual Web Server Configuration Files
2.2.1 The httpd.conf File
2.2.2 srm.conf Parameters
2.2.3 access.conf Configuration File
2.3 Creating Web Pages
2.3.1 HTML Editors and Tools
2.4 Using the Common Gateway Interface (CGI)
2.4.1 Writing Your Own CGIs
2.4.2 Imagemaps
2.4.3 Simple Forms
2.4.4 Server Side Includes
2.5 Monitoring Your Virtual Web Server Log Files
2.6 Generating Automated Getstats Reports
2.7 Using WWW Stat as an Alternative to Getstats
2.8 Resetting Your Virtual Web Server Log Files
CHAPTER 3 The Virtual FTP Service
3.1 Introduction to FTP
3.2 Anonymous FTP vs. FTP
3.3 The Name of the Virtual FTP Service
3.4 Your Anonymous FTP Directory
3.5 Making an "incoming" Directory for Customers
3.6 Log In Banners and Directory Messages
3.7 Creating Non-Anonymous FTP Accounts
3.8 Monitoring Anonymous FTP Activity
CHAPTER 4 The Virtual Email Service
4.1 Introduction to Email 31
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
CHAPTER 5 The Virtual POP Service
5.1 Introduction to POP
5.2 Creating POP Accounts for Email Users
5.3 Changing a Mailbox Password
5.4 Removing a POP Email Account
5.5 Listing POP Email Account Users
5.6 Configuring the POP Client Software
5.6.1 Configuring Eudora 38
5.6.2 Configuring Microsoft's Internet ExchangeTM
and Netscape's MailTM
CHAPTER 6 Helpful Commands and Useful Information
6.1 Overview
6.2 The quota Command
6.3 The vdiskuse Command
6.3.1 Dead Processes Taking Up Disk Space
6.4 The vnukelog Command
6.5 The traceroute Command
6.6 The Contrib Directory
6.7 Creating Symbolic Links
CHAPTER 7 The iManager Server Extension and iRoot
Plug-in
7.1 The iManager Extension
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
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
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.4 The Unix Philosophy
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
CHAPTER 1 The Virtual Server
1.1 Introduction to the Virtual Server System
Your personal virtual server 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 would require
you to purchase a high speed Internet connection, costly equipment, and
even a support staff. With the Virtual Server 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 Virtual
Server technology you normally would have to do the following to establish
a presence on the Internet for your company.
- Purchase a lease line or frame-relay circuit
from your local common carrier (such as US WEST) from your office to
an Internet Service Provider (ISP).
- Purchase a high speed CSU/DSU (a device similar
to a MODEM) for your office and maybe a second CSU/DSU for your ISP.
- Purchase a high speed router (a networking
device used for converting the signal you get from the CSU/DSU into
something your server can use) for your office and, again, maybe for
your ISP.
- Purchase Internet bandwidth from your ISP.The
Virtual Server 2 The Virtual Server System
- Purchase an Internet server computer for your
office configured with a good amount of memory, disk storage and a tape
backup system.
- Purchase and install a server operating system
(such as UNIX or Windows NT) for the server above.
- Purchase and/or install web server software,
FTP (see later chapter), and electronic mail software on the Internet
server above.
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 Virtual Server 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 notice significant
network delays during peak usage hours to these sites, however, customers
accessing larger companies with faster connections (such as a full, dedicated
T1 or better) will not experience these delays. With a virtual server 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.
[contents]
FIGURE 2 The Virtual Server System
For office electronic mail (Email) services the Virtual Server System can
save your business money. Since each employee would have his or her own
mailbox on the virtual server 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 account that give them between 40-450
hours. (Prices vary with ISP and area.) Rather than purchasing a dial-up
accounts for each employee (normally what is required for individual mailboxes)
you could purchase one or two accounts and configure the mail client software
on each employee's computer to get their mail from the virtual server 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 could save up to $250 per month in just
Internet access charges.
The Virtual Server 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 incurring 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 and without
the sacrifice of starting with an inferior Internet service. If your company
after a period of time of being on a virtual server has developed a very
popular web page (on the order of 30,000-50,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. We can help you if want to have
your own dedicated server offsite. Contact us for more information concerning
these dedicated server products and services.
[contents]
1.2 How the Virtual Server System Works
The Virtual Server System uses the idea of
multiplexing a single UNIX server into multiple virtual machines. Each virtual
machine (or virtual server) user will get their own set of virtual services
that they may customize to their liking or needs. Each virtual server has
its own unique domain name and IP (Internet Protocol) address. When a request
comes in, the Virtual Server System will determine which virtual server
will service the request based on this unique IP address and then invoke
the appropriate service to respond to the request. Therefore, since the
virtual server will invoke a unique server based on the designation address
and port number of an IP request, each virtual server user may have his
own custom configuration or data files for their set of virtual services.
Also these virtual servers will log events to the user's own log directory
so that they may make access accounting summaries and generate individual
reports.
[contents]
1.2.1 Virtual Internet Services Offered
The Virtual Server System currently offers
the following Internet services:
- World Wide Web (WWW) or HTTP. This gives your
customers access to textual and graphical information about your company
and services.
- Netscape Compatible Encryption. This allows
you to offer your customers secure pages on the World Wide Web. This
is useful for online order forms requiring credit card information.
- Anonymous and Non-Anonymous File Transfer
Protocol or FTP. This gives your customers access to files that you
may want to give them (demo programs, patches, documents, etc.). The
non-anonymous option allows you to create specific FTP directories for
users who want to update their own pages on your site. Non-anonymous
FTP also allows you to create password protected FTP directories.
- Electronic Mail using Simple Mail Transfer
Protocol or SMTP. This allows you to exchange electronic messages with
your customers.
- Post Office Protocol or POP. This gives your
employees their own electronic mailbox to individually access.
Other services are being added to the Virtual Server System and will be
announced very soon. The following chapters will explain the above services
and how to efficiently use them.
Please note that the virtual server does not support multiple telnet or
shell accounts. However, it is possible to have individual mail and FTP
accounts which are accessible by each user using the Post Office Protocol
or POP and non-anonymous FTP. There is no limit to the number of these accounts
(other than storage) and they would be created by your company's virtual
server administrator.
[contents]
1.2.2 The Virtual Server Administrator
The virtual server administrator is a user
who is in charge of maintaining your virtual server. He or she will be given
a username and a password to the virtual server administrator account. This
username and password gives the administrator access to a normal shell account
on a UNIX server which is home to your virtual server. The virtual server
administrator responsibilities include:
- Adding or deleting virtual Email and FTP accounts.
- Adding or deleting Email aliases (forwarding
addresses).
- Uploading or downloading files to the virtual
anonymous FTP server.
- Maintenance of the HTML files of the virtual
web server.
- Installation and maintenance of CGI (Common
Gateway Interface) programs.
- Maintenance of virtual server log files.
It is important to assign someone as the virtual
server administrator who has a little UNIX and programming experience (or
who is at least willing to learn about UNIX and programming). Since each
virtual server account is given full access to all the configuration files
it is fairly easy to paint yourself into a corner (As the old UNIX saying
goes: "UNIX gives you enough rope to hang yourself plus a couple of
extra feet."). However, it is much easier to maintain a virtual server
system than a full UNIX system, since most of the work is done for you.
[contents]
1.3 A Tour of the Virtual Server
The following is a short tour of the virtual
server from the virtual server administrator's point of view. When you are
given a virtual server account you will be given the following information
about your server:
- The IP (Internet Protocol) address of your
virtual server. This is usually something like 192.41.5.20 and is not
important to remember since your unique domain name is an alias for
this address. It may be useful, however, when testing your server while
your domain name is being registered.
- The virtual server administrator login name.
This is the name the administrator will use so he or she can modify
and maintain the virtual server.
- The virtual server administrator password.
This is the password associated with the login name above. You may change
this password by using the UNIX passwd command. If you forget this password
send Email to us.
- The actual server host name. This is the name
of the actual machine where your virtual server is hosted.
1. As the old UNIX saying goes: "UNIX
gives you enough rope to hang yourself plus a couple of extra feet."The
Virtual Server Once you log in to the actual server as the virtual server
administrator you will see the following directories:
- bin This directory contains many useful
programs such as sh and cat for developing scripts for your virtual
servers. It also contains the virtual server programs.
- dev This directory contains the device
node null which is sometimes useful for scripts. It is also used by
the virtual servers.
- etc This directory contains many configuration
files associated with electronic mail (sendmail and POP) including the
aliases, passwd, and the sendmail.cf files.
- ftp This directory contains what your
customers will see when they use your virtual anonymous FTP services
(more on this in Section 3.1 on page 25).
- shlib This directory contains all the
shared library code for your virtual server program. If you don't know
what shared libraries are then don't worry about it.
- usr The usr directory contains
the following subdirectories:
- bin This is like the bin directory
above. It contains additional support programs.
- local/etc/httpd This directory
is your virtual httpd server's "root" (more on this in
Section 2.1 on page 7).
- log This directory contains useful
log "messages" from your virtual servers.
- mail This directory will contain
any virtual mailboxes for accounts that you may have created (more
on this in Section 5.2 on page 36).
- spool This directory is used by
your virtual mail handler for temporary files.
- www This is not really a directory at all
but rather a symbolic link to your usr/local/etc/httpd directory. This
is useful for getting to your virtual httpd's root directory quickly
(from your home directory you can type cd www rather than cd usr/local/etc/httpd).
These directories represent your virtual server's root directory even though
the command pwd (print working directory) 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/.
[contents]
CHAPTER 2 The Virtual Web Service
2.1 Introduction
The World Wide Web project has taken the Internet
by storm in spite 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 dynamic web
pages. 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 connection
graphical interfaces are available to even individual home users. 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 server is based on the NCSA HTTP (Hyper-Text Transfer Protocol)
server. (See http://hoohoo.ncsa.uiuc.edu/docs/Overview.html for more information
about NCSA's) 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:
- cgi-bin This directory contains some
CGI (Common Gateway Interface) programs that you may use with your web
pages. Of course, you may install others that you find elsewhere or
develop yourself.
- cgi-src This directory contains the
source code for the CGI's found in the cgi-bin directory above.
- conf This directory contains configuration
files for the virtual web server. These files are described in detail
in the section below.
- htdocs This directory contains your
initial home page (i.e index.html) and other html and graphic files.
- logs This directory contains various
log files. Section 2.5 on page 18 describes how to use these files.
[contents]
2.2 Virtual Web Server Configuration Files
The virtual web server configuration files
are pre-configured for you when you get a virtual server account, however,
you may need to customize these files a little to take advantage of some
advanced 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.
[contents]
2.2.1 The httpd.conf File
The httpd.conf files is for general configuration
of the virtual httpd. Table 1 below describes some of the parameters in
httpd.conf.
TABLE 1. httpd.conf Parameters
| Parameter |
Description |
| AccessConfig
filename |
filename
is either an absolute pathname or a partial pathname 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 purposes and tracing of protocol
violations. The default is AgentLog logs/agent_log. |
| DNSMode
level |
level
is the level of DNS resolution the server does on every request. The
options are none, miminum, standard, and maximum. The default is DNSMode
none. You can change this to any of the other options, but your
server will not run as fast. |
| 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 information 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 running 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 web server above which
users cannot trespass. The default is ServerRoot /usr/local/etc/httpd.
(Remember that the path /usr/home/<login name> gets translated
to simply / when the virtual server runs.) |
| TimeOut
seconds |
seconds
defines the maximum amount of time (in seconds) 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
of service requests, such as host, date, and file name. 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. |
[contents]
2.2.2 srm.conf Parameters
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.
TABLE 2. srm.conf
Parameters
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 .htaccess. |
| 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 uncompress 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 extensions (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.domain.com).
The default is DirectoryIndex index.html. |
[contents]
2.2.3 access.conf Configuration File
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:
- <directory /usr/local/etc/httpd/cgi-bin>
- AllowOverride Limit
- </directory>
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:
- All. Access control files are unrestricted
in this directory.
- AuthConfig. Enables the use of AuthName,
AuthType, AuthUserFile, and Auth-GroupFile directives.
- FileInfo. Enables the use of AddType
and AddEncoding directives.
- Limit. Enables the use of the limit
sectioning directive.
- None. No access control files are allowed
in this directory.
- Options. Enables the use of the Options
directive.
The directives enabled by the AuthConfig are
defined as the following:
- AuthName. Sets the authorization name
of the directory.
- AuthType. Sets the authorization type
of this directory. Currently, there is only one type: Basic.
- AuthUserFile. Specifies the file to
use that contains the list of users and passwords used in user authentication.
- AuthGroupFile. Specifies the file that
lists user groups for user authentication.
The directives enabled by Options include
the following:
- All. All features are enabled for the
directory.
- ExecCGI. CGI scripts can be executed
in this directory.
- FollowSymLinks. Allows the server to
follow symbolic links.
- Includes. Server-side include files
are enabled in this directory.
- IncludesNoExec. Enables server-side
include, but disables the exec server-side include command.
- None. No features are enabled for the
directory.
- SymLinksIfOwnerMatch. The server only
follows symbolic links if the target file or directory is owned by the
same user ID as the link.
Limit sectioning directive may include the
following:
- allow hostname. Allows specified
hosts to access the service.
- deny hostname. Prevents specified
hosts from accessing the service.
- order ordering. Determines the
order in which the allow and deny directives are evaluated. Customary
values are "deny,allow" and "allow,deny".
- require entity1 entity2... Entity
values can be user, group, or valid-user. These are the authenticated
users or groups that can access the system. Valid-users are users identified
by AuthUserFile.
Any directive between the delimiters apply
to the listing following the first delimiter.
For example:
- <Limit GET>
- order allow, deny
- allow from all
- </limit>
In this example, the sectioning directive,
Limit, determines who can retrieve information from the service, which,
in this case is "allow from all."
[contents]
2.3 Creating Web Pages
The default homepage for your virtual server
account is located in the file usr/local/etc/ httpd/htdocs/index.html
or, simply, www/htdocs/index.html. Your virtual server 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 virtual server.
If you do FTP your home page to the server, make sure you FTP in ASCII
mode and not Binary mode. All text files, including home pages should
be FTP'd in ASCII mode.
The default page for each subdirectory of your web site is index.html.
If you add any directories and want a page to default for that directory,
name it index.html. For example, if you create a directory called
test under your htdocs directory, then place a file called index.html
in the test directory, that will be the page that comes up when people
enter http://www.yourdomain.com/test/.
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. For an extensive list, go to:
http://www.yahoo.com/Computers_and_Internet/Software/Data_Formats/HTML/
[contents]
2.3.1 HTML Editors and Tools
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. For a list of HTML Editors go to:
http://www.yahoo.com/Computers_and_Internet/Software/Internet/World_Wide_Web/HTML_Editors/
For free graphics, icons, and backgrounds go to:
http://www.yahoo.com/Computers_and_Internet/Graphics/
[contents]
2.4 Using the Common Gateway Interface (CGI)
The Common Gateway Interface (CGI) allows you
to extend your virtual server. CGI allows you to support the situations
when the client wants to send information to the virtual server 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:
http://www.yahoo.com/Computers_and_Internet/Internet/World_Wide_Web/
CGI___Common_Gateway_Interface/
[contents]
2.4.1 Writing Your
Own CGIs
You can also write you own CGI using the following
languages:
- C/C++
- sh (borne shell)
- csh
- perl
Please keep in mind when you write your own
CGIs that your virtual server¹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 com-mand. For example:
Salmon: {4} % virtual mycgi arg1
arg2 arg3
In this example, the program mycgi runs in the
virtual environment and is given the arguments arg1, arg2, and arg3.
The virtual environment is the environment that your cgi¹s would run under
if they were called from the web. If you simply ran your cgi with-out
the virtual command, it would not run the same as if it were being run
from your web pages.
[contents]
2.4.2 Imagemaps
Active images, or clickable 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:
- Create an image that you want to make an active
image. You must use the GIF for-mat for the image.
- Include the image in your HTML document using
the IMG element with the ISMAP attribute. Make this image a link to
the imagemap CGI with the name of your map file on the end (³my_mapfile²
in the example below). For example:
<A HREF=²http://some.site.com/cgi-bin/imagemap/my_mapfile²> <IMG
SRC=²image.gif² ISMAP> </A>
- In your www/conf directory create the
file imagemap.conf with the full path to your map file. For example:
my_mapfile: /usr/local/etc/httpd/htdocs/my_mapfile.map
Note: A small bug in the imagemap program
requires you to have a line return at the end of this file. Therefore,
when you are editing imagemap.conf, be sure to hit the ³enter² key
when you are done with the last line.
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
- Create the map file in your usr/local/etc/httpd/htdocs
(or www/htdocs) directory. Generating a map file is not hard, however,
you will need some kind of graphic edi-tor that gives the X,Y coordinates
of an image. Some editors that work for this are:
Adobe Photoshop A
commercial 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
where method specifies the manner in which
the region is being specified (circle, rect, poly, point, or default),
the URL is the page you want to appear when someone clicks within
the region, and xn,yn are integer coordinates of defining the region
starting with a point measured from the left-hand corner of the image.
You will need to get these points from one of the tools mentioned
above or some other way. The following is an example of what the map
file should look like:
# 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>.
- After the map file(s) are in place your active
image should work; so give it a try.
[contents]
2.4.3 Simple Forms
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:
- Copy formmail.pl from /usr/local/contrib/formmail.pl
to your www/cgi-bin directory and change its permission so it
is executeable.
Note: The /usr/local/contrib directory is not in your
directory structure. it is different from your usr/local directory.
Follow these instructions exactly in a telnet session to copy
the correct files. For more information on the Contrib directory see
"The Contrib Directory" on page 44:
cp /usr/local/contrib/formmail.pl ~/www/cgi-bin/formmail.pl
chmod 755 ~/www/cgi-bin/formmail.pl
- Create a HTML document with the following
in the top part of the BODY section of the document:
<FORM ACTION="/cgi-bin/formmail.pl" METHOD="POST">
<INPUT TYPE=hidden NAME="recipient" value="you@youraddress.com">
<INPUT TYPE=hidden NAME="subject" value="Customer
Feedback">
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.
- After the section above, create the form that
you want your customers to see and close it with </FORM>. For
example:
<PRE>
Name:
<INPUT NAME="Name" SIZE="40" MAXLENGTH="40">
Email:
<INPUT NAME="Email" 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>
- Try out your form.
[contents]
2.4.4 Server Side Includes
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:
- Copy c4.pl and lock.pl from the /usr/local/contrib/
directory to your www/cgi-bin directory and make sure they are
executable. Note: The /usr/local/contrib directory is
not in your directory structure. It is different from your usr/local
directory. Follow these instructions exactly in a telnet session
to copy the correct files. For more information on the Contrib directory
see "The Contrib Directory" on page 44:
Salmon: {4} % cp /usr/local/contrib/c4.pl
~/www/cgi-bin Salmon: {5} % cp /usr/local/contrib/lock.pl ~/www/cgi-bin
Salmon: {6} % chmod 755 ~/www/cgi-bin/c4.pl Salmon: {7} % chmod
755 ~/www/cgi-bin/lock.pl
- Create a file called .htaccess
in the same directory that you have the HTML for the web page you plan
to have the counter on with the following in it:
Options Indexes FollowSymLinks
Includes AddType application/x-httpd-cgi .cgi AddType
text/x-server-parsed-html .html
If you are also using files with the .htm
extension and want to have server side includes on those pages, be sure
to add this line to the above lines of your .htaccess file:
AddType test/x-server-parsed-html
.htm
- Create a file with the same "basename"
as your .html file that you plan to put the counter on, but with
the extension .count, rather than .html. For example,
for index.html, I would create a file by the name of index.count.
Put this file in the same directory as index.html. In this file
put the beginning count in it (i.e. "0"). An easy way to do
this step is as follows:
Salmon: {9} % cat > index.count
0 ^D (the control-D character)
- In your HTML file put something like
the following in the BODY section:
Over <!--#exec cgi="/cgi-bin/c4.pl"
--> Internet Customers Served.
- Reload your web page and see if it works.
[contents]
2.5 Monitoring Your Virtual Web Server Log Files
It is useful to monitor your virtual server's
web usage. This is a good way to get feedback on how your virtual server
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 (Getstats
is written by Kevin Hughes (kevinh@eit.com). See http://www.eit.com/software/get-stats/
getstats.html for more information.) can help you do this. Getstats can
be used either interactively (from the command line) or periodically in
"batch mode" using cron (see "Generating Automated Getstats
Reports" on page 22). For interactive mode just type the getstats command
at the Unix prompt with the appropriate report option(s). For example:
- Salmon: {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:
- getstats -c (concise report):
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.
This basic set of statistics is always
output when getstats runs. Using the -c option will only produce
this statistics paragraph.
- getstats -m (monthly report):
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 :
...
The -m option will produce a monthly
report of server use. The dates in the report are the first day of reported
activity for that month.
- getstats -w (weekly report):
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.
- getstats -ds (daily summary):
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 : #########
...
The -ds option produces a daily
summary, which shows the aggregate number of requests for a particular
day of the week.
- getstats -d (daily report):
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 : #######
...
The -d option produces a daily
report, which shows the number of requests per day and the date.
- getstats -hs (hourly summary):
HTTP Server Hourly Summary
Covers: 12/28/93 to 01/27/94 (32 days).
All dates are in local time.The Virtual Web Service
20 The Virtual Server System
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.
- getstats -h (hourly report):
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.
- getstats -f (full report):
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
...
The -f option tells getstats to
create a full report sorted by host name (and IP address). Use the -fa
option to make a full report sorted by the number of accesses, the -fd
option to create a full report sorted by the last access date, or the
-fb option to create a full report sorted by the number of bytes
transferred.
- getstats -r (request report):
HTTP Server Request Statistics
Sorted by number of requests, 1560 unique requests.
Covers: 12/28/93 to 01/27/94 (32 days).Monitoring Your Virtual Web
Server Log Files
The Virtual Server System 21
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
...
The -r option tells getstats to
create a report of requests sorted by the request name. Use the -ra
option to sort by accesses, -rd to sort by the last access time,
-rb to sort by the number of bytes transferred, and -rf
to sort by individual file sizes.
- getstats -dn (domain report):
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
...
The -dn option generates a domain
report, sorted by domain name. Use -da to sort by the number
of requests, -dd to sort by last access date, -db to sort
by the number of bytes transferred, or -du to sort by the number
of unique domains. The unique domain number is the total number of unique
sites under a domain. In the example above, for instance, a total of
3 unique sites came from the .au domain.
- getstats -dt (directory tree report):
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 getstats -dr "/www/htdocs/"
-dt.
For a report of specific directories, try the getstats -sr "/<dirname>/*"
-d report. In this report -sr stands for search string, <dirname>
would be replaced with your directory structure under your www/htdocs
directory, " *" is a wildcard for all files within that directory
structure, and -d is the daily report option.
- getstats -e (file) (error report):
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
-e generates a report of all malformed
(or ignored) requests for all dates in the order they were encountered
in the log file. If a filename is given as the argument to the option,
bad requests will be appended to an error file, where they can be analyzed
later.
- getstats -a (all reports): The -a
option will produce all of the above reports, with list reports sorted
by the number of accesses, if possible. If you want a report sorted
another way, however, specify the correct option after the -a
flag.
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.
[contents]
2.6 Generating Automated Getstats Reports
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"
on page 43)
- Store this three line file in your home
directory in a file called cronfile for example. Make sure it
is only three lines. If the lines are long, let them wrap, but do
not add a hard return:
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
- Run crontab to install the cronfile by typing
crontab cronfile at a telnet prompt.
- The first line will send a full daily report
to stats@yourdomain.com each day at 23:58 (11:58 pm). Of course you
must change this Email address to yours.Using WWW Stat as an Alternative
to Getstats The second line will send a full weekly report at the end
of each week at 23:59 (11:59 pm). The third line will send a full monthly
report and "nuke" (-n) the log file at 00:01 (12:01 am) on
the first day of each month. The "-f" specifies a full report.
If you do not want a full report, you can change the report settings
to your liking.
For more information on cron type man crontab
and man 5 crontab at the virtual server's UNIX prompt.
[contents]
2.7 Using WWW Stat as an Alternative to Getstats
If you do not like the getstats program, feel
free to load wwwstat.pl from the Contrib directory (see "The Contrib
Directory" on page 44). 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.
[contents]
2.8 Resetting Your Virtual Web Server Log Files
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" on page 43).
[contents]
CHAPTER 3 The Virtual FTP Service
3.1 Introduction to FTP
Connecting to a remote computer using FTP
(or File Transfer Protocol) is similar to using TELNET or rlogin, except
that you do not have all the tools of a shell, and your access to files
is limited. You use FTP to transfer files. The files can be of any type.
For example, they may be text files or binaries in any format -- it does
not need to be HTML or in some graphic format, for example. Also, you can
transfer files between different types of computers. You might, for example,
transfer files between an UNIX server 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 or use automated messages (see "Log In Banners
and Directory Messages" on page 27) to give the user some clue as to
what is in the directory. FTP archives, however, are easier to set up than
WWW sources, since you do not need to translate your documents into HTML.
[contents]
3.2 Anonymous FTP vs. FTP
The virtual system supports Anonymous FTP
or FTP that anyone can access without a password, and Non-Anonymous FTP,
that requires a username and password to gain access. With anonymous FTP
you just enter anonymous or ftp for the username and usually your Email
address as the password.
[contents]
3.3 The Name of the Virtual FTP Service
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:
ftp.domain.type
Where domain represents the domain name of your FTP server (often
your company's name) and type represents the type of organization
or the top-level domain name (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 us, 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, the virtual server system will use these
names by default for the respective services.
[contents]
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, by default, contains one
sub-directory: pub. pub traditionally contains the archive files
available to anonymous FTP customers. This is the directory where you should
put the files you want to make available to your customers. You can make
other directories as needed.
[contents]
3.5 Making an "incoming" Directory for
Customers
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 permissions.
With write-only permission, it 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 by-product of allowing users to read others' uploaded files
(having the read permission set) is that they can upload completely unrelated
files on your virtual server. These uploaded files can be bland or blasphemous.
For the sake of your company's image, you would not want to inadvertently
support a porn or WaReZ (pirated software) archive on the Internet.
To make an incoming directory do the following:
- 1. Inside your ftp/pub directory create
a directory with a name like "incoming" (mkdir ftp/pub/incoming).
- 2. Create a file named .incoming (don't
forget the ".") in the ftp/pub/incoming directory (touch
ftp/pub/incoming/.incoming). The ".incoming" file
flags the directory as a write-only directory. Files is this directory
can not be read or listed.
[contents]
3.6 Log In Banners and Directory Messages
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:
salmon: {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:
salmon: {10} % mkdir ~ftp/pub/demo
salmon: {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)
[contents]
3.7 Creating Non-Anonymous FTP Accounts
If your virtual server 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 virtual servers 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 mentioned in Section 5.2 on page 36. 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 as described in Section 7.2 on page 51). For example:
salmon: {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
Do you want this user to have FTP access to your virtual server (assuming
that you have the FTP service with your account)? Please answer yes or
no. If you are planning to add the FTP service to your account later and
want this user to have FTP access you can answer "yes" now.
FTP, yes or no: yes
You have three choices on where to put this user's "home directory":
(1) /usr/home/biff
(2) /usr/local/etc/httpd/htdocs/biff
(3) /ftp/pub/biff
Pick 2 if you want this user to be able
to upload his or her own web pages. (The URL would be something like http://www.yourcompany.com/biff)
Pick 3 if you want this user to be able to upload files to your anonymous
FTP archive (ftp://ftp.yourcompany. com/biff).
Otherwise, pick 1.
Home directory option, 1, 2, or 3: 2
Enter the FTP upload quota on this account in megabytes (0 for no quota):
10
FTP/Email User added successfully.
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 virtual server'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.
[contents]
3.8 Monitoring Anonymous FTP Activity
The messages file located in your usr/logs
directory contains valuable information describing how much your virtual
anonymous FTP server has been used. This informa-tion, 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:
- Create a file named cfile with the following
information:
# 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
- Run crontab to install the cron file
(cfile) you just created:
salmon: {1} % crontab cfile
For more information on cron, type man
crontab and man 5 crontab at the virtual server's UNIX prompt.
FIGURE 3 Example Output from xferstats
TOTALS FOR SUMMARY PERIOD Aug 16 TO Aug 17
Files Transmitted During Summary Period 3
Bytes 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
[contents]
CHAPTER 4 The Virtual Email Service
4.1 Introduction to Email
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 and is strictly
prohibited. Doing so will 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.
[contents]
4.2 A Tour of the Virtual Email Handling System
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:
- etc/aliases This file contains aliases
for mail addresses. The next section will discuss how this file is used.
- etc/aliases.db This is a binary version
of the file above and is created by running the vnewaliases command.
- etc/sendmail.cf This is the master
configuration file for sendmail. Unless you are a sendmail guru you
may want to stay away from this file since it is fairly cryptic.
- usr/mail This directory is the home
for Email users' mailboxes. POP also uses this directory for temporary
files.
- usr/spool/mqueue This directory is
used by sendmail to temporary queue messages going out. Most of the
time it should be empty.
[contents]
4.3 Creating Email Aliases
Email aliases allow you to forward electronic
mail sent to a mail user name on your virtual server another electronic
mail address. For example, you could make all the mail sent to webmaster@yourdomain.com
sent to you@xyz.com. To do this do the following:
- Edit the etc/aliases file and add the following
at the end:
webmaster: you@xyz.com
You can use one of the many editors available on the server including
pico, vi, or emacs.
- Run the program vnewaliases to update
the etc/aliases.db file by typing vnewaliases at a telnet
command prompt:
Salmon: {4}% vnewaliases
- You may also FTP the aliases file to your
local machine to edit if you wish. Once you edit the file, FTP it back
to your server in the etc directory and type vnewaliases at a
telnet command prompt. Be aware that you must FTP this file in ASCII
format and not Binary format because it is a text file.
You do not need to create a mail account as
described in section 5.2 on page 36 in order to have an Email alias. After
an alias is created the mail is not stored on the virtual server and is
simply forwarded.
[contents]
4.4 Creating Email Lists
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.orgCreating Email Autoresponders
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:
- Add the following to the bottom of the etc/aliases
file add the following:
myfriends: :include:/etc/mylist
- Create the file etc/mylist with each Email
address on a separate line. For example: joe@xyz.com
fred@foobar.edu
mary@abc.org
.
- You will need to change the permissions of
the list file, and the entire etc directory.
- While in your home directory in a telnet session
type:
chmod 755 etc/mylist
chmod 755 etc
- 4. Run vnewaliases to update your etc/aliases.db
file.
[contents]
4.5 Creating Email Autoresponders
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 virtual
server system quite easily. Simply follow these steps in a telnet session:
- 1. Copy the "autoreply" program
from "/usr/local/contrib" to your "usr/bin"
directory.
You must type the following lines in a telnet session:
cp /usr/local/contrib/autoreply ~/usr/bin/autoreply
- 2. Make sure it is executable:
chmod 755 ~/usr/bin/autoreply
- 3. Create an autoreply message (the message
sent back to the customer) in your home directory:
pico ~/.autoreply (pico is an easy to use editor)
- 4. Add something like the following to your
etc/aliases file:
info: name@yourcompany.com, "|/usr/bin/autoreply -f info-reply
-a info"
- 5. Run vnewaliases to update your etc/aliases.db
file by typing vnewaliases.
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.
[contents]
4.6 Error Messages
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 virtual server.
This file can grow to quite a large size over time. It is recommended that
you delete this file when this happens to free up your disk space. You can
reset this log file and all your web access log files by issuing the vnukelog
command (see "The vnukelog Command" on page 43.) To run this,
type vnukelog at a telnet command prompt.
[contents]
CHAPTER 5 The Virtual POP Service
5.1 Introduction to POP
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 compatible
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 virtual server a
company does not need to purchase an expensive commercial gateway or pay
for the excessive dedicated Internet connection. Commercial SMTP (the Internet
Email protocol) gateways for Novell or Microvolts 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 5.6 on page 38.
[contents]
5.2 Creating POP Accounts for Email Users
To create POP accounts for Email users, log
into the server using the virtual administrator login name and password
and use the vadduser command. This will also add a non-anonymous FTP account
for your user if you wish (see "Creating Non-Anonymous FTP Accounts"
on page 28). For example:
salmon: {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
Do you want this user to have FTP access to your virtual server (assuming
that you have the FTP service with your account)? Please answer yes or
no. if you are planning to add the FTP service to your account later and
want this user to have FTP access you can answer "yes" now.
FTP, yes or no: yes
You have three choices on where to put this user's "home directory":
(1) /usr/home/biff
(2) /usr/local/etc/httpd/htdocs/biff
(3) /ftp/pub/biff
Pick 2 if you want this user to be able
to upload his or her own web pages. (The URL would be something like http://www.yourcompany.com/biff)
Pick 3 if you want thisChanging a Mailbox Password The Virtual Server
System 37 user to be able to upload files to your anonymous FTP archive
(ftp://ftp.yourcompany. com/biff).
Otherwise, pick 1.
Home directory option, 1, 2, or 3: 2
Email User added successfully.
After entering the Email user's name, the
password, and the full name for the account, and the FTP option, it will
be added. This will setup the electronic mailbox for the user and the FTP
account if selected.
[contents]
5.3 Changing a Mailbox Password
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:
salmon: {3} % vpasswd biff
New password: <Biff's new password>
Retype new password: <Biff's new password again>
In this example, the Email user biff's password
is changed.
[contents]
5.4 Removing a POP Email Account
To remove an unwanted Email user account use
the vrmuser command. For example:
salmon: {4} % vrmuser
Please enter the Email User Name to be *removed*.
Email User Name: biff
Are you sure you want to remove "biff"'s account (y/n)? y
Password entry removed...
Mail file removed...
POP file removed...
Email User account removed successfully.
In this example, biff's POP Email account
and FTP account are removed. However, if you added an FTP account for the
user, the directory will not be deleted. You will need to do this manually.
[contents]
5.5 Listing POP Email Account Users
To view a list of your current Email/FTP account
users use the vlistuser command. At a telnet command prompt type:
Salmon: {1} % vlistuser
[contents]
5.6 Configuring the POP Client Software
In general, the POP client needs to be configured
to get its mail from the virtual server and to use the virtual server as
a SMTP relay host. This section shows how to configure Eudora, one
of the most popular POP client software packages for the PC. Please note
that Eudora is also available for the Macintosh and is similarly configured.
[contents]
5.6.1 Configuring Eudora
Qualcomm's 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 3 on page 39. To configure Eudora
to use the virtual server petstore.com for the Email user Biff
I would do the following:
- Start up Eudora by double clicking on the
Eudora icon.
- Select Options in the Tools
pull-down menu (see Figure 3 on page 39).
- In the Options dialog box, click
on the Personal Information icon to change the following values
(see Figure 4 on page 39):
POP Account: biff@pop.petstore.com
Real Name: Bifford McLean
Return Address: biff@petstore.com
- In the Options dialog box, click the
Hosts icon to change the following value: SMTP Server:
smtp.petstore.com
- Configure the other parameters to the user's
preference and click on the OK button.
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 ("Creating POP Accounts for Email Users" on page
36).
[contents]
5.6.2 Configuring Microsoft's Internet Exchange®
and Netscape's Mail®
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.
FIGURE 3 Eudora for Windows
FIGURE 4 Eudora's Options Dialog BoxIntroduction
to POP
[contents]
CHAPTER 6 Helpful Commands and Useful Information
6.1 Overview
The virtual server 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 virtual server.
[contents]
6.2 The quota Command
The quota command is used to help you identify
how much disk space you have on your virtual server, and of that space,
how much you have already used. At a telnet command prompt, simply type
quota.
Salmon: {1} % quota
The command will output your blocks, limit, files, and file limit.
- To see what your quota is, look at the limit
column. A block is 1024 bytes. If for example, your limit says 51200,
you would divide that number by 1024 to get your disk space in Megabytes.
In this example, your total space would be 50 Meg.
- To see how much space you have used, look
at the blocks column. Divide this number by 1024 to see how much
space you have used. If for example, your blocks say 37851, you would
be using roughly 37 Meg of your space.
- The files and file limit columns that
display tell you the total number of files you can have on your system.
[contents]
6.3 The vdiskuse Command
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:
Salmon {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.
Salmon {2} % vdiskuse | more
You can also have this report Emailed t |