 |
 |
 |
Linux / Unix Technical Support |
THE BASICS
General Account Information
We offer storage space for web pages with global public access to those pages over the Internet. We also offer a limited form of program execution known as "cgi-bin." Our computers are Dual Pentium III 866Mhz+ servers with 1000MB+ of RAM running Apache 1.3.19 over a custom version of Red Hat Linux. Apache responds to web page fetch requests from remote browsers while Linux is one of several variants of the Unix operating system. Our servers are connected to the Internet backbone over multiple, fully redundant DS3 lines each having a capacity of 45 Mbps (Million bits per second), and multiple, redundant OC3 lines each having a capacity of 155 Mbps (Million bits per second).
Every customer gets his own password protected userid under Linux. By logging in with his userid, the customer gains access to his web storage space. Every userid "owns" a structure of disk subdirectories in the Linux file system. The "root" of this structure is the "home" directory, found at path "/home/userid." Note that this is somewhat similar to the MS-DOS directory structure, except that there is no drive letter and forward slashes are used instead of backward lashes. The path referred to above, however is in relation to our own servers. When you FTP to your account using your domain name and userid, you don't need to put in "home/userid." You will automatically be taken there. Also note that your path might be "/home2/userid" depending on which of our servers your domain resides on.
Inside the home directory are many files and other directories. The most important one is named "www". Every customer has his own separate "www" subdirectory. Files placed in the "www" directory are visible to remote browsers over the Internet, so this is where you want to place all your html documents, graphics, sounds, files, etc. which you want people to be able to access from the world wide web. For example, when a browser asks for URL http://yourdomain.com/page.html, Apache looks for the file: /home/yourdomain.com/www/page.html and sends it out.
The Index Page
The filename of your home page should be index.htm or index.html. The webserver will automatically send the file at path /home/yourdomain.com/www/index.htm when a browser specifies http://www.yourdomain.com. When your account is set up, there will be an index.htm page already installed. This just tells anyone accessing your domain that your site is under construction and will be available soon. You will replace this file in the www directory with one of your own creation. If you wish to use any of the cgi features we provide that use Server Side Includes (SSI), you must name your page with the .sht or .shtml extension. You can put an index.htm file in any subdirectory that you wish, and it will be the default page served when you don't want your visitors to have to type a full page URL reference, for example, http://www.yourdomain.com/whatever instead of http://www.yourdomain.com/whatever/page.htm, or http://www.yourdomain.com/whatever.htm.
Accessing Your Email
Email Client Settings
- Incoming Mail (POP3) Server: domain.com (Port 110)
- Outgoing (SMTP) Server: domain.com (Port 25)
- Account Name/Login Name: your Username (your address without the "@domain.com")
- Email address: your Mail address (i.e. user@domain.com)
- Set Up
Outlook 97 and 98:
- Open the Tools menu, and click on the "Services" tab.
- Select your Mail account.
- Click "Properties."
- Click the "Servers" tab, and ensure "Log on using Secure Password
- Authentication" is not selected.
- Click the "Advanced" tab, and ensure that you have not selected "This Server Requires a Secure Connection (SSL)" under the Incoming (POP3) or Outgoing (SMTP) Port settings.
Outlook Express:
- Click "Tools," and select "Accounts."
- Click the "Mail" tab, then highlight the account and choose "Properties."
- On the Servers tab, ensure that you have not checked "Log on Using Secure Password Authentication" in the Incoming Mail Server section and have not checked "My Server Requires Authentication" in the Outgoing Mail Server area.
- Check that "POP3" is listed in the Incoming Mail Server field.
- On the Advanced tab, ensure that you have not selected "This Server Requires a Secure Connection (SSL)" under the Incoming (POP3) or Outgoing (SMTP) Port settings.
Eudora Pro (version 4):
- Click on the "Tools" menu, and select "Personalities."
- Right-click on the Mail account, and select "Modify."
- Click on "Incoming Mail." Ensure that "POP3" is selected under the Configuration heading and that "Passwords" is selected under Authentication Style.
Netscape Communicator 4.05:
- Open the "Edit" menu, and select "Preferences."
- In the Category field, click the "+" next to "Mail & Groups," and then click "Mail Server."
- Ensure "POP3" is selected under the Server Type heading.
Netscape Communicator 4.5:
- Open the "Edit" menu, and select "Preferences."
- In the Category field, click the "+" next to "Mail & Newsgroups," and then click "Mail Servers."
- Select your Mail account and ensure "Never" is selected under the Use Secure Socket Layer heading.
- Click "Edit" and ensure "POP3" is listed beside Server Type.
Wusage and Raw Access Logs
To count accesses, there is a directory called wusage in your www directory. To access it, just log on the Internet and with your web browser, go to: http://www.yourdomain.com/wusage
You will see a webpage with statistics for your domain for the previous week. If you are a brand new domain, you won't see any statistics there yet. If you go to the link from that page leading to Weekly Reports, you will see a much more detailed report, including pie charts, graphs, etc. These reports are automatically generated for you once each week, and are stored in one place so you can compare weekly statistics easily.
If you would like to see domain names in your stats rather than just IP numbers, put an empy file in your wusage directory called dns (no extensions). This will act as a switch and reverse authentication will be activated for the domain.
In your home directory, you will see a file called access-log. You can download this file and open it in any word processor to see exactly what files were accessed, what domain the visitor came from, the dates and times of each visit, etc.
Telnet Access
A telnet account is just another name for Unix/Linux userid. When you sign up with us, you get a userid and password. You may ask for more than one such userid. See the Fee Schedule for pricing. Each telnet account for your domain has its own separate home directory, but shares the same www and FTP directories.
You need a telnet program to access your telnet account. Simply put in yourdomain.com as the host, and connect to the server. When you are connected, you will be prompted for your userid and password.
Some of the programs available at the shell prompt are:
- mail - a primitive email program
- pine - a more powerful email program
- ftp - to FTP onto other sites
- telnet - to telnet to other sites
- pico - an easy to use text editor
- vi - a not so easy to use (but standard) text editor
- lynx - a text-based world wide web browser.
In general, it's a pretty complete POSIX environment. You access these programs by typing in their names and then following commands relevant to each program. If you need help with any of the programs, at the shell prompt, type man and the name of the program to get instructions for that program online. If your problem is not knowing the name of the program, try apropos subject(i.e. apropos mail). It is important to remember that Unix is case-sensitive, and that "Index.htm" is not the same as "index.htm."
Note:
If you experience problems with your telnet program when accessing the above programs you will need to make a entry in your login directories .bash_profile file. Just add the following to the last line export TERM=vt100. This will allow you to access all shell programs properly.
FTP Access
Now that we know where the files have to be located in order to be visible from the Internet, just how do we put the files there? There are several ways, depending on your computer system. For the Macintosh, a program called "Fetch" is used. Microsoft Windows systems use "WS_FTP." Look further in this manual for detailed instructions on each of these programs.
Changing Your Password
To change your password, Telnet to your account. After logging in with your username and password, at the Unix prompt, type:passwd
A script will ask you to type in your old password, then the password you want it changed to will be asked for twice to verify. This will not work for POP-only accounts. There is no way you can change the password for those accounts - they must be changed by sending us email and we will take care of it.
9+ Character Names
A name of anywhere from 3-16 letters is legal for email accounts, FTP accounts, and telnet accounts and may include upper and lower-case letters, numbers and hyphens. There is no limitation for file names on the server but spaces are not normally used on Unix systems and may cause problems.
Checking Server Space Usage
You can find out how much space is in use by the www files for your domain by using Telnet to log into your account and then from the Unix prompt, typing the following:
du -s /www/htdocs/yourdomain
This will give you a report back of the number of kilobytes (k) all files in your www directory add up to.
If you have an anonymous FTP area, also check:
du -s ~ftp/yourdomain.com
To check how much space is being used by files in your home directory, type:
du -s $HOME
Adding up the results from all three of these commands will give you the total amount of space you are using, but a simpler way of checking all three directories is to type:
du * www/* anonftp/* -c
You will then see a space report for each directory (-a to see for each file) and at the end, a total.
Zip/Unzip Files
This Unix program is compatible with the zip program for DOS and Windows. To zip files, first have the files uploaded to your server, then log into your account with Telnet. Navigate to the directory where the files are that you want to zip (for instance by typing cd www then cd sounds). Then type: zip myzip file1 file2 file3
This puts the files "file1", "file2", and "file3" into a new zip archive called "myzip.zip". On the other hand, if you had the archive "myzip.zip" and wanted to get back the files, you would type: unzip myzip
Typing zip or unzip by itself will give you a usage summary, showing nearly all the options available.
WUSAGE STATUS
What is Wusage?
Wusage is a statistics system that helps you determine the true impact of your web server. By measuring the popularity of your documents, as well as identifying the sites that access your server most often, Wusage provides valuable marketing information. By determining the paths your users follow and analyzing the sites from which they come, Wusage helps you find out which outside sites are most important to you. Practically all organizations, whether commercial, educational or nonprofit, need solid numbers to make credible claims about the World Wide Web. Wusage fills that need. Features of Wusage: Search Keywords Much of your traffic is driven by Internet "search servers" like Altavista and Lycos. What are you customers looking for? Wusage 7.0 can tell you exactly what search keywords they are using, and which servers drove that traffic to you. Referring Sites No need to wonder where your hits are coming from. Wusage 7.0 shows you exactly which sites are directing traffic to yours! Wusage 7.0 also allows you to "drill down" from an individual document to discover which pages on the World Wide Web link to that document. Visits and Trails Wusage 7.0 can measure "visits" to your site, in addition to simple page counts. You have control over the definition of a visit. Visit counts "smooth out" fluctuations caused by the different software programs used by different users, resulting in a more accurate count of true user sessions. Wusage can also track the most commonly followed "trails" through your site, revealing what your customers are really after and the path they follow to get there. Trails can even begin with pages on other sites! Advanced features allow you to discover how many users came from a particular site and ended up at a particular page. Other features:
- Wusage's incremental database allows you to retire your log files as soon as they are analyzed. Save time and disk space!
- Wusage can analyze log files from many "mirror site" web servers at the same time.
- Proxy server logs can be analyzed. Find out where your users are headed!
- Wusage 7.0 can send reports by email, as well as generating easily printed, attractive HTML reports with full color charts and graphs.
- When supported by your web server, Wusage's support for "cookies" allows better visit analysis.
- "Drill down" into subdirectories to get the details.
- Authenticated user analysis.
- Supports user agent analysis. Find out what web browser your customers are using!
- Wusage 7.0 can analyze compressed files.
- Log files can be analyzed directly by FTP. Downloading log files in advance is not required.
- Allows you to produce reports with header and footer text suited to your organization.
- Highly customizable HTML reports allow easy translation to another language. The report macro language of Wusage 7.0 provides dramatically enhanced control over presentation.
- Reveals which file types, such as GIF, JPEG, HTML and PDF, are being downloaded most often.
- Provides information about the operating systems preferred by your users. Find out what percentage are using Macintosh, Windows 98, and other operating systems.
How do I view my Visitor Stats?
"Wusage 7.0" Your Access and Stat Logs One of the directories you will find preinstalled within your www directory is named "wusage". This directory contains the access and stat files for your website. To access your personal wusage directory log onto the Internet with your web browser and go to: http://www.yourdomain.com/wusage. The web page displayed will contain all the statistics for your domain for the previous week. The page will also contain a Weekly Reports link which, when accessed, will provide much more detailed statistics including pie charts and graphs. These reports are automatically updated for you daily and are always stored in the same place for easy comparison.
What does accesses refer to in Wusage reports?
An "access" is a single, successful request made by a web browser. Every successful request for any resource on the web server, whether for an image or a document or for another type of information, is regarded as an access.
What do the terms in Wusage refer to?
Below is a list of key references in wusage and their meaning.
- agents: An "agent," or user agent, is a web browser or other program used to access your web server. Most user agents are web browsers such as Microsoft Internet Explorer and Netscape Navigator, but a significant number are automated Internet-indexing programs, such as Altavista.
- bytes: A "byte" is a single character of information. In the reports generated by Wusage, the "bytes transferred" figure refers to the number of characters of information that were sent to the browser. This is helpful in determining how much of the web server's connection to the Internet (how much bandwidth) is currently in use. It is especially useful to site administrators who pay for bandwidth by the megabyte or gigabyte on a regular basis.
- trail: A "trail" is a unique path among the documents on the web server, followed by one or more visitors to the web server. Every visit to the web server follows a trail. Commonly followed trails represent useful information about the preferred routes that your visitors follow.
- visit: A "visit" consists of one or more accesses made by the same visitor, with no more than a certain time interval between accesses.
Where can I find more information about Wusage 7.0?
Goto the online manual at Boutell.com. Keep in mind because we run Wusage in a shared hosting environment, and you should only be looking at the information pertaining to the Wusage config file for generating reports.
What are Referrer Logs?
Referrer logs are extra entries in your access-log file telling you what site your visitor came from. By default referrer logs are not included with most accounts but may be added for a small extra monthly fee. When you add referrer logs we also activate the agent logs for your domain which keeps track of the type of browsers being used to access your web site.
How do I view Referrer Logs?
Referrer Logs become part of your main access log if you have added them as an option. When using Wusage they will show up as [referrer] next to each file name listed on the report and are hyper-linked to provide the information.
FTP
FTP Maintenance (Uploading Your Files to the Server)
The process by which files are transferred to the web server is called "FTP" (File Transfer Protocol). You have unlimited access via FTP 24 hours a day. As such, you can create and maintain your web pages on your own computer and upload files to your web site at your leisure.
Online services which offer an Internet gateway, such as AOL, CompuServe, and Prodigy may have a built-in FTP interface. If you have a PPP Internet account, you need an FTP program.
If you are using FrontPage, you must create your new web on the "localhost" system. This is accomplished by selecting "create new web," and then entering "localhost" in the line where it asks for the web location. Once you have completed your web on your computer, you can then select the "publish web" option from the file menu in FrontPage Explorer. You will be prompted for your IP address and web name and then it will send it to our servers. Please note that you will be prompted for a user ID and password, and depending on your system configuration it may be the one that we issued you or it may be the one that you entered when you first installed FrontPage. If one does not work, then simply try the other. If you have forgotten what that password was, then you will need to reinstall FrontPage and select a new one.
NOTE: If you are using FrontPage, you should NEVER use regular FTP to upload your files. This will damage the extensions. Stick with one or the other all the time.
For instructions for the most popular FTP client software for both PC and Macintosh users, see the instructions to follow.
For PC Users (WS_FTP)
The following information is contained within your account activation notice and is needed to connect you to your website via FTP:
USERID
PASSWORD
FTP HOSTNAME
Each time you run WS_FTP the Session Profile window will be displayed. A profile contains the information needed to connect to your website. Creating a profile now will eliminate the need for you to configure the software each time you wish to connect to the web server via FTP. To create a profile, click the "New" button and enter a generic profile name at the top of the Session Profile window, such as "My Website." Next, enter your Host Name/Address (yourdomain.com), User ID (yourdomain), and Password for your website.
Next you need to click "OK" to continue. This will connect you to the webserver, where you will connect directly to the root ("home") directory of your account. WS_FTP will display a split screen where files on the left-hand side are within your own computer. You will see several folders on the right-hand side such as www, and infobots which are landmarks suggesting a successful connection to your website
You need to double click on www to get to your web directory. This is where all your files will be downloaded, and/or you will create subdirectories. The only system directory that you may need to use is cgi-bin; this directory is reserved for custom scripts. To make your home page load automatically, name the HTML document "index.htm" in lowercase and upload it to the www directory of your account. To upload a file or files, simply highlight the file(s) on the left and click the right arrow button (->) in the center of the window. Be sure to upload HTML documents and scripts in ASCII mode and images in Binary mode. To transfer a file to a subdirectory, double-click the appropriate subdirectory to open it before transferring the desired file(s). To create a new directory, click on the MkDir button when you are inside the www directory or subdirectory.
As soon as a file is uploaded to the web server, it is available for all to see. If, after uploading a file, you are still unable to see the updated file via Netscape, try hitting the "Refresh" or "Reload" button. If that fails, you need to clear both disk and browser cache. This function can be found by selecting Options>Network Preferences in Netscape. Remember that you must first be connected to the Internet through your local Internet service provider in order to connect to the web server.
For PC Users (Cute FTP)
This is a brief tutorial showing you how to set up Cute FTP in order to connect to our server.
- Start the application by double clicking on the program icon. After the program starts, you will be in the Site Manager window. This is where you set up all of your FTP connections.
- Create a new connection site by clicking on the Add Site button.
- The Host Address :
- Basic Web site customers : Use our domain name as the Host Address as shown.
- Domain Web site customers : Use your IP Address or your domain name as the Host Address.
Note : This will only work when your domain name has been finalized with Network Solutions. In the meantime, you must enter your IP number in the Host Address area.
- Once you are connected, click on the "www" directory. This is where all of your files are to be placed. You will now see a list of the files in your current directory.
- To transfer files to your account, select "Upload" from the "Commands" menu, and choose which files or folders you wish to upload.
- To download files from your account to your home computer, choose the file you wish to download, and select "Download File" from the "Commands" menu.
- These are the basics to using Cute FTP. If you need more information, please use the "Help" menu in the application or read any documentation that came with the program.
For Mac Users (Fetch)
The following information is contained within your account activation notice and is needed to connect to your web site via FTP:
USERID
PASSWORD
FTP HOSTNAME
The hostname tells your FTP software to connect to the web server upon which your web site resides. Each time you run Fetch, the New Connection... window will be displayed. A profile contains the information needed to connect to your web site. Creating a profile now will eliminate the need for you to configure the software each time you wish to connect to the web server via FTP. To create a new profile, select "New Connection..." from the File menu. Next, enter the Host (yourdomain.com), User ID (yourdomain), and password for your web site.
Don't worry about the Directory option right now. When you have your Host, User ID, and Password entered, click on the OK button. The next window which will pop up will look virtually the same, except that yourdomain will be in the popup window.
Bookmarking the Connection
You should take the time, now that you have established your connection, to make it easier for you to get here next time. Under the Customize menu, select New Shortcut. A window will pop up called Bookmark Editor. It will already have your name, Host, and User ID filled in. Under Type, choose File from the popup menu. If you would like Fetch to remember your password so you won't have to type it in each time, type in your password in the Password field. Now, under the same Customize menu, choose Preferences, and under the General tab, make sure the connection you just entered is selected as the default shortcut. Next time you open up Fetch, your shortcut will be opened automatically and all you'll have to do is click the OK button!
How to Transfer Files
You need to double-click on www to get to your web directory. This is where all your files will be downloaded, and/or you will create subdirectories. The only system directory that you may need to use is cgi-bin; this directory is reserved for custom scripts. To make your home page load automatically, name the HTML document "index.htm" in lowercase and upload it to the www directory of your account. To upload a file or files, simply drag them from your hard drive onto the Fetch window when you are in the appropriate directory or subdirectory. Be sure to upload HTML documents and scripts in Text mode and images in BINARY mode. Or to make life easier, click on the Automatic button, and Fetch will decide the proper format. To transfer a file to a subdirectory, double-click the appropriate subdirectory to open it before transferring the desired file(s).
As soon as a file is uploaded to the web server, it is available for all to see. If, after uploading a file, you are still unable to see the updated file via Netscape, you need to hit the Reload button in the Netscape button bar. Remember that you must first be connected to the Internet through your local Internet service provider in order to connect to the web server.
Anonymous FTP Setup
Your anonymous FTP site is completely different from your website. When people FTP to your domain anonymously, they will see the following directories:
bin dev etc incoming lib pub
"Pub" is where you should put all your anonymously accessible files. "Incoming" is for the anonymous users to upload files. You are responsible for any "pirated" software uploaded by the anonymous users. The anonymous FTP sites will be eriodically monitored for any abuses. You may ignore the other directories (bin, dev, etc, and lib).
You may tell your visitors that they can visit your anonymous FTP site by typing "yourdomain.com" as the hostname, "anonymous" as their username, and their complete email address as the password.
To access the anonymous FTP site via the web, use the following address: ftp://yourdomain.com/pub/
Your HTML to download a file called mirc511s.exe from a webpage would look like this: <A HREF="ftp://yourdomain.com/pub/mirc511s.exe">Download Mirc Now</A>
You should tell your visitors that they may need to right-click on the link if they are PC users, or if they use a Macintosh, they need to hold down the mouse button on the link, then select the appropriate option from the Pop-up menu.
ADVANCED FEATURES
Setting up Your Own "404:File Not Found" Error Page
A file already exists in the www directory of your server. It's called missing.html. You can edit it to your liking, or create your own. As long as it's called missing.html and it's in your root www directory, the server will display it whenever someone tries to access a page on your domain that does not exist.
Password Protected Web Directory
Use monstercontrols to password protect directories.
Simply go to http://yourdomain.com/cgi-bin/monstercontrols to add usernames and passwords to ANY directory you want. That user and all users you've added will be defined in a .htpasswd file in your secure directory by default, and will have access to that directory of your site, which is accessible from a web browser by typing the URL as: http://www.yourdomain.com/directoryname/
To remove a user from your password file (i.e., to remove the access of that person to your protected directories), use monstercontrols, or simply edit the .htpasswd file located in the secure directory. In this file, you'll see usernames followed by a colon (:) and a password string. The string is the password you entered in your control panel encoded in a way to protect the access rights. To remove the privileges of a user, erase the line containing his/her username. Be sure to keep the file in plain ASCII, and not to change ANYTHING else.
E-MAIL
Web Mail
The sophisticated mailing system called MonsterMail(tm) is included as part of your service. In addition to being able to have nearly unlimited infobots by simply adding text files to a directory, you can also redirect mail for everyone in your domain by simply modifying a plain text file.
Email Redirects
There is a file in your home (root) directory called .redirect. This file can be edited and reuploaded. Just make sure that each of your redirects is on its own line, with a space between the name and where you want it directed to. Don't add empty lines between entries, and make sure the file is saved in text (ASCII) format, and uploaded in text (not binary) format. When you download it to your hard drive, you will see that it already has a one-line entry that looks like this:
default yourdomain@yourdomain.com
This line must be left as is, otherwise your POP email accounts could get messed up. But suppose you want all email for your domain to go to your already existing POP account somewhere else. You would then change your .redirect file to look like this:
default yourdomain@yourdomain.com yourdomain existingaddress@somewhereelse.com
If you want to redirect other names in your domain to other people, you could make the file look like this, as an example:
default yourdomain@yourdomain.com fred 73452.452@compuserve.com info goddess@afterlife.com
This would redirect mail for fred@yourdomain.com to 73452.452@compuserve.com, info@yourdomain.com to goddess@afterlife.com, and all other email in your domain would go to yourdomain@yourdomain.com. The benefit of PlusMail redirects is that you don't need a separate POP account for each email address you want to use in your domain. You can put in your webpages, "Send email to help@yourdomain.com" without the need to create a separate entry in the .redirect file because ALL email goes by default to yourdomain@yourdomain.com, unless "help" is specified to go somewhere else!
Multiple redirection is possible. For instance if you want email to go to two addresses at the same time, enter the different emails with no space and a comma to separate them. You can have upto 4 email address to cc:...they must be listed on the same line though. For example:
help beavis@aol.com,butthead@prodigy.net
Email redirects can be used in conjunction with autoresponders to return an error message to people sending emails to invalid email addresses on your domain. This autoresponder could send back an error message like "Oops, you reached an invalid address, please try again." See "Simple Autoresponders" for how to implement this.
Listservers / Mail Lists
PlusMail can also be used to create simple listservers. There is a limit of 5,000 subscribers per listserver. Here are the instructions for setting up a listserver:
- Set up a welcome message in the infobot directory -- you can name it anything you like, but for our example we'll call it welcome.
The text file could say: "Welcome to our listserver. You are now subscribed and any email you wish to publish for all other subscribers to see can be sent to listserver@yourdomain.com.". This message will be automatically returned to the sender each time someone subscribes.
- Now you need to set up a configuration file to tell the mail system to build a mailing list. In your infobot directory create a file called infolist. This is used to tell the system what to do with addresses received from each infobot response. You can have as many lists as you want. But in keeping with the listserver example above, we will call it listserver. Here's what the file should look like:
welcome listserver
The first line should have a space between the two names and be uploaded in text format, not binary. You can have multiple listservers, such as listserver1, listserver2, etc., but you should only have one configuration file. It must be called infolist. To handle all three examples, you'd make the infolist file look like this, with each listserver on its own line, with no blank lines in-between:
welcome listserver welcome2 listserver2 welcome3 listserver3
2A) Now when someone wants to subscribe to your list in the above example, they would email welcome@yourdomain.com. This would return the infobot created called "welcome" and put their email address into the mailing list file in the maillists directory on your server. You can go in and download the maillist file after it has been created and people have subscribed. The mailing list file will be created AFTER the first person subscribes, or if you yourself send email to "welcome@yourdomain.com" to test it. Put yourself on the mailing list to try this. People don't need to subscribe themselves -- you can add their names for them, or remove them at any time by modifying and uploading the file in the "maillists" directory. People cannot automatically unsubscribe themselves. You must go in and manually remove their email address from the list.
- Now when you or anyone who has subscribed to the list wants to send mail to all subscribers, you or they can send email to listserver@yourdomain.com and the PlusMail system will send it to the entire list.
- To password protect the file, add a password to the first line of your maillists file. In order to mail to the list, this password must be in the first line in the body of the message. Anybody that sends to the list without the password will have their message sent to the default address in the .redirect file. You can then decide if you want them to mail to the list and give them the password if you desire.
- If you want to see who is subscribing to your listserver without having to go and check the maillists file periodically via FTP, you can put a line in your .redirect file.
NOTE: it is important that you have the infobot installed before entering the address line in the .redirect. For the listserver example we used above, the line you would add would look like this:
welcome yourdomain@yourdomain.com
The welcome document you created will be sent to the subscriber, AND you will receive their email message.
Note: When sending email to your listserver for the first time, you will get the autoresponder email back right away, but you may not see the corresponding maillist file right away, as our system takes time to build it. Wait 15 or 30 minutes or so and it will show up. (Depending on the time of day and current traffic conditions, our servers may be allocating it to a lower priority).
Setting up Autoresponders
An autoresponder is a simple way of setting up an email address which will return a message automatically when someone sends email to it. Here are the instructions for setting this up.
In your root (home) directory, there is a directory called infobots. Set up a welcome message in this directory -- you can name it anything you like, but for our example we'll call it info. Don't call it info.txt -- just name it plain info with no file extension. The text for the welcome message could say:
"Thank you for requesting more information about our webpage design package. We have several design packages to choose from. Here are our prices..."
Now, whenever someone sends email to: info@yourdomain.com they will automatically receive that text email message to whatever email address they specified as their return-to address. It's as simple as that. Don't set up a redirect in your .redirect file for this. You can have as many autoresponders as you want. Just save them all in the infobots directory and give them each a unique name of anything with between 3-16 characters long.
SitePop - Adding and Removing Your POP3 Accounts & Change POP3 Passwords
To run sitepop, point your browser to yourdomain.com/cgi-bin/sitepop. If you get a screen that says "Set Login Info", your password has not been set and you must enter a username and password. This login will be saved and you will need to use it to run sitepop again in the future. If the screen just says "Login", your username & password has already been defined. By default it is the same username and password given for your domain's main login. Once logged in, you'll have the option to either add or remove pop accounts. To add, enter the name and password you want, and click submit. To remove, select "remove", choose the pop account you want to remove from the drop-down list. It will take a few minutes for changes to take effect, so if you want to remove one right after adding it, you'll have to wait 15 minutes or so before you will be able to.
To change a POP3 password, select the pop account from the menu and select "change password". Then type in the new password and retype it to confirm, then click submit.
AUCTION
Auction Software
- URL to access Auction once installed on your domain:
http://www.yourdomain.com/cgi-bin/auction/auction.cgi - Directory auction data is stored in: /home/auctiondata
(this directory is NOT accessible from a web browser) - Users must register at your auction site before they are allowed to post items. Once they register they will receive an email immediately giving them their username and password to post items.
- Once an item is closed the high bidder and the item owner will receive an email detailing the winning bid information. The item will then be copied to the closed directory so users can still view this item information and the high bidder information.
- Emails are sent out when auctions close to the item owner and the high bidder. Emails are also sent out when someone is out bid.
Making New Categories
Edit line 54 of the script to point to new categories. The directories listed will be automatically created by the script. Each category should be listed like this:
dir ==> 'category name',
So if you wanted to add a category called SHOES to your auction you would add this to the code
shoes ==> 'Shoes',
If you wanted to add more directories, you would just add them each under the previous one so they would be formatted like this:
shoes ==> 'Shoes', computer => 'Computer Hardware and Software', elec => 'Consumer Electronics'
Deleting Entries From The Auction
Only the auction administrator (you) can remove posted items from the auction. You can remove these any time before the auction closes by going to the following url:
http://www.yourdomain.com/cgi-bin/auction/auction.cgi?[category]&[number]&r&[adminpass]< BR>The easiest way to remove an item is to go to the item in the auction that you want to delete and append
&r&[adminpass]
to the end of the url in your browser.
Note:[adminpass] by default is set to the main username of your domain. For example, if your domain was bob.com the adminpass would be bob so you would just go to the item you want to delete and type
&r&bob
after it in your URL box of your web brower, then hit [ENTER] to delete it
Turing Off The Ability For Your Users To Post Items
Set the following field : $newokay=0 (or leave it undefined) and the link to post a new item will not be visible. By default, this is turned on and any registered user can post items to your auction. If this is turned off only the auction administrator (you) can post items. Use the following url to post:
http://www.yourdomain.com/cgi-bin/auction/auction.cgi?1&1&n
Changing the Auction Site Name
By default when someone visits your auction they will see
"yourdomain.com Online Auction"
You can change this by editing the following field: $sitename = 'domain.com'; So if you want to call your auction: Troys Toy Auction. Change this to read
$sitename = 'Troys Toy Auction';
And then on every page of your site you will see this header automatically placed in the upper left hand corner.
CGI
CGI-bin Applications
CGI stands for "Common Gateway Inferface," a fancy name meaning computer programs running on the webserver that can be invoked from a www page at the browser. The "bin" part alludes to the binary executables that result from compiled or assembled programs. It is a bit misleading because cgi's can also be Unix shell scripts or interpreted languages like Perl. CGI scripts need to be saved in ASCII format and uploaded to your server's cgi-bin in ASCII or text format. This is very important.
We don't provide free support for CGI scripts which we did not install on your server. So if you are not already familiar with CGI scripting, you may want to read a book on the subject or find places on the Internet with CGI scripting information. There are many good resources for CGI scripts found on the web. The scripts at Matt's Script Archive found at http://www.worldwidemart.com/scripts/ are very good. Many of our scripts come from here. Another excellent resource is The CGI Resource Index found at http://www.cgi-perl.com/ -- if you are not an expert, look for scripts that are very well documented and come with step-by-step instructions, or contact us for help or installation.
Paths to Date, Mail, Perl, etc.
Here are your paths to the common server resources that CGI scripts often require:
| Sendmail: |
/usr/sbin/sendmail |
| Perl5.003: |
/usr/bin/perl |
| Perl5.004: |
/usr/bin/perl5.004 |
| Date: |
/bin/date |
| Java: |
/usr/local/java/bin/java |
| Python: |
/usr/bin/python |
| Domain path: |
/www/yourdomain
|
| |
(puts you in your web directory) |
| Cgi-bin path: |
/www/yourdomain/cgi-bin |
| |
(puts you in your
cgi-bin) |
Look at the window in your FTP or Telnet client to see
whether your site resides on /home/ or /home2/.
Where to Put CGI-bin Scripts
Put your cgi-bin scripts in the www subdirectory named "cgi-bin". If you have given full POP/FTP/Telnet accounts to other people, each of them will have their own separate cgi-bin inside the main cgi-bin. When they login with their username and password, they will only have access to their own cgi-bin.
Setting Permissions
The following is a simple explanation of file permissions in Unix. To list the access permissions of a file or directory, telnet to your server, then:
cd directoryname
to change the directory until you are either in the directory above the file you are interested in, or above the directory you are checking.
Type: ls -l filename and you will see what the current permission settings are for that file, along with a bunch of other stuff.
Examples of using chmod:
| PEOPLE | PERMISSIONS |
| u = the file's user (you) | r = read access |
| g = the file's group | x = execute access |
| o = others | w = write access |
| a = the user, the group, and others | |
To change permissions for a file named filename.cgi, you need to chmod the file (change mode). For example, when you type this:
chmod u=rwx,g=rx,o=rx filename.cgi
you've given: read, execute, and write access to the user (that's you) read and execute access to the group and read and execute access to others.
Some scripts will tell you to chmod 775 (for example). Doing the above is the same thing as typing chmod 775. You can use either method with our Unix servers. Let me explain:
When using the numeric system, the code for permissions is as follows:
r = 4 w = 2 x = 1 rwx = 7
The first 7 of our chmod775 tells Unix to change the user's permissions to rxw (because r=4 + w=2 + x=1 adds up to 7. The second 7 applies to the group, and the last number 5, refers to others 4+1=5).
When doing an ls -lon the file, telnet always shows the permissions this way:
-rwxr-xr-x
Ignore the first dash, then break up the above into three groups of letters. If there's a dash where a letter should be, it means that there is no permission for those people.
Remember: the first 3 apply to user, the second 3 apply to group, and the third 3 apply to others.
Some FTP clients support changing permissions in a more graphical way. If you have Fetch for the Mac, you have an easy way to change permissions. Go to the file you want to change the permissions on, and highlight it. Under the Remote menu, select Change Permissions. A window will pop up showing the current permissions for the file you had
highlighted. Click on the boxes to change permissions as needed.
WS_FTP accomplishes the same task as above. Just highlight the file you want to check, and right-click on it. A menu will pop up, then select CHMOD.
Permission Settings for the scripts provided
| |
Normal Site |
Frontpage Site |
| BBS |
| bbb dir |
chmod 777 |
chmod 777 |
| bbs/messages |
chmod 777 |
chmod 777 |
| bbs/index.sht |
chmod 666 |
chmod 666 |
| bbs/data |
chmod 666 |
chmod 666 |
| cgi-bin/wwwboard.pl |
chmod 755 |
chmod 755 |
| Guestbook |
| Guestbook Dir |
chmod 755 |
chmod 777 |
| Guestbook/guestbook.cgi |
chmod 755 |
chmod 755 |
| Guestbook/guestbook.setup |
chmod 666 |
chmod 666 |
| Guestbook/guestbook.html |
chmod 666 |
chmod 666 |
| Vistior Links |
| links dir |
chmod 755 |
chmod 777 |
| links/links.htm |
chmod 666 |
chmod 666 |
| cgi-bin/links.pl |
chmod 755 |
chmod 755 |
| Graphic Counter |
| counter dir |
chmod 775 |
chmod 777 |
| counter/logs |
chmod 777 |
chmod 777 |
| counter/ all other
files |
chmod 666 |
chmod 666 |
| cgi-bin/counter |
chmod 755 |
chmod 755 |
| Cgi-bin always chmod 755 all scripts chmod 755 in main bin |
| cgi-bin/counters (text counter) |
chmod 755 |
chmod 777 |
| Random Text |
| random dir |
chmod 775 |
chmod 777 |
| random/random.txt |
chmod 666 |
chmod 666 |
| Password Admin. |
| password dir |
chmod 755 |
chmod 777 |
| All password files |
chmod 666 |
chmod 666 |
Troubleshooting CGI-bin Problems
Below are solutions to some of the more common CGI script problems, in question and answer format.
When I activate my CGI program, I get back a page that says "Internal Server Error. The server encountered an internal error or misconfiguration and was unable to complete your request."
This is generally caused by a problem within the script. Log in via Telnet and test your script in local mode to get a better idea of what the problem is. To do this, go into the directory in which your script is located, then execute the script. To execute the script, you can do it by two ways:
- Type "perl myscript.pl" (Perl being the language interpreter in this case).
- Or simply type "myscript.pl" alone, that will work if the first line is well written to indicate the location of Perl.
The first one is useful to see if there's any error IN your script. The second one is useful to test if your "calling line" (the first line of the script) is okay, i.e. if you entered the right location of Perl.
I am being told "File Not Found," or "No Such File or Directory."
Upload your Perl or CGI script in ASCII mode, not binary mode.
When I test my Perl script in local mode (by Telnet), I have the following error: "Literal @domain now requires backslash at myscript.pl line 3, within string. Execution of myscript.pl aborted due to compilation errors."
This is caused by a misinterpretation by Perl. You see, the "@" sign has a special meaning in Perl; it identifies an array (a table of elements). Since it cannot find the array named domain, it generates an error. You should place a backslash (\) before the "@" symbol to tell Perl to see it as a regular symbol, as in an email address.
I am getting the message "POST not implemented."
You are probably using the wrong reference for cgiemail. Use the reference /cgi-bin/cgiemail/mail.txt. Another possibility is that you are pointing to a cgi-bin script that you have not put in your cgi-bin directory. In general, this message really means that the web server is not recognizing the cgi-bin script you are calling as a program. It thinks it is a regular text file.
It's saying I don't have permission to access /
This error message means that you are missing your index.htm file. Note that files that start with a "." are hidden files. To see them, type ls -al. If you wish to FTP this file in, go to the home/yourdomain directory.
SSI (Server Side Includes)
In order for your SSI to work, the web page must have either .sht or .shtml extensions. Sample SSI: <!--#exec cgi="/cgi-bin/count.cgi"--> Please note that the url must be relative as shown above. Following would not work: <!--#exec.cgi="http://yourdomain.com/cgi-bin/count.cgi"--> All directives to the server are formatted as SGML comments within the document. This is in case the document should ever find itself in the client's hands unparsed. Each directive has the following format: <!--#command tag1="value1" tag2="value2" --> Each command takes different arguments, most only accept one tag at a time. Here is a breakdown of the commands and their associated tags:
- config
The config directive controls various aspects of the file parsing. There are two valid tags:
- errmsg controls what message is sent back to the client if an error includes while parsing the document. When an error occurs, it is logged in the server's error log.
- timefmt gives the server a new format to use when providing dates. This is a string compatible with the strftime library call under most versions of UNIX.
- sizefmt determines the formatting to be used when displaying the size of a file. Valid choices are bytes, for a formatted byte count (formatted as 1,234,567), or abbrev for an abbreviated version displaying the number of kilobytes or megabytes the file occupies.
- include
include will insert the text of a document into the parsed document. Any included file is subject to the usual access control. This command accepts two tags:
- virtual gives a virtual path to a document on the server. You must access a normal file this way, you cannot access a CGI script in this fashion. You can, however, access another parsed document.
- file gives a pathname relative to the current directory. ../ cannot be used in this pathname, nor can absolute paths be used. As above, you can send other parsed documents, but you cannot send CGI scripts.
- echo prints the value of one of the include variables (defined below). Any dates are printed subject to the currently configured timefmt. The only valid tag to this command is var, whose value is the name of the variable you wish to echo.
- fsize prints the size of the specified file. Valid tags are the same as with the include command. The resulting format of this command is subject to the sizefmt parameter to the config command.
- flastmod prints the last modification date of the specified file, subject to the formatting preference given by the timefmt parameter to config. Valid tags are the same as with the include command.
- exec executes a given shell command or CGI script. It must be activated to be used. Valid tags are:
- cmd will execute the given string using /bin/sh. All of the variables defined below are defined, and can be used in the command.
- cgi will execute the given virtual path to a CGI script and include its output. The server does not perform error checking to make sure your script didn't output horrible things like a GIF, so be careful. It will, however, interpret any URL Location: header and translate it into an HTML anchor.
SSI Environment Variables
A number of variables are made available to parsed documents. In addition to the CGI variable set, the following variables are made available:
- DOCUMENT_NAME: The current filename.
- DOCUMENT_URI: The virtual path to this document (such as /docs/tutorials/foo.shtml).
- QUERY_STRING_UNESCAPED: The unescaped version of any search query the client sent, with all shell-special characters escaped with \.
- DATE_LOCAL: The current date, local time zone. Subject to the timefmt parameter to the config command.
- DATE_GMT: Same as DATE_LOCAL but in Greenwich mean time.
- LAST_MODIFIED: The last modification date of the current document. Subject to timefmt like the others.
MajorCool
MajorCool is a web-based interface to Majordomo allowing users to add and delete themselves from lists and manage lists that they own.
To access this program please enter http://domain.com/cgi-bin/majorcool into your browser.
Should you require help using the program please hit the "Help" button at the bottom of the main page. The program is pretty self-explanatory with just 3 buttons at the top:
- BROWSE-
You can search for lists that contain a certain email address or contain a specific string in their names. You can also get info on any list such as the owner's email address, the info file that is sent to new subscribers, etc. You can even see the entire list of subscribers for each list. All of this part is completely public, you don't need any password.
- MODIFY-
Here is where a list owner can enter their admin password to change anything about the list: add or delete subscribers, change the config file, change the description and info file associated with the list, etc. However they cannot delete the list entirely, or create new lists, or rename any lists.
- PREFS-
This is no big deal, just controls the onscreen display of MajorCool such as changing the layout of the features.
Your first PHP-enabled page
First to view the current version of PHP which is installed on your domain or to see the most common settings please direct your browser to http://www.youractualdomain.com/phpinfo.php
Create a file named hello.php and in it put the following lines:
<html><head><title>PHP Test</title></head> <body><?php echo "Hello World<p>"; ?></body></html>
The colours you see are just a visual aid to make it easier to see the PHP tags and the different parts of a PHP expression. Note also that this is not like a CGI script. The file does not need to be executable or special in any way. Think of it as a normal HTML file which happens to have a set of special tags available to you that do a lot of interesting things.
This program is extremely simple and you really didn't need to use PHP to create a page like this. All it does is display: Hello World
If you tried this example and it didn't output anything, chances are that the server you are on does not have PHP enabled. Ask your administrator to enable it for you.
The point of the example is to show the special PHP tag format. In this example we used . You may jump in and out of PHP mode in an HTML file like this all you want.
Something Useful
Let's do something a bit more useful now. We are going to check what sort of browser the person viewing the page is using. In order to do that we check the user agent string that the browser sends as part of its request. This information is stored in a variable. Variables always start with a dollar-sign in PHP. The variable we are interested in is $HTTP_USER_AGENT. To display this variable we can simply do:
<?php echo $HTTP_USER_AGENT; ?>
For the browser that you are using right now to view this page, this displays:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; DigExt)
There are many other variables that are automatically set by your web server. You can get a complete list of them by creating a file that looks like this:
<?php phpinfo(); ?> Then load up this file in your browser and you will see a page full of information about PHP along with a list of all the variables available to you.
You can put multiple PHP statements inside a PHP tag and create little blocks of code that do more than just a single echo. For example, if we wanted to check for Internet Explorer we could do something like this:
<?php if(strstr($HTTP_USER_AGENT,"MSIE")) { echo "You are using Internet Explorer<br>"; } ?>
Here we introduce a couple of new concepts. We have an "if" statement. If you are familiar with the basic syntax used by the C language this should look logical to you. If you don't know enough C or some other language where the syntax used above is used, you should probably pick up any introductory C book and read the first couple of chapters. All the tricky string and memory manipulation issues you have to deal with in C have been eliminated in PHP, but the basic syntax remains.
The second concept we introduced was the strstr() function call. strstr() is a function built into PHP which searches a string for another string. In this case we are looking for "MSIE" inside $HTTP_USER_AGENT. If the string is found the function returns true and if it isn't, it returns false. If it returns true the following statement is executed.
We can take this a step further and show how you can jump in and out of PHP mode even in the middle of a PHP block:
<?php if(strstr($HTTP_USER_AGENT,"MSIE")) { ?> <center><b>You are using Internet Explorer</b></center> <? } else { ?> <center><b>You are not using Internet Explorer</b></center>
} ?>
Instead of using a PHP echo statement to output something, we jumped out of PHP mode and just sent straight HTML. The important and powerful point to note here is that the logical flow of the script remain intact. Only one of the HTML blocks will end up getting sent to the viewer. Running this script right now results in:
You are using Internet Explorer
Dealing with Forms
One of the most powerful features of PHP is the way it handles HTML forms. The basic concept that is important to understand is that any form element in a form will automatically result in a variable with the same name as the element being created on the target page. This probably sounds confusing, so here is a simple example. Assume you have a page with a form like this on it:
<form action="action.php" method="post"> Your name: <input type="text" name="name"> You age: <input type="text" name="age"> <input type="submit"></form>
There is nothing special about this form. It is a straight HTML form with no special tags of any kind. When the user fills in this form and hits the submit button, the action.php page is called. In this file you would have something like this:
Hi <?php echo $name; ?>. You are <?php echo $age; ?> years old.
It should be obvious what this does. There is nothing more to it. The $name and $age variables are automatically set for you by PHP.
PRE-INSTALLED CGI-BIN SCRIPT
Cgiemail
Cgiemail is another form processing script, totally different than FormMail, discussed above. It is a program written in the C language that takes the contents of fill-in boxes on a form and emails them to a specified location. In addition to the form specification in the .html file, a mail specification in a .txt file is required to format the resulting email message. We provide the cgiemail in the cgi-bin directory of your server. You need to have an action in your order.htm file to call it. It should look like this: <form method=post action="http://www.yourdomain.com/cgi-bin/cgiemail/order.txt"> Details are provided below. While there are a number of subsections below this one, they all work together and are meant to be read from start to finish.
order.htm Look for a file in your www directory called order.htm. This is our example form we put on your site that shows how a form should be configured to work with Cgiemail. Look at it in a browser, and download it to your hard drive using FTP so you can see how it works. If you've never dealt with HTML forms before, don't worry, they're easy to create and understand. The form prompts the user for data which is sent to the server as simple key-value pairs. Each <input> tag specifies a record. The key is given by the name attribute, and the value is given by the value attribute. The type attribute tells the browser what kind of data to expect. Now, try looking at the example. Please note that the hidden items are used to transmit critical info to Cgiemail. They provide the location of the success file, the name of the person the results should be sent to, and the subject of the form. When making your own forms, you may want to change the email address in the "required-to" field, and likely the subject in the "subject" field. The first item tells Cgiemail what to show the user after successfully completing the form. You can, but don't need to customize this. After that come the items that are actually presented to the user. You'll want to use type=text input items with cgiemail: it's a simple tool. The size=60 tells the browser how big to make the box. The name=something is required in each input tag, otherwise the browser wouldn't know how to send the data to the server. The value=" " attribute is correct in most cases, unless you want a default value in the form. Note that if a field begins with required-, cgiemail will require that the user enter a value for this field. This is particularly useful if you want to require a user to submit their email address. When the user presses the Submit button, the data goes to our machine where cgiemail starts doing something with it. What is does is controlled by the order.txt file discussed below. By the way, you can name your HTML form anything you want to.
order.txt Now that we have all this data, what do we do with it? Mail it, of course! But for flexibility, cgiemail requires that you create a mail.txt file to show it what to send. (If you didn't want flexibility you'd use a mailto link.) The program will read this file, perform substitutions, and pass it to the mail system. Make sure that you upload mail.txt in ASCII mode. Failure to upload mail.txt in ASCII mode will generate the message:
"Server Error: The server encountered an internal error or misconfiguration and was unable to complete your request."
There is already an example order.txt document in the forms directory in your www directory. By the way, there's nothing magical about the name order.txt. Feel free to call it mail1.txt or form1.mail, or whatever suits you, as long as the form has the correct name for what you uploaded. Note that the first several lines are mail headers. You probably shouldn't change that part, or the corresponding parts in your form. In particular, there must be a To: header or the mail won't go anywhere! What cgiemail does is simply replace every string that looks like [key] with the value the user typed into the field with name=key. That's all. You can lay out your form as is best for your users, but lay out your mail.txt as is best for you to read. You can even insert gobs of text to help format the output. Only the [key] parts will be replaced by cgiemail. Cgiemail does not report environmental variables like FormMail will, but other than that, it is an excellent program, allowing you more flexibility in the way you want your data returned by the form.
Formmail.cgi
The script is one from Matt's Script Archive which we have installed and preconfigured for your domain. FormMail is a generic www form to e-mail gateway, which will parse the results of any form and send them to the specified user. This script has many formatting and operational options, most of which can be specified through the form, meaning you don't need any programming knowledge or multiple scripts for multiple forms. This also makes FormMail the perfect system-wise solution for allowing users form-based user feedback capabilities without the risks of allowing freedom of CGI access. There is only one form field that you must have in your form, for FormMail to work correctly. This is the recipient field. Other hidden configuration fields can also be used to enhance the operation of FormMail on your site. The action of your form needs to point towards this script (obviously), and the method must be POST in capital letters. Here's an example of the form fields to put in your form: <FORM METHOD=POST ACTION="http://yourdomain.com/cgi-bin/formmail.cgi"> <input type=hidden name="recipient" value="whoever@yourdomain.com"> <input type=hidden name="subject" value="Order"> <input type=hidden name="return_link_url" value="http://yourdomain.com/"> <input type=hidden name="return_link_title" value="Back to Main Page">
The following are descriptions and proper syntax for fields you can use with FormMail. Recipient Field Description: This form field allows you to specify to whom you wish for your form results to be mailed. Most likely you will want to configure this option as a hidden form field with a value equal to that of your email address.
Syntax: <input type=hidden name="recipient" value="email@yourdomain.com">
Subject Field Description: The subject field will allow you to specify the subject that you wish to appear in the email that is sent to you after this form has been filled out. If you do not have this option turned on, then the script will default to a message subject: "WWW Form Submission".
Syntax: If you wish to choose what the subject is: <input type=hidden name="subject" value="Your Subject">
To allow the user to choose a subject: <input type=text name="subject">
Email Field Description: This form field will allow the user to specify their return email address. If you want to be able to return e-mail to your user, I strongly suggest that you include this form field and allow them to fill it in. This will be put into the From: field of the message you receive. If you want to require an email address with valid syntax, add this field name to the 'required' field.
Syntax: <input type=text name="email">
Realname Field Description: The realname form field will allow the user to input their real name. This field is useful for identification purposes and will also be put into the From: line of your message header.
Syntax: <input type=text name="realname">
Redirect Field Description: If you wish to redirect the user to a different URL, rather than having them see the default response to the fill-out form, you can use this hidden variable to send them to a pre-made HTML page.
Syntax: To choose the URL they will end up at: <input type=hidden name="redirect" value="http://yourdomain.com/to/file.html">
To allow them to specify a URL they wish to travel to once the form is filled out: <input type=text name="redirect">
Required Field Description: You can require certain fields in your form to be filled in before the user can successfully submit the form. Simply place all field names that you want to be mandatory into this field, separated by commas. If the required fields are not filled in, the user will be notified of what they need to fill in, and a link back to the form they just submitted will be provided. To use a customized error page, see 'missing_fields_redirect'
Syntax: If you want to require that they fill in the email and phone fields in your form, so that you can reach them once you have received the mail, use the syntax like: <input type=hidden name="required" value="email,phone">
Env_report Field Description: Allows you to have Environment variables included in the email message you receive after a user has filled out your form. Useful if you wish to know what browser they were using, what domain they were coming from or any other attributes associated with environment variables. The following is a short list of valid environment variables that might be useful: REMOTE_HOST - Sends the hostname making the request. REMOTE_ADDR - Sends the IP address of the remote host. HTTP_USER_AGENT - The browser the client is using. (Note: In our case, both REMOTE_HOST and REMOTE_ADDR are the same, since our servers don't do the reverse DNS lookup needed to generate the true REMOTE_HOST string).
Syntax: If you wanted to find all the above variables, you would put the following into your form: <input type=hidden name="env_report" value="REMOTE_HOST,REMOTE_ADDR,HTTP_USER_AGENT">
Sort Field
Description: This field allows you to choose the order in which you wish for your variables to appear in the email form that FormMail generates. You can choose to have the field sorted alphabetically or specify a set order in which you want the fields to appear in your mail message. By leaving this field out, the order will simply default to the order in which the browsers send the information to the script (which is usually the exact same order as they appeared in the form). When sorting by a set order of fields, you should include the phrase "order:" as the first part of your value for the sort field, and then follow that with the field names you want to be listed in the email message, separated by commas.
Syntax: To sort alphabetically:
<input type=hidden name="sort" value="alphabetic">
To sort by a set field order:
<input type=hidden name="sort" value="order:name1,name2,etc...">
Print_config Field
Description: print_config allows you to specify which of the config variables you would like to have printed in your e-mail message. By default, no config fields are printed to your email. This is because the important form fields, like email, subject, etc. are included in the header of the message. However some users have asked for this option so they can have these fields printed in the body of the message. The config fields that you wish to have printed should be in the value attribute of your input tag separated by commas.
Syntax: If you want to print the email and subject fields in the body of your message, you would place the following form tag:
<input type=hidden name="print config" value="email, subject">
Print_blank_fields Field
Description: print_blank_fields allows you to request that all form fields are printed in the return HTML, regardless of whether or not they were filled in. FormMail defaults to turning this off, so that unused form fields aren't emailed.
Syntax: <input type=hidden name="print_blank_fields" value="1">
Title Field
Description: This form field allows you to specify the title and header that will appear on the resulting page if you do not specify a redirect URL.
Syntax: If you wanted a title of 'Feedback Form Results':
<input type=hidden name="title" value="Feedback Form Results">
Return_link_url Field
Description: This field allows you to specify a URL that will appear, as return_link_title, on the following report page. This field will not be used if you have the redirect field set, but it is useful if you allow the user to receive the report on the following page, but want to offer them a way to get back to your main page.
Syntax: <input type=hidden name="return_link_url" value="http://yourdomain.com/index.htm">
Return_link_title Description: This is the title that will be used to link the user back to the page you specify with return_link_url. The two fields will be shown on the resulting form page as: Back to Main Page
Syntax:<input type=hidden name="return_link_title" value="Back to Main Page">
Guestbook
Guestbook allows you to set up your own comments page. From there, visitors can add entries to your guestbook and they will be displayed with the most recent at the top and scrolling down, or vice versa. Other options include the ability to limit HTML in the entry, link to e-mail address with mailto tag, use a log to log entries, redirect to a different page after signing, emailing whenever a new entry is added, and much more. Guestbook is already set up for use on your server. You can simply use the following URL to access it: http://yourdomain.com/Guestbook/guestbook.html If you want to change any of the configuration options, locate the guestbook.cgi file in your Guestbook directory (inside your www directory). Download it to your hard drive in ASCII mode, and save it somewhere safe. Create a copy of the file and give it the same name, then edit the options as specified below. Keep your backup of the original guestbook.cgi in case you run into problems.
Option 1: $mail This option will allow you to be notified via an E-mail address when a new entry arrives in your guestbook. The entry will be mailed to you as a notification. If you should choose to turn this variable on you will need to fill in the 2 variables that go along with it: $recipient - Your email address, so that the mailing program will know who to mail the entry to. $mailprog - The location of your sendmail program on your host machine.
Option 2: $uselog This will allow you the ability to use the short log feature. It is already turned on so you will have to change it to 0 if you do not wish to use it. It has been implemented since there are probably many people who feel no need to have a log when people are making entries to a file anyway. Keep in mind that it will show errors which is one nice aspect about it.
Option 3: $linkmail Turning this option on will make the address links in your guestbook become hyperlinked. So instead of simply having (name@some.host) it will put (<a href="mailto:name@some.host">name@somehost</a> so that anyone can simply click on the address to email them.
Option 4: $separator This allows you to choose whether you want guestbook entries to be separated by a Paragraph Separator <p>, or a Horizontal Rule <hr>. By changing the 0 in the script to a 1, you will turn on the <hr> separator and turn off the <p> separator. The 0 option will do the reverse of that; turn on the <p> and turn off the <hr>.
Option 5: $redirection By choosing 1 you will enable auto redirection and 0 will return a page to the user telling them their entry has been received and click here to get back to the guestbook.
Option 6: $entry_order Set this option to 0 and the newest entries will be added below the rest of the entries. Keep this option at 1 and the guestbook will add the newest entries at the top.
Option 7: $remote_mail Many users of the guestbook have requested that a form letter be automatically sent to the remote user when they fill in the guestbook. Turning this option on will tell the script to automatically mail any user who leaves an email address. You can specify the contents of the mail message by editing the section of the script that sends mail to the remote user. By default it sends a message that says, "Thank you for adding to my guestbook." and then shows them their entry. If you should choose to turn this variable on, you will need to fill in the 2 variables that go along with it: $recipient - Your email address so that the mailing program will know who to mail the entry to. $mailprog - The location of your sendmail program on your host machine.
Option 8: $allow_html This option allows you to turn on or off the use of HTML tags by users of your guestbook. Setting this variable to 1 allows users to embed html tags such as <b> or <H1> or <a href=" "></a> into your html document. Setting this variable to 0 will not allow them to use any html syntax in their comments or any other field. You can still link to their comments or any other field. You can still link to their email address by turning $link_mail to 1.
There is also the ability for users to add their own URL and then their name is referenced to their URL in the guestbook.html file. This helps to eliminate the need for allow_html to be turned on, and lets users point you to a spot that will tell you more about them. Several users of the guestbook script have asked for this option. If you wish to disable the option, simply delete the following line from your addguest.html file: URL: <input type=text name=url size=50><br>
These are the rest of the important guestbook files found in your Guestbook directory: guestbook.html This is the file that you will link to that will contain the Guestbook Entries. You may want to edit the title and heading spaces and customize the look any way you desire. Do not delete the line <!--begin--> from this guestbook, or else the script will have no way of knowing where to begin the editing. The <!--begin--> line is the only necessary line in your guestbook.html file, but the link to the addguest.html file is also a good idea. :-)
addguest.html This is a fill-out form to add a new entry into the guestbook. This is also customizable as long as the action tags and basic field names in the form remain the same.
guestlog.html This is a short log that lists domains and times that entries were created. Much easier to browse and it will point out those failed entries when users did not specify a name or comments. You will need to give the file read/write access.
Visitor Links Page
Visitor Link Page allows you to set up a web page which your users can then add links to in specified categories. Newest links are added to the top of each category. A running total of the number of links present as well as the time when the last link was added is shown at the top of the page. Your preconfigured Visitor Links page is already set up on your server at http://www.yourdomain.com/links/links.htm. The only configuration you may want to do is to customize the look of the links.htm page. Just leave the method and input tags the way they are. If you decide to change the category names, you must do so in the links.htm document, AS WELL AS the links.pl file in your cgi-bin.
Secure Server Order Forms
Normally, any text (such as your credit card number) sent from your browser to the web server is sent as plain text. This means that a hacker could potentially intercept (however unlikely) the information sent from your browser and read it. However, by using the secure server, the information is encrypted before it is sent from your browser. It would be practically impossible for anyone to decrypt it without knowing the key. Please use the secure server only when necessary, as when requesting sensitive information from your visitors. The domains hosted by us are housed on any number of computers and all of them have a different machine name. To find out what machine name to use for your secure order access calls, check the faq file of your domain at:
http://www.yourdomain.com/faq.html
Each server has its own site-secure.net site, and although you will be putting your form on your own domain, it must be called through the site-secure.net server in order for the form to be secure. To do this, create your form as usual and put it somewhere in your www directory. You can put your form anywhere you want to, but for this example, let's assume the normal URL for your form can be accessed from a browser with this URL:
http://www.yourdomain.com/signup/secureform.html
To call the form through the secure-order server, you need to use the following URL to access your pages via the secure server (even though your form resides on your own domain space):
https://machinename.site-secure.net/yourdomain/signup/secureform.html
That would be the URL you would put as an <HREF> to link to your form from whatever page you have your visitors link from. Don't forget the "s" in "https." Your cgi-bin dir is:
https://machinename.site-secure.net/yourdomain/cgi-bin/
Special instructions for using FormMail.cgi with the Secure Server If you are using formmail.cgi through the secure server, you can still place your form anywhere on your webspace you want to, but you MUST use the following URL as the ACTION of your form:
https://crimson.site-secure.net/cgi-bin/formmail.cgi
Here's an example of how the first parts of your form might look:
<FORM METHOD=POST ACTION="https://crimson.site-secure.net/cgi-bin/formmail.cgi"> <input type=hidden name="recipient" value="whoever@yourdomain.com"> <input type=hidden name="subject" value="Order"> <input type=hidden name="return_link_url" value="http://yourdomain.com/"> <input type=hidden name="return_link_title" value="Back to Main Page">
It is still important that you call your order page through a secure URL in order to work properly. For example: https://crimson.site-secure.net/yourdomain/order.htm.
Random Text Generator
This script is preconfigured for your server. There is a directory in your www directory called "random." Inside that directory is a file called random.txt. Just download this file to your hard drive and edit it with any random text you would like placed in an html document. Remember to keep the %% separator between quotes. You can use any html formatting tags you want to, including <href> tags so you can configure it as a random link generator. You can put in as many quotes as you wish. Upload the random.txt file to your server in the same location you found it, remembering to upload it in ASCII or text mode. The script uses SSI (Server Side Includes) so the page you want to use random text on must have the .sht, .shtm, or .shtml extension. On your page, just put this tag wherever you want the random text to appear: <!--#exec cgi="/cgi-bin/randomtext.cgi"-->
That's all there is to it!
WWW Board
WWW Board is a threaded World Wide Web discussion forum and message board, which allows users to post new messages, follow-up to existing ones and more. It is already preconfigured for your server. Just go to http://www.yourdomain.com/bbs to post your messages there. There are several options you may want to configure. First of all, the index.sht file in the bbs directory can be customized any way you wish as long as you leave the method and input tags the way they are. Additionally, here are some options contained in the wwwboard.pl script itself (located in your cgi-bin directory) which you may want to change, depending on your needs:
$show_faq = 1;
This option allows you to choose whether or not you want to display a link to the FAQ on every individual message page or not. It defaults to 1 and the link will be put in at the top of the message along with links to Followups, Post Followup and Back to $title. Setting this to 0 will turn it off, and keeping it at 1 will keep the link. You need to create a faq.html file and put it inside the bbs directory. The FAQ can contain any information you want to give your visitors about how the board works, your organization, types of postings that will be allowed, etc.
$allow_html = 1; This option lets you choose whether or not you want to allow HTML mark-up in your posts. If you do not want to allow it, then everything that a user submits that has <>'s around it will be cut out of the message. Setting this option to 1 will allow HTML in the posts and you can turn this option off by setting it to 0.
$quote_text = 1; By keeping this option set to 1, the previous message will be quoted in the followup text input box. The quoted text will have a ':' placed in front of it so you can distinguish what had been said in the previous posts from what the current poster is trying to get across. Setting this option to 0 will leave the followup text box empty for the new poster.
$subject_line = 0; There are three options for the way that you can display the subject line for the user posting a followup. Leaving this option at 0 which is the default value, will put the previous subject line into the followup form and allow users to edit the subject however they like. Setting this option to 1, however, will quote the subject, but simply display it to the user, not allowing him or her to edit the subject line. The third and final option can be achieved by setting the $subject_line variable to 2. If it is set to 2, the subject will not be quoted and instead the user will be prompted with an empty subject block in their followup subject line.
$use_time = 1; This option allows you to choose whether or not you want to use the hour:minute:second time with the day/month/year time on the main page. Day/Month/Year will automatically be placed on the main wwwboard.html page when a new entry is added, but if you leave this variable at 1, the hour:minute:second time will also be put there. This is very useful for message boards that get a lot of posts, but if you would like to save space on your main page, you can set this to 0, causing the hour:minute:second display not to be added.
Search.cgi
Search will look at all your html pages for words you enter, and return all pages on a list with links. This program is completely configured and ready to run, but for Search.cgi to return a response, it need to be activated. This is easily done by logging in via telnet and at the prompt after login type the following command: chmod +r /www/yourdomain
Now you can access search.cgi with the following URL: http://yourdomain.com/cgi-bin/search.cgi.
There is a configuration file called search_define.pl which accompanies search.cgi and sets up the variables for it. You can customize which files you wish to exclude from searches, and also the cosmetics of the search and results pages.
Single Page Shopping Cart (on qualifying accounts only)
There should be a Single Page Shopping Cart program installed on your server. You can see what it looks like by going to this URL with your browser:
http://www.yourdomain.com/shop/boutique.html
If you want to customize the shopping cart, (and you will if you want to sell products using this program), you can visit:
http://virtualpublisher.com/
The Virtual Publisher Shopping Cart program is sophisticated and complex. Rather than reprint all their directions here, please go to their website and download the help files associated with it.
If the Single Page Shopping Cart program wasn't installed on your server and you want it, please send us email and we'll make sure it's installed right away!
Page Counters
There are 3 different types of page counters you can place on your pages. The first is a no-frills graphical counter which looks like this:

To use this one, put the following tag somewhere on your page, but change the yourpage.htm to be the address of the actual page you are putting this counter on. Also, don't break up the tag like we did. We had to do that to fit it on the page. The width=5 part refers to how many digits you want in your counter.
<IMG SRC="/cgi-bin/nph-count?width=5&link=http://yourdomain/yourpage.htm">
Graphical counter: A simple counter called using "img" tag. You can edit the count on any page by going to the counter directory off of your main www and changing the number in the txt file of the page you would like to correct. http://yourdomain.com/counter
Finally, the simplest kind of page counter is a text-based counter. It uses SSI so the page you are putting it on must have the .sht, .shtm, or .shtml extension. It will look like whatever text and size attributes you give it on your page. The tag looks like this:
<!--#exec cgi="/cgi-yourdomain/counters/counter.cgi"-->
After you've put the counter on your page, look at it with your browser. If you don't see the counter the first time, hit reload. Then you should see the number 1. If you want to change the page count, FTP to your site, and look in the counters directory in your cgi-bin. There will be a file there with the name of whatever page you placed this counter on. Just upload a new text file with a new number on it, and that will be the new count on the page next time you hit reload. Remember to upload the file in ASCII or text format.
AlienForm Mail Script
AlienForm is an easy to use Form to Email gateway. It uses simple templates to format all aspects of its output. It can send out more than one email at once so , you can have it send one email to you, a different courtesy reply to the user, and another to a co-worker. It can write directly to files, allowing you to log every time the form is submitted, or to store order details securely on the server.
Features : - Fully customizable output formatted by simple text templates.
- Supports both command line mailers (ie Sendmail) and network (SMTP) sending of email.
- Can send any number of different emails on every invocation.
- Can output (append) to any number of files per invocation.
- Can perform mathematical calculations on data supplied in the form- so you can total orders, work out shipping etc.
- Environment Settings (i.e. current time, user's hostname etc.) may be included in the templates.
- Can check that entered data matches a particular format- i.e. all digits, a syntactically correct email address, letters only, etc.
- Does not have to send email on every invocation- so you can have the form take a number of steps to fill out before finally being logged or emailed.
- Security measures include you being able to specify what forms & sites are allowed to send to the script.
- Simple, easy to understand error messages.
- alienform.html - an example HTML form that would use the templates given below
- af.cgi - the script itself
- email.txt - an example email template to be sent to you
- email2.txt - an example of an automatic courtesy reply, sent to the person using the form.
- error.txt - an example of an error template that would be outputted to the browser should something go wrong.
- output.txt - an example success template that would be outputted to the browser if everything went right.
- logfile.txt - an example of a log file template.
The af.cgi script is already configured to run.
Configure the Templates : Template file names are arbitrary. Try to use names you will remember, e.g. "email.txt", "error.txt". The file extension (.html, .txt) is irrelevant to the script. Wherever you want the user to supply data, use a word inside square brackets, e.g. [yourname], [age]. You can have underscores in variables, as long as there is a switch in front of it. You can specify one or more switches on the start of the variables, e.g. [re_email_address], [d_age]. Switches allowed:
r - this value is 'required'- it must be filled in. e - this value must look like a valid email address. d - this value may only contain digits (0-9) or a decimal point (.). c - this value can only contain digits, a decimal point, or a dollar sign ($). w - this value may only contain "word" characters (A-Za-z0-9). m - this value can store multiple values (useful for checkboxes with the same name). n - this value will have any new line characters (where the user has pressed enter) removed. s - this value's leading and trailing white space will be removed.
The field names in the HTML must match exactly with those in the templates. I.E. same switches etc. For the email templates, make sure the To: and From: line will have a valid email address in it (by using the e switch). If you let the user put in any old information into the To: line, your email program will generate an error. Make sure for email templates that there is a blank line between the headers and the content. Logging templates must have the filename to write to as the first line. Everything after the first line will be appended (tacked onto the bottom of) the file specified. Fields in the templates such as [%HTTP_REFERER], [%REMOTE_HOST] will be substituted with their counterpart environment values. They must begin with a %. You cannot require an environment setting- if it is not set it will be left blank. In error templates, the error title is specified as [%OUT_TITLE], and the error message is specified by [%OUT_MSG]. To do arithmetic, place the calculation in brackets like [< ... >]. Variables will be filled out before being calculated. Examples: [< [d_age] / 2 >] - will be given the value of [d_age] divided by 2. [< ([item1] + [item2] + [item3]) * [tax] >] - will add up the items and multiply them by the tax rate. Remember to save the templates and the script in ASCII or Plain Text mode.
Configure the HTML : All the operations that you want to occur on this iteration are given in hidden form values. I.e. <input type="hidden" name="_send_email" value="email.txt">. Operations are done in the order specified in the HTML. For this reason, it is recommended that you specify the browser output last. All operations are optional. Operations are denoted with a leading underscore. They are:
_send_email - this sends email using the template in this tag's value. _out_file - this logs to a file using the template given in the value. _browser_out - this displays the value's template in the browser. _redirect - this redirects the browser to the URL given here. _error_path - if an error occurs, this template is displayed by the browser. _error_url - if an error occurs, the browser is redirected to this URL. _multi_separator - used with the 'm' value switch, this specifies which character(s) to use to seperate multiple value values. Defaults to ', '. _format_decimals - can be used to format results from arithmetic calculations- if set to "2", the value will be rounded to two decimal points. You can have more than one _send_email or _out_file, if you want more than one email sent or file appended to. In this case, you must specify a unique number or letter after each one- i.e. _send_email_1, _send_email_2, out_file_a, _out_file_b, _out_file_c. It really doesn't matter what you put after them, just as long as each operation is unique. Make sure the name of each field corresponds exactly to what you want it to replace in the templates. It seems some people are having difficulties setting up forms that span multiple pages. Well, it's pretty easy to do once you understand the basic concept: you use multiple _browser_out templates to gather the data in hidden form fields, then submit it all for final processing.
Here is a simple set of examples. The first form collects the submitter's age, the second collects their email address, and the third their favorite color, which then sends it on for final processing (ie. sending emails, logging, etc). Obviously real world situations are going to be a lot more complex than this.
form.html: <form action="/cgi-bin/af2.cgi" method="POST"> <input type="hidden" name="_browser_out" value="part2.txt"> Your name: <input type="text" name="r_name"> </form>
part2.txt:
<form action="/cgi-bin/af2.cgi" method="POST"> <input type="hidden" name="_browser_out" value="part3.txt"> <input type="hidden" name="r_name" value="[r_name]"> Your age: <input type="text" name="r_age"> </form>
part3.txt:
<form action="/cgi-bin/af2.cgi" method="POST"> <input type="hidden" name="_send_email" value="email.txt"> <input type="hidden" name="r_name" value="[r_name]"> <input type="hidden" name="r_name" value="[r_age]"> Your email address: <input type="text" name="re_email"> </form> This works because when the _browser_out text file is parsed, AlienForm will fill in the values in the square brackets from what the user entered.
NueQuiz
URL: http://hostingsupport.com/nuequiz/password.htm (passwd - nuedream) To change the password edit the file named password.cgi in directory nuequiz. Change this enty: $password = "nuequiz"; Choose to edit an existing quiz or create a new one. To create a new one, fill in all of the required fields (the question, the answers, checking the correct answer and the reasoning for the answer) and click "Add".
Access the quiz by using the number of the question in the URL as follows: www.hostingsupport.com/nuequiz/quiz.cgi?expert=1 This will display the first question of the expert quiz.
dp_market
This script includes everything needed to run your own market-place on the internet. Users can submit adverts, which are updated at once and also send to the webmaster if wanted. Setting up and adapting the script is easy and requires no knowledge of Perl/CGI. Info for running and modifying the script is in: /www/user/dp_market/readme.txt
dp_tellafriend
Letting visitors recommend your site to their friends, family and so on, is a great way of getting more and more visitors. This script uses a standard text-file as template, which not only makes setting it up a lot easier, but also makes changing the "look and feel" of the email very easy. Wanna se how it works ? Click 'demo' to recommend DanPromote - to someone you know - or to yourself. http://www.hostingsupport.com/dp_tellafriend/tellafriend.html
Directory Scan (/www/user/dirscan)
The search engine receives the input from the CGI form and processes the required files in order to find the search terms. The list of files is found in /www/user/dirscan/fileinfo.txt. The script would not work if it doesn't get the valid list of files. For compiling the list of files to process use the dirscan.pl utility (so you're actually getting two separate projects, disrcan.pl can be used separately for creating a valid list of your files on the disk). Add the following html code to the page directly in your /www that you want the search button on. Note: be sure to change hostingsupport.com to your domain.
<FORM name=search action="dirscan/find.cgi" method="post"> <b>Search my Homepage:</b><br> <INPUT maxLength=128 size=40 name=string> <INPUT type=submit value="hostingsupport.com" name=Submit>
Search Algorithm
For every search term that is found in a file, a file gets one point. Thus if the search string was "really cool perl script", and the opened file contained the word "really" 0 times, word "cool" 3 times, word "perl" 11 times and word "script" 1 time, the resulting point count would be 15 points. Search engine features The search engine is case-insensitive, thus "pErl", "Perl", "perl" and "PERL" would be treated the same. The location of the search engine on the system is not sensitive, as long as it can get to the valid list of files provided in the fileinfo.txt file. Is it the right one for me? The search engine is optimized to work with the sites containing up to 300 documents, after that level the performance of the engine tends to be slow (since it has to open every file and count the number of points the file gets). By default it searches the documents with "*.htm" extension, but that can be tweaked in the script. How do I exclude files from the search? There is no option to exclude files from the search, if you want them excluded, an option for excluding directories exists in dirscan.pl, if you don't want a specific file to be indexed, exclude it from fileinfo.txt, and do it every time you run dirscan.pl, which basically re-indexes your system and compiles a new list of valid files. Can I customize the results screen? The results of the search can be published with the header and the footer, to provide HTML customization, the header and footer should be located in /www/user/dirscan/header.txt and /www/user/dirscan/footer.txt, if you don't need a header and a footer, comment out the function calls print_header() and print_footer() in find.pl. How the results are published? The results are published as the filenames on your Unix machine, not as the titles.
Guardian
Sends email to your default address whenever someone receives any of the following errors when accessing your site. The 4 lines below need to be in a file named .htaccess in your main /www directory. That file needs to have the permission of chmod 644 (rw-r--r--). Note that the Referer feature won't work unless you have referer logs installed. ErrorDocument 401 /guardian/guardian.cgi?401 ErrorDocument 403 /guardian/guardian.cgi?403 ErrorDocument 404 /guardian/guardian.cgi?404 ErrorDocument 500 /guardian/guardian.cgi?500
NewsPro
http://hostingsupport.com/newspro/newspro.cgi (change to your own domain name) First time login: Username = setup, Password is left blank This takes you to a page to enter your choice of Username, Password and email address. Click continue and complete the setup process. At this stage NewsPro should be fully installed and working. Go back to http://hostingsupport.com/newspro/newspro.cgi and add a news item. The next step it to make your web pages work with NewsPro. When you Submit News to NewsPro it is stored in a database file. Build News takes the news entries from the database and builds them into web-usable files. If you install addons, you may end up building several files in several different locations, but NewsPro always builds a file called news.txt in your /newspro directory. news.txt contains HTML but is not a complete web page and should not be viewed directly in a web browser. It is designed to be included into an HTML page (often your site's home page). SSI (server side includes) is used to add the text to your web page. When you include an SSI in your web page, you are telling the server to merge together two separate files before showing your page to the person visiting your site. In order to use SSI in a web page, you will need to give the page an extension of .shtml rather than .html. The exact SSI code you use to include news.txt depends on where news.txt is located in relation to the HTML file it is being included it. If both files are in the same directory, use: <!--#include virtual="news.txt" --> in your HTML file at the point where you'd like your news to appear. If your HTML file and news.txt are in different directories, use the relative URL from your HTML file to news.txt. For instance, if the locations of the respective files are http://www.yoursite.com/index.html and http://www.yoursite.com/newspro/news.txt, use: <!--#include virtual="newspro/news.txt" --> NOTE: don't forget to change the index.html file name to index.shtml (Be sure that you've submitted and built news, otherwise there's nothing to include.) Once news.txt is being generated and included into your page, you should have a working news system set up. If you post a news item, it will appear on your page. NewsPro is capable of much more than this. You can change what your news items look like, you can archive news items and create different categories of news. For complete documentation see: http://amphibianweb.com/newspro/docs/newspro_documentation.html
2BGuest
Admin login (first time password = web). Be sure to change the password by modifying the file named 2badmin.pl in the 2bguest directory. Change the following line to enter your new password:
$pass="web"; http://hostingsupport.com/cgi-bin/2bguest/2badmin.pl?action=login
http://marnie.cihost.com/2bguest/2 bguest.cgi?action=home (to guestbook)
Random Link Generator
A random link generator with an admin URL used to add and delete links, get the HTML code and test drive the random link. Visitors can also add their own sites through the browser. Change hostingsupport.com to your own domain name in the URLs below. Add a randon link URL: http://hostingsupport.com/rando/add.html Admin URL: http://hostingsupport.com/rando/rando.cgi?123456 Note: To change the password "123456" modify the rando.cgi file in the rando subdirectory.
Random Image Generator
URL: http://hostingsupport.com/randomage/randimg.html (change hostingsupport.com to your domain name) Upload pictures to the following directory: /www/user/randomage/pics (.png, .gif and .jpg filetypes are supported) Features: +Display random images +Can be called via <IMG> tag <IMG SRC="http://www.hostingsupport.com/cgi-bin/randomage/randimg.cgi"> This will successfully take a random image from the /randomage/pics directory and display it. +Supports multiple graphic types +Small filesize
WEB BASED ADMINISTRATION
MonsterControls
Our proprietary MonsterControls web based administration system allows you to control your web presence from a web browser. This virtually eliminates the need for Novice Users to learn and use FTP and Telnet. The more familiar interface of the web browser, combined with point and click simplicity, makes the MonsterControls panel an extremely user-friendly web management system.
The MonsterControls panel is included in all accounts. Your MonsterControls panel will be personalized for you with your domain name and weekly website traffic stats. To access the one on your domain go to:
http://yourdomain.com/cgi-bin/monstercontrols
NOTE: Due to the unique security requirement of the administration system you must have you browser set to allow cookies. This, in conjunction with a number of hidden verification systems assures you are the only user allowed to access these features on your domain.
Adding POP (email) accounts: - Login: Enter the account name here.
Example: If you want "bob@yourdomain.com", just enter "bob" into the login field. - Password: Enter the password you would like for that account.
- Directory: Leave this field blank.
Email Redirects : Email Redirects are used to redirect email from one address to another. For example, you might have sales@yourdomain.com automatically redirected to your sales person’s personal email address, and support@yourdomain.com redirected to your support person’s personal email address, and so on. You may also have redirects set up to send email to more than one address. For example, you may have all email addressed to support@yourdomain.com redirected to all of the members of your support staff. You may have as many redirects as you like, and with MonsterControls, setting them up is as simple as filling in the blanks. Once you've logged into your MonsterControls, select the Email Redirects button from the panel menu. - Address: Enter the name or title portion of the address only. For example, sales or info
- Forward To: Enter the FULL valid email address that you want the email forwarded to. For example, joe@elsewhere.com (Type carefully. If you make an error the email will be forwarded to an incorrect email address)
- Also Forward To:If applicable, enter the FULL valid email address of others you want this email to go to. For example, jack@overthere.com
- Edit: To edit your existing redirects, simply change the information in the entry fields.
- Add/Edit Redirects: You MUST click this button to Save your changes.
Things to know: - If you remove the default email address, email will only be redirected to the specific aliases listed. For example, if an email is sent to help@yourdomain.com and you have not listed "help" as an alias, the email will not be redirected. You will then need to log into your domain POP account to retrieve it.
- If you prefer to log directly into your domain POP account to retrieve email and do not wish to have any redirected, then simply remove the default email address.
Simple Autoresponders Simple autoresponders are used to send automatic responses to email sent to a specified address in your domain. For example, you might indicate on your web page that a visitor should write to prices@yourdomain.com for a current price list. Then set up an autoresponder with a message listing your prices. When an email is sent to prices@yourdomain.com, the price list is sent in response automatically. You may have as many autoresponders as you like. To set them up with your MonsterControls select the Simple Autoresponders button from the panel menu. - Address: Do not add yourdomain.com to this. Enter only the name or title, such as prices or info.
- Message: Type (or copy/paste) your response message here.
- View/Edit Autoresponders: Select this button to view and/or edit existing autoresponder messages.
- Add Autoresponder: You MUST click this button to SAVE your changes or to add a new autoresponder.
- NOTE: An autoresponder can not have the same name as a POP account.
Maillists Maillists are a very popular way for people to send and receive information of a particular type. For example, you might wish to add all of your customers to a mail list, then notify them all of upcoming sales or specials with just one email flyer. To set up Maillists with your MonsterControls select the Maillists button from the panel menu. - New Maillist: To create a new mail list, select New Maillist and type in a name for your new maillist. You may name it whatever you like but do not enter an extension.
- Edit Maillist: To edit an existing maillist select Edit Maillist, then select the maillist you wish to edit from the pop-up menu.
- Delete Maillist: To delete an existing maillist, select Delete Maillist, then select the list you wish to delete from the pop-up menu. (Deletions are permanent and cannot be reversed or undone).
- Add/Edit/Delete: Once you've selected your action, click on this button to put it into effect.
- Add: If you selected New Maillist you will now have a page with entry boxes for email addresses. When you are finished adding addresses to your list be sure to click on the Add to List button to add your entries to your new list.
- Edit: If you selected to Edit Maillist, the maillist you chose will now be displayed for you to edit. When you are finished editing your list be sure to click on the Edit Maillist button to save your changes.
- Delete: If you selected to Delete Maillist, the maillist you chose will now be deleted.
Subscribable Maillists A subscribable maillist is one that people may join on their own, without the need for you to manually enter their email address. Subscribable maillists are generally focused on a particular topic of interest, such as programming, science fiction, or coin collecting. When one member of the list sends an email to the list, all members of the list get a copy. Note: Only emails of 75KB or less can be sent to the subscribable maillist. To set up Subscribable Maillists with your MonsterControls select the Subscribable Maillists button from the panel menu. - Email Address to Subscribe: This is the address people will email to join your list. You need simply add a note to your web page such as "to subscribe to this maillist send email to anyname@yourdomain.com". You may use any name you like, but it should be different than the name you give the list itself. Enter only the name or title, such as join or info.
- Name Of Maillist:This may be whatever you like but should not be the same as the name one must email TO to subscribe.
- Message Subscribers Receive: This is the message new subscribers will receive to confirm their subscription.
- View/Edit Subscribable Maillists: Use this option to view or edit an existing maillist.
- Edit or Delete: Select the function you wish to perform for a particular list. Remember, deletions are permanent and cannot be reversed or undone.
- If you select to Edit a list, the current message and members of the list will be displayed for you. You can add or delete members from the list and edit the confirmation message. When you are finished editing your list be sure to click on the Edit Subscribable Maillist button to save your changes.
Password Protect Directories You may password protect any directory on your website. You may also use this function to authorize new users to have access to your directories. - Directory: This will contain all of the directories you currently have.
- Authname:If you are protecting a directory for the first time use Authname to personalize the protection warning. If you are adding new users Authname is not used.
- Username: Enter username
- Password:Enter password
- Protect Directory: Click this button if you are password protecting a directory.
- Add Additional User: Only click this button if you are adding a new user.
- Show/Delete Users from Directory:Use this option to view or edit users.
View Logins: This function will display all logins to your website. Edit Website: This function allows you to edit your website using only your web browser. You will find clear instructions for use on the control panel. Some of the functions available are: - View, Edit, Create, and Delete files and directories
- Browser directories
- Rename files
- Move files
- Upload files
- Set Permissions on files and directories
- Execute Shell Commands
ADDONS
Miva Merchant 4.0
Miva Merchant 4.0 is the latest upgrade to the award winning Miva Merchant Store. (The upgrade can be bought through us for $99.00, this price does include free installation. Note that if you received an email from Miva about the 4.01 upgrade License being free that there will be no charge from us for the License.)
Miva Merchant 4.0 basic setup instructions for new and upgraded installations are included below. We will place the proper files after you purchase a license on your domain, this is generally done within 12 hours of purchase.
Upgrade instructions: Important note: When upgrading Merchant do not use Netscape 4.0 or older browsers as they tend to crash during the upgrade. Either use Internet Explorer or a later version of Netscape.
For upgrades from previous versions of Miva Merchant use the following URL to complete the upgrade: http://www.yourdomain.com/cgi-bin/miva?Merchant2/upgrade.mv rather than the steps below.
Please note that upgrading from Merchant 1.xx will require importing the old store rather than using the upgrade.mv URL above.
New installation instructions: To start using Miva Merchant 4.0 follow the steps below using your browser
Go to http://your-domain.com/cgi-bin/miva?Merchant2/setup.mv Fill in the information, you will need a valid license number to proceed After filling in the basic information, you will be asked to verify paths.- URL to Miva Merchant:
http://www.your-domain.com/cgi-bin/miva?Merchant2/merchant.mv+
- Secure URL to Miva Merchant:
https://machine.site-secure.net/cgi-bin/smiva?userid/Merchant2/merchant.mv+
- Secure URL to Miva Merchant Administration:
https://machine.site-secure.net/cgi-bin/smiva?userid/Merchant2/admin.mv+
- Base URL for Graphics:
http://www.yourdomain.com/Merchant2/ - Secure Base URL for Graphics:
https://machine.site-secure.net/userid/Merchant2/ - Root Directory for Modules:
/Merchant2/ - Secure Root Directory for Modules
/userid/Merchant2 Note: in the secure calls above, machine must be replaced with the name of the server that you're located on and userid is your domain name without the extension (.com).
Configuring Merchant to use the LinkPoint API In Merchant 4.0 the CSI Digital Certificate is entered directly into Merchant using the admin URL.
Use the admin URL: http://domain.com/cgi-bin/miva?Merchant2/admin.mv+
Click on the arrow next to "Stores", then on "Payment Configuration", then on Cardservice/LinkPoint Payment Gateway.
Use the following info which you received from Card Services International:
Store Name: 6 digit number that CSI supplied (Customer ID) Server: secure.linkpt.net Port: 1139 Digital Certificate: Supplied by CSI. Copy the whole thing into the box. Should start with -----BEGIN RSA PRIVATE KEY----- and end with -----END CERTIFICATE-----
Miva Order
Miva Order is a single page fully web administered shopping system (You must purchase a license to use it). Miva Order basic setup instructions We will place the proper files after you purchase a license on your domain, this is generally done within 12 hours of purchase. To start using Miva Order follow the steps below using your browser - Goto http://your-domain.com/cgi-bin/miva?Order/setup.mv
- Fill in the information, you will need a valid license number to proceed
- After filling in the basic information, you will be asked to verify paths.
- URL to Miva Order:
- http://your-domain/cgi-bin/miva?Order/order.mv+
- Secure URL to Miva Order:
- https://machine.site-secure.net/cgi-bin/smiva?userid/Order/order.mv+
- Secure URL to Miva Order Administration:
- https://machine.site-secure.net/cgi-bin/smiva?userid/Order/admin.mv+
- Base URL for Graphics:
- http://www.yourdomain.com/Order/
- Secure Base URL for Graphics:
- https://machine.site-secure.net/userid/Order/
Note: in the secure calls above, machine must be replaced with the name of the system your located on Using http://yourdomain.com/cgi-bin/miva?Order/admin.mv+ URL click on the arrow next to Modules, then on Module Paths and change to the following: Secure Root for Modules: /userid/Order/
Java Chat / Volano Chat
We provide your choice of Basic Java Chat or Volano Chatprograms for use on your domain. Extra charges apply for use of this feature. See our fee schedule for pricing. Examples of these chat programs can be found on our site located within the "Site Map" key on the navigational bar above. If you have applied for Chat, look on your website for a chat directory. It will already be configured for your server. To join the chat, with your browser, go to:
http://www.yourdomain.com/chat
The page can be customized, but leave all the tags alone that have to do with <APPLET CODE>. These rooms are capable of upto 50 users at one time.
Microsoft Front Page Extensions
After you have built your html documents and are ready to upload them to our server: 1. Open the web you've created on your PC using FP Explorer. 2. Choose File > Publish 3. If your "Destination Web Server" doesn't appear in the Publish window (it won't the first time you publish to our server) CHOOSE "More Webs" and type the location of the web to publish to. Hit return. IMPORTANT: Use www.yourdomain.com as the Destination Web Server to publish to our server. Leave the "Destination Web Name" BLANK. 4. You will be asked for your USERNAME and PASSWORD. This is your domain's USERNAME and your FrontPage PASSWORD (which may be dfferent than your regular telnet/ftp/POP password). If you're not sure what it is or if you aren't allowed past this point, you'll need to contact us for a new FP password. 5. You can watch the progression of the upload by looking at the bottom left corner of FP Explorer.
Opening an Existing Web - 1. Open FP Explorer and choose File > Open Front Page Web.
2. You can now choose to open a previously created web on your PC or your web on our server. 3. Highlight the appropriate web or type in the web address (www.yourdomain.com) and click OK. 4. Enter your USERNAME and FP PASSWORD if required. 5. Make modifications and recalculate links if needed (See FP help docs for info on when it's neccessary to recalculate links). Troubleshooting Common Problems with FP98 Getting error - "Root Web Busy" FTP or telnet to your site and remove the "service.lck" file in /www/_vti_pvt. This usually happens when an FP session is interrupted before completion.
Server timing out when publishing large sites. This difficulty arises when the uploading link times out in the process of copying the web to our server. The only suggestion Microsoft has offered so far is to break the main web into a group of sub webs on your PC, then upload these individually. If this problem persists for you, please contact support.
Getting Error - "Front Page Extensions not Installed" We often see this error being reported even when the extensions have been installed. If you get this error, please contact support and we'll make sure the extensions are installed and repair them if necessary. NOTE: The extensions are easily corrupted. Please use only FP Explorer to update your web site on the server, not FTP.
I published but my web's not there! This will happen when the "Destination Web Name" is filled in when publishing to our server. This box should be left blank. If you put any other name in this box it will create a subdirectory off of your root web and copy all of your files into it. Your site will exist under a subdirectory instead of at the top level /www where it should be.
My counter, bbs, guestbook, etc. isn't working. These problems are generally due to incorrect permissions on either the directory, file(s) or cgi script(s) that are associated with them. Please don't change the permissions of your files or directories unless you have a specific reason for doing so and you know what effect it will have on your site.
My forms won't work through the Secure Server. The call to a cgi script using the Secure Server must not be within a webbot. Use a normal cgi call in your html script for Secure Server calls.
My search bot doesn't return any results. The /www directory must be world readable AND you need to recalculate links BEFORE publishing (or after editing directly on the server). If it still doesn't work: FTP to the server and go to the /www/_vti_txt/default.wti directory. Delete any files that begin with "ALL.". Don't delete any other files. Then using Windows Explorer, do the same thing on your PC. Recalculate links, test locally with your browser and publish.
FP starts the Web Publishing Wizard when I try to publish. Cancel the operation and contact support to have the FP extensions installed/repaired.
Why is my page renamed on the server when I publish? The "Default Document" of your web is automatically renamed by the server to what is required by the configuration of the server. For example, if you've named the main page "index.html", it may be renamed "default.html". Just check the links to your main page to make sure they refer to it the same way.
NOTE: If you are using FrontPage, you should NEVER use regular FTP to upload your files. This will damage the extensions. Stick with one or the other all the time.
Real Audio/Real Video/G2
Real Audio or Real Audio/Video is including on some accounts and on all others it's available for an extra charge. See our fee schedule for details.
Real Audio is a real time audio transmission/player system. A digital audio stream is transmitted from the server over the Internet to the destination and played immediately, rather than being stored to disk first and then played.
Each audio clip requires two files: a metafile with extension .ram, and the digital audio clip itself, with extension .ra.
The .ram file holds one or more lines of ASCII text, each of which references the .ra file to be played when the .ram file is accessed by the browser.
Entries in .ram files have the form:
rtsp://machine.propagation.net/your-user-name/name-of-clip.ra --stop-- pnm://machine.propagation.net/your-user-name/name-of-clip.ra
"machine.propagation.net" - replace "machine" with the actual name of the server you are on.
Place your .ram and .ra files in the realaudio subdirectory under your web directory. Remember that .ram files must be uploaded in ASCII mode while .ra files must be uploaded in BINARY mode. You may then access these files via a web browser at:
http://www.yourdomain.com/realaudio/file.ram
Miva - HTML Script
Miva makes building dynamic, data driven web pages as easy as HTML. You can quickly develop interactive web pages that are 100% browser independent. Miva runs on the web server, interprets the Miva tags and outputs pure HTML to the browser. You can also use Miva to output Javascript and other browser languages, and use the built-in database to easily manipulate and publish data. Full documentation and usage support for HTML Script can be found at http://miva.com/. Miva offers a variety of features and you should visit their site for more information. We are running version 3.22 of HTML Script. The following is what you will need to know for use on your domain. The script being called is "miva", which is in your cgi-bin. The active pages (pages with .hts or .mv) need to be placed in your root www directory, not in subdirectories. A sample URL call for this would be as follows:
http://yourdomain.com/cgi-bin/miva?yourpage.mv
HTMLSCRIPT has a variety of pre configured products that require path information we have preconfigured miva to automatically look into the www directory for data files, so the following would be used if the data files are in the main directory EXAMPLE:
<export file="file.dat">
To call Htmlscript thru the secure server use the following:
https://machine.site-secure.net/cgi-bin/smiva?yourdomain/yourpage.mv
Machine should be replaced with the name of the system your on, i.e. bob, vermillion, crimson, etc.
Majordomo
Please contact sales for the pricing for majordomo lists if this is not included as one of the features of your account. If you wish to to have it activated, email us and tell us the name you would like for your domain's majordomo listserver. Make sure it has a different name than the name of your domain. For instance if your domain was fredhappy.com, you might want to ask for fredhappydomo. Once we have set up your Majordomo listserver, you can get help by sending email to majordomo@yourdomain.com. On the first line of your email, just type the word HELP. You will be sent a general help file. If you want more detailed instructions on using Majordomo, you can email: For full instructions domo@site-secure.net Another great resource for Majordomo information is: http://www.greatcircle.com/majordomo/majordomo.manual.txt
Additional Users on your Domain
If you have asked for additional POP/FTP/Telnet accesses on your domain, the users of these additional accounts can access the server via FTP, Telnet, and Email with the following parameters:
Hostname: yourdomain.com Username: their unique username Password: their unique password POP Account: their unique username@yourdomain.com SMTP Server: yourdomain.com
When they login via FTP or Telnet, they will be taken to their directory, where they will see their own www directory
MSQL 2.0.3
Mini SQL 2.0 (Beta) Language Specifications
Introduction The mSQL language offers a significant subset of the features provided by ANSI SQL. It allows a program or user to store, manipulate and retrieve data in table structures. It does not support some relational capabilities such as views and nested queries. Although it does not support all the relational operations defined in the ANSI specification, it does provide the capability of "joins" between multiple tables. The definitions and examples below depict mSQL key words in upper case, but no such restriction is placed on the actual queries.
The Create Clause The create clause as supported by mSQL 2 can be used to create tables, indices, and sequences. It cannot be used to create other definitions such as views. The three valid constructs of the create clause are shown below: - CREATE TABLE table_name (
- col_name col_type [ not null ]
- [ , col_name col_type [ not null ] ]**
- )
- CREATE [ UNIQUE ] INDEX index_name ON table_name (
- field_name
- [ , field_name ] **
- )
- CREATE SEQUENCE ON table_name [ STEP step_val ] [ VALUE initial_val ]
An example of the creation of a table is show below: - CREATE TABLE emp_details (
- first_name char(15) not null,
- last_name char(15) not null,
- comment text(50),
- dept char(20),
- emp_id int
- )
The available types are:- | char (len) | String of characters (or other 8 bit data) | | text (len) | Variable length string of chracters (or other 8 bit data) The defined length is used to indicate the expected average length of the data. Any data longer than the specified length will be split between the data table and external overflow buffers.
Note : text fields are slower to access than char fields and cannot be used in an index nor in LIKE tests. | | int | Signed integer values | | real | Decimal or Scientific Notation real values |
The table structure shown in the example would benefit greatly from the creation of some indices. It is assumed that the emp_id field would be a unique value that is used to identify an employee. Such a field would normally be defined as the primary key. mSQL 2.0 has removed support for the primary key construct within the table creation syntax although the same result can be achieved with an index. Similarly, a common query may be to access an employee based on the combination of the first and last names. A compound index (i.e. constructed from more than 1 field) would improve performance. We could construct these indices using :
CREATE UNIQUE INDEX idx1 ON emp_details (emp_id) CREATE INDEX idx2 ON emp_details (first_name, last_name) These indices will be used automatically whenever a query is sent to the database engine that uses those fields in its WHERE clause. The user is not required to specify any special values in the query to ensure the indices are used to increase performance.
Sequences provide a mechanism via which a sequence value can be maintained by the mSQL server. This allows for atomic operations (such as getting the next sequence value) and removes the concerns associated with performing these operations in client applications. A sequence is associated with a table and a table may contain at most one sequence.
Once a sequence has been created it can be accessed by SELECTing the _seq system variable from the table in which the sequence is defined. For example CREATE SEQUENCE ON test STEP 1 VALUE 5 SELECT _seq FROM test The above CREATE operation would define a sequence on the table called test that had an initial value of 5 and would be incremented each time it is accessed (i.e. have a step of 1). The SELECT statement above would return the value 5. If the SELECT was issued again, a value of 6 would be returned. Each time the _seq field is selected from test the current value is returned to the caller and the sequence value itself is incremented. Using the STEP and VALUE options a sequence can be created that starts at any specified number and is incremented or decremented by any specified value. The value of a sequence would decrease by 5 each time it was accessed if it was defined with a step of -5.
The Drop Clause The Drop clause is used to remove a definition from the database. It is most commonly used to remove a table from a database but can also be used for removing several other constructs. In 2.0 it can be used to remove the definition of an index, a sequence, or a table. It should be noted that dropping a table or an index removes the data associated with that object as well as the definition. The syntax of the drop clause as well as examples of its use are given below. DROP TABLE table_name DROP INDEX index_name FROM table_name DROP SEQUENCE FROM table_name for example DROP TABLE emp_details DROP INDEX idx1 FROM emp_details DROP SEQUENCE FROM emp_details
The Insert Clause Unlike ANSI SQL, you cannot nest a select within an insert (i.e. you cannot insert the data returned by a select). If you do not specify the field names they will be used in the order they were defined - you must specify a value for every field if you do this. - INSERT INTO table_name [ ( column [ , column ]** ) ]
- VALUES (value [, value]** )
for example - INSERT INTO emp_details
- (first_name, last_name, dept, salary)
- VALUES (`David', `Hughes', `Development','12345')
- INSERT INTO emp_details
- VALUES (`David', `Hughes', `Development','12345')
The number of values supplied must match the number of columns.
The Select Clause The SELECT offered by mSQL lacks some of the features provided by the standard SQL specification. Development of mSQL 2 is continuing and some of this missing functionality will be made available in the next beta release. At this point in time, mSQL's select does not provide - Nested selects
- Implicit functions (e.g. count(), avg() )
It does however support: - Joins - including table aliases
- DISTINCT row selection
- ORDER BY clauses
- Regular expression matching
- Column to Column comparisons in WHERE clauses
- Complex conditions
The formal definition of the syntax for mSQL's select clause is - SELECT [table.]column [ , [table.]column ]**
- FROM table [ = alias] [ , table [ = alias] ]**
- [ WHERE [table.] column OPERATOR VALUE
- [ AND | OR [table.]column OPERATOR VALUE]** ]
- [ ORDER BY [table.]column [DESC] [, [table.]column [DESC] ]
OPERATOR can be <,> , =, <=, =, <>, LIKE, RLIKE or CLIKE VALUE can be a literal value or a column name Where clauses may contain '(' ')' to nest conditions e.g. "where (age <20 or age>30) and sex = 'male'" . A simple select may be - SELECT first_name, last_name FROM emp_details
- WHERE dept = `finance'
To sort the returned data in ascending order by last_name and descending order by first_name the query would look like this - SELECT first_name, last_name FROM emp_details
- WHERE dept = `finance'
- ORDER BY last_name, first_name DESC
And to remove any duplicate rows from the result of the select, the DISTINCT operator could be used: - SELECT DISTINCT first_name, last_name FROM emp_details
- WHERE dept = `finance'
- ORDER BY last_name, first_name DESC
mSQL provides three regular expression operators for use in where comparisons. The standard SQL syntax provides a very simplistic regular expression capability that does not provide the power nor the flexibility UNIX programmers or users will be accustomed to. mSQL supports the "standard" SQL regular expression syntax, via the LIKE operator, but also provide further functionality if it is required. The available regular expression operators are: - LIKE - the standard SQL regular expression operator.
- CLIKE - a standard LIKE operator that ignores case.
- RLIKE - a complete UNIX regular expression operator.
Note : CLIKE and RLIKE are not standard SQL and may not be available in other implementations of the language if you decide to port your application. They are however very convenient and powerful features of mSQL. The regular expression syntax supported by the LIKE and CLIKE operators is that of standard SQL and is outlined below | `_' | matches any single character | | `%' | matches 0 or more characters of any value | | `\' | escapes special characters (e.g. `\%' matches % and `\\' matches \ ) | | | all other characters match themselves | As an example of the LIKE operator, it is possible to search for anyone in the finance department who's last name consists of any letter followed by `ughes', such as Hughes. The query to perform this operation could look like SELECT first_name, last_name FROM emp_details - WHERE dept = `finance' and last_name like `_ughes'
The RLIKE operator provides access to the power of the UNIX standard regular expression syntax. The UNIX regular expression syntax provides far greater functionality than SQL's LIKE syntax. The UNIX regex syntax does not use the '_' or '%' characters in the way SQL's regex does (as outlined above). The syntax available in the RLIKE operator is | '.' | matches any single character | | '^' | When used as the first charactr in a regex, the caret character forces the match to start at the first character of the string | | '$' | When used as the last charactr in a regex, the dollar sign forces the match to end at the last character of the string | | '[ ]' | By enclosing a group of single characters withing square brackets, the regex will match a single character from the group of characters. If the ']' character is one of the characters you wish to match you may specifiy it as the first character in the group without closing the group (e.g. '[]abc]' would match any single character that was either ']', 'a', 'b', or 'c'). Ranges of characters can be specified within the group using the 'first-last' syntax (e.g. '[a-z0-9]' would match any lower case letter or a digit). If the first charactr of the group is the '^' character the regex will match any single character that is not contained within the group. | | '*' | If any regex element is followed by a '*' it will match zero or more instances of the regular expression. | The power of a relational query language starts to become apparent when you join tables together during a select operation. Lets say you had two tables defined, one containing staff details and another listing the projects being worked on by each staff member, and each staff member has been assigned an employee number that is unique to that person. You could generate a sorted list of who was working on what project with a query like: SELECT emp_details.first_name, emp_details.last_name, project_details.project - FROM emp_details, project_details
- WHERE emp_details.emp_id = project_details.emp_id
- ORDER BY emp_details.last_name, emp_details.first_name
mSQL places no restriction on the number of tables "joined" during a query so if there were 15 tables all containing information related to an employee ID in some manner, data from each of those tables could be extracted, by a single query. One key point to note regarding joins is that you must qualify all column names with a table name. mSQL does not support the concept of uniquely named columns spanning multiple tables so you are forced to qualify every column name as soon as you access more than one table in a single select. mSQL also supports table aliases so that you can perform a join of a table onto itself. This may appear to be an unusual thing to do but it is a very powerful feature if there are rows within a single table relate to each other in some way. An example of such a table could be a list of people including the names of their parents. In such a table there would be multiple rows with a parent/child relationship. Using a table alias you could find out any grandparents contained in the table using something like - SELECT t1.parent, t2.child from parent_data=t1, parent_data=t2
- where t1.child = t2.parent
The table aliases t1 and t2 both point to the same table (parent_data in this case) and are treated as two different tables that just happen to contain exactly the same data.
The Delete Clause The SQL DELETE construct is used to remove one or more entries from a database table. The selection of rows to be removed from the table is based on the same where construct as used by the SELECT clause. The syntax for mSQL's delete clause is DELETE FROM table_name - WHERE column OPERATOR value
- [ AND | OR column OPERATOR value ]**
OPERATOR can be <,>, =, <=, =, <>, LIKE, RLIKE, or CLIKE
for example DELETE FROM emp_details WHERE emp_id = 12345
The Update Clause The SQL update clause is used to modify data that is already in the database. The operation is carried out on one or more rows as specified by the where construct. The value of any number of fields on the rows matching the where construct can be updated. mSQL places a limitation on the operation of the update clause in that it cannot use a column name as an update value (i.e. you cannot set the value of one field to the current value of another field). Only literal values may by used as an update value. The syntax supported by mSQL is UPDATE table_name SET column=value [ , column=value ]**
- WHERE column OPERATOR value
- [ AND | OR column OPERATOR value ]**
OPERATOR can be <,> , =, <=, =, <>, LIKE, RLIKE or CLIKE for example UPDATE emp_details SET salary=30000 WHERE emp_id = 1234
Mini SQL 2.0 (Beta) System Variables
Introduction
Mini SQL 2.0 includes internal support for system variables (often known as pseudo fields or pseudo columns). These variables can be accessed in the same way that normal table fields are accessed although the information is provided by the database engine itself rather than being loaded from a database table. System variables are used to provide access to server maintained information or meta data relating to the databases. System variables may be identified by a leading underscore in the variables name. Such an identifier is not valid in mSQL for table or field names. Examples of the supported system variables and uses for those variables are provided below.
Available System Variables The mSQL 2 engine currently supports the following system variables: _rowid The _rowid system variable provides a unique row identifier for any row in a table. The value contained in this variable is the internal record number used by the mSQL engine to access the table row. It may be included in any query to uniquely identify a row in a table. An example of such queries could be : - select _rowid, first_name, last_name from emp_details
- where last_name = 'Smith'
- update emp_details set title = 'IT Manager'
- where _rowid = 57
The candidate row module is capable of utilising _rowid values to increase the performance of the database. In the second example query above, only 1 row (the row with the internal record ID of 57) would be accessed. This is in contrast to a sequential search through the database looking for that value which may result in only 1 row being modified but every row being accessed. Using the _rowid value to constrain a search is the fastest access method available in mSQL 2.0. As with all internal access decisions, the decision to base the table access on the _rowid value is automatic and requires no action by the programmer or user other than including the _rowid variable in the where clause of the query.
_timestamp The _timestamp system variable contains the time at which a row was last modified. The value, although specified in the standard UNIX time format (i.e. seconds since the epoch), is not intended for interpretation by application software. The value is intended to be used as a point of reference via which an application may determine if a particular row has was modified before or after another table row. The application should not try to determine an actual time from this value as the internal representation used may change in a future release of mSQL. The primary use for the _timestamp system variable will be internal to the mSQL engine. Using this information, the engine may determine if a row has been modified after a specified point in time (the start of a transaction for example). It may also use this value to synchronise a remote database for database replication. Although neither of these functions is currently available, the presence of a row timestamp is the first step in the implementation. Example queries may be: - select first_name, _timestamp from emp_details
- where first_name like '%fred%'
- order by _timestamp
- select * from emp_details
- where _timestamp 88880123
_seq The _seq system variable is used to access the current sequence value of the table from which it is being selected. The current sequence value is returned and the sequence is update to the next value in the sequence (see the CREATE section of the Language Specification section from more information on sequences). An example query using _seq could be - select _seq from staff
_sysdate The server can provide a central standard for the current time and date. If selected from any table, the _sysdate system variable will return the current time and date on the server machine using the standard UNIX time format (e.g. seconds since the epoch). An example query using _sysdate could be - select _sysdate from staff
_user By selecting the _user system variable from any table, the server will return the username of the user who submitted the query. An example query using _user could be - select _user from staff
Mini SQL 2.0 (Beta) C Programming API
Introduction
Included in the distribution is the mSQL API library, libmsql.a. The API allows any C program to communicate with the database engine. The API functions are accessed by including the msql.h header file into your program and by linking against the mSQL library (using -lmsql as an argument to your C compiler). The library and header file will be installed by default into /usr/local/ Hughes/lib and /usr/local/Hughes/include respectively. Like the mSQL engine, the API supports debugging via the MSQL_DEBUG environment variable. Three debugging modules are currently supported by the API: query, api, and malloc. Enabling "query" debugging will cause the API to print the contents of queries as they are sent to the server. The "api" debug modules causes internal information, such as connection details, to be printed. Details about the memory used by the API library can be obtained via the "malloc" debug module. Information such as the location and size of malloced blocks and the addresses passed to free() will be generated. Multiple debug modules can be enabled by setting MSQL_DEBUG to a colon separated list of module names. For example setenv MSQL_DEBUG api:query Query Related Functions msqlConnect() - int msqlConnect ( host )
- char * host ;
msqlConnect() forms an interconnection with the mSQL engine. It takes as its only argument the name or IP address of the host running the mSQL server. If NULL is specified as the host argument, a connection is made to a server running on the localhost using the UNIX domain socket /dev/msqld. If an error occurs, a value of -1 is returned and the external variable msqlErrMsg will contain an appropriate text message. This variable is defined in "msql.h". If the connection is made to the server, an integer identifier is returned to the calling function. This values is used as a handle for all other calls to the mSQL API. The value returned is in fact the socket descriptor for the connection. By calling msqlConnect() more than once and assigning the returned values to separate variables, connections to multiple database servers can be maintained simultaneously. In previous versions of mSQL, the MSQL_HOST environment variable could be used to specify a target machine if the host parameter was NULL. This is no longer the case. msqlSelectDB() - int msqlSelectDB ( sock , dbName )
- int sock ;
- char * dbName ;
Prior to submitting any queries, a database must be selected. msqlSelectDB() instructs the engine which database is to be accessed. msqlSelectDB() is called with the socket descriptor returned by msqlConnect() and the name of the desired database. A return value of -1 indicates an error with msqlErrMsg set to a text string representing the error. msqlSelectDB() may be called multiple times during a program's execution. Each time it is called, the server will use the specified data- base for future accesses. By calling msqlSelectDB() multiple times, a program can switch between different databases during its execution. msqlQuery() - int msqlQuery ( sock , query )
- int sock ;
- char * query ;
Queries are sent to the engine over the connection associated with sock as plain text strings using msqlQuery(). As with previous releases of mSQL, a returned value of -1 indicates an error and msqlErrMsg will be updated to contain a valid error message. If the query generates output from the engine, such as a SELECT statement, the data is buffered in the API waiting for the application to retrieve it. If the application submits another query before it retrieves the data using msqlStoreResult(), the buffer will be overwritten by any data generated by the new query. In previous versions of mSQL, the return value of msqlQuery() was either -1 (indicating an error) or 0 (indicating success). mSQL 2 adds to these semantics by providing more information back to the client application via the return code. If the return code is greater than 0, not only does it imply success, it also indicates the number of rows "touched" by the query (i.e. the number of rows returned by a SELECT, the number of rows modified by an update, or the number of rows removed by a delete). msqlStoreResult() - m_result * msqlStoreResult ( )
Data returned by a SELECT query must be stored before another query is submitted or it will be removed from the internal API buffers. Data is stored using the msqlStoreResult() function which returns a result handle to the calling routines. The result handle is a pointer to a m_result structure and is passed to other API routines when access to the data is required. Once the result handle is allocated, other queries may be submitted. A program may have many result handles active simultaneously. msqlFreeResult() - void msqlFreeResult ( result )
- m_result * result ;
When a program no longer requires the data associated with a particular query result, the data must be freed using msqlFreeResult(). The result handle associated with the data, as returned by msqlStoreResult() is passed to msqlFreeResult() to identify the data set to be freed. msqlFetchRow() - m_row msqlFetchRow ( result )
- m_result * result ;
The individual database rows returned by a select are accessed via the msqlFetchRow() function. The data is returned in a variable of type m_row which contains a char pointer for each field in the row. For example, if a select statement selected 3 fields from each row returned, the value of the 3 fields would be assigned to elements [0], [1], and [2] of the variable returned by msqlFetchRow(). A value of NULL is returned when the end of the data has been reached. See the example at the end of this sections for further details. Note, a NULL value is represented as a NULL pointer in the row. msqlDataSeek() - void msqlDataSeek ( result , pos )
- m_result * result ;
- int pos ;
The m_result structure contains a client side "cursor" that holds information about the next row of data to be returned to the calling program. msqlDataSeek() can be used to move the position of the data cursor. If it is called with a position of 0, the next call to msqlFetchRow() will return the first row of data returned by the server. The value of pos can be anywhere from 0 (the first row) and the number of rows in the table. If a seek is made past the end of the table, the next call to msqlFetchRow() will return a NULL. msqlNumRows() - int msqlNumRows ( result )
- m_result * result ;
The number of rows returned by a query can be found by calling msqlNumRows() and passing it the result handle returned by msqlStoreResult(). The number of rows of data sent as a result of the query is returned as an integer value. If a select query didn't match any data, msqlNumRows() will indicate that the result table has 0 rows (note: earlier versions of mSQL returned a NULL result handle if no data was found. This has been simplified and made more intuitive by returning a result handle with 0 rows of result data) msqlFetchField() - m_field * msqlFetchField ( result )
- m_result * result ;
Along with the actual data rows, the server returns information about the data fields selected. This information is made available to the calling program via the msqlFetchField() function. Like msqlFetchRow(), this function returns one element of information at a time and returns NULL when no further information is available. The data is returned in a m_field structure which contains the following information: | typedef struct { | | | char | * name ; | /* name of field */ | | | char | * table ; | /* name of table */ | | | int | type ; | /* data type of field */ | | | int | length , | /* length in bytes of field */ | | | int | flags ; | /* attribute flags */ | } m_field;
| Possible values for the type field are defined in msql.h as INT_TYPE, CHAR_TYPE and REAL_TYPE. The individual attribute flags can be accessed using the following macros:
msqlFieldSeek() - void msqlFieldSeek ( result , pos )
- m_result * result ;
- int pos ;
The result structure includes a "cursor" for the field data. It's position can be moved using the msqlFieldSeek() function. See msqlDataSeek() for further details. msqlNumFields() - int msqlNumFields ( result )
- m_result * result ;
The number of fields returned by a query can be ascertained by calling msqlNumFields() and passing it the result handle. The value returned by msqlNumFields() indicates the number of elements in the data vector returned by msqlFetchRow(). It is wise to check the number of fields returned before, as with all arrays, accessing an element that is beyond the end of the data vector can result in a segmentation fault. msqlClose() - int msqlClose ( sock )
- int sock ;
The connection to the mSQL engine can be closed using msqlClose(). The function must be called with the connection socket returned by msqlConnect() when the initial connection was made.
Schema Related Functions msqlListDBs() - m_result * msqlListDBs ( sock )
- int sock ;
A list of the databases known to the mSQL engine can be obtained via the msqlListDBs() function. A result handle is returned to the calling program that can be used to access the actual database names. The individual names are accessed by calling msqlFetchRow() passing it the result handle. The m_row data structure returned by each call will contain one field being the name of one of the available databases. As with all functions that return a result handle, the data associated with the result must be freed when it is no longer required using msqlFreeResult(). msqlListTables() - m_result * msqlListTables ( sock )
- int sock ;
Once a database has been selected using msqlInitDB(), a list of the tables defined in that database can be retrieved using msqlListTables(). As with msqlListDBs(), a result handle is returned to the calling program and the names of the tables are contained in data rows where element [0] of the row is the name of one table in the current database. The result handle must be freed when it is no longer needed by calling msqlFreeResult(). msqlListFields() - m_result * msqlListFields ( sock , tableName ) ;
- int sock ;
- char * tableName;
Information about the fields in a particular table can be obtained using msqlListFields(). The function is called with the name of a table in the current database as selected using msqlSelectDB() and a result handle is returned to the caller. Unlike msqlListDBs() and msqlListTables(), the field information is contained in field structures rather than data rows. It is accessed using msqlFetchField(). The result handle must be freed when it is no longer needed by calling msqlFreeResult(). msqlListIndex() - m_result * msqlListIndex ( sock , tableName , index ) ;
- int sock ;
- char * tableName;
- char * index;
The structure of a table index can be obtained from the server using the msqlListIndex() function. The result table returned contains one field. The first row of the result contains the symbolic name of the index mechanism used to store the index. Rows 2 and onwards contain the name of the fields that comprise the index. For example, if a compund index was defined as an AVL Tree index and was based on the values of the fields first_name and last_name, then the result table would look like | row[0] | | avl | | first_name | | last_name | Currently the only valid index type is 'avl' signifying a memory mapped AVL tree.
Mini SQL 2.0 (Beta) Standard Programs and Utilities
The monitor - msql
| Usage | msql [-h host] [-f confFile] database | | Options | -h | Specify a remote hostname or IP address on which the mSQL server is running. The default is to connect to a server on the localhost using a UNIX domain socket rather than TCP/IP (which gives better performance) | | -f | Specify a non-default configuration file to be loaded. The default action is to load the standard configuration file located in INST_DIR/msql.conf (usually /usr/local/Hughes/msql.conf) | | Description | The mSQL monitor is an interactive interface to the mSQL server. It allows you to submit SQL commands directly to the server. Any valid mSQL syntax can be entered at the prompt provided by the mSQL monitor. Control of the monitor itself is provided by 4 internal commands. Each command is comprised of a backslash followed by a single character. The available command are | | | \q | Quit | | | \g | Go (Send the query to the server) | | \e | Edit (Edit the previous query) | | \p | Print (Print the query buffer) |
Schema viewer - relshow
| Usage | relshow [-h host] [-f confFile] [database [rel [idx] ] ] | | Options | -h | Specify a remore hostname or IP address on which the mSQL server is running. The default is to connect to a server on the localhost using a UNIX domain socket rather than TCP/IP (which gives better performance) | | -f | Specify a non-default configuration file to be loaded. The default action is to load the the standard configuration file located in INST_DIR/msql.conf (usually /usr/local/Hughes/msql.conf) | | Description | Relshow is used to display the structure of the contents of mSQL databases. If no arguments are given, relshow will list the names of the databases currently defined. If a database name is given it will list the tables defined in that database. If a table name is also given then it will display the structure of the table (i.e. field names, types, lengths etc).
If an index name is provided along with the database and table names, relshow will display the structure of the specified index including the type of index and the fields that comprise the index. |
Admin program - msqladmin
| Usage | msqladmin [-h host] [-f confFile] [-q] Command | | Options | -h | Specify a remore hostname or IP address on which the mSQL server is running. The default is to connect to a server on the localhost using a UNIX domain socket rather than TCP/IP (which gives better performance) | | -f | Specify a non-default configuration file to be loaded. The default action is to load the the standard configuration file located in INST_DIR/msql.conf (usually /usr/local/Hughes/msql.conf) | | -q | Put msqladmin into quiet mode. If this flag is specified, msqladmin will not prompt the user to verify dangerous actions (such as dropping a database). | | Description | msqladmin is used to perform administrative operations on an mSQL database server. Such tasks include the creation of databases, performing server shutdowns etc. The available commands for msqladmin are | | create db_name | Creates a new database called db_name | | drop db_name | Removes the database called db_name from the server. This will also delete all data contained in the database! | | shutdown | Terminates the mSQL server. | | reload | Forces the server to reload ACL information. | | version | Displays version and configuration information about the currently running server. | | stats | Displays server statistics. | | Note : most administrative functions can only be executed by the user specified in the run-time configuration as the admin user. They can also only be executed from the host on which the server process is running (e.g. you cannot shutdown a remote server process). |
Data dumper - msqldump
| Usage | msqldump [-h host] [-f confFile] [-c] [-v] database [table] | | Options | -h | Specify a remore hostname or IP address on which the mSQL server is running. The default is to connect to a server on the localhost using a UNIX domain socket rather than TCP/IP (which gives better performance) | | -f | Specify a non-default configuration file to be loaded. The default action is to load the the standard configuration file located in INST_DIR/msql.conf (usually /usr/local/Hughes/msql.conf) | | -c | Include column names in INSERT commands generated by the dump. | | -v | Run in verbose mode. This will display details such as connection results etc. | | Description | msqldump produces an ASCII text file containing valid SQL commands that will recreate the table or database dumped when piped through the mSQL monitor program. The output will include all CREATE TABLE commands required to recreate the table structures, CREATE INDEX commands to recreate the indices, and INSERT commands to populate the tables with the data currently contained in the tables. Note : msqldump does not recreate sequences at this time. |
Data exporter - msqlexport
| Usage | msqlexport [-h host] [-f conf] [-v] [-s Char] [-q Char] [-e Char] database table | | Options | -h | Specify a remore hostname or IP address on which the mSQL server is running. The default is to connect to a server on the localhost using a UNIX domain socket rather than TCP/IP (which gives better performance) | | -f | Specify a non-default configuration file to be loaded. The default action is to load the the standard configuration file located in INST_DIR/msql.conf (usually /usr/local/Hughes/msql.conf) | | -v | Verbose mode | | -s | Use the character Char as the separation character. The default is a comma. | | -q | Quote each value with the specified character | | -e | Use the specifed Char as the escape character. The default is \ | | Description | msqlexport produces an ASCII export of the data from the specified table. The output produced can be used as input to other programs such as spreadsheets. It has been designed to be as flexible as possible allowing the user to specify the character to use to separate the fields, the character to use to escape the separator character if it appears in the data, and whether the data should be quoted and if so what character to use as the quote character. The output is sent to stdout with one data row per line. |
Data importer - msqlimport
| Usage | msqlimport [-h host] [-f conf] [-v] [-s Char] [-e Char] [-c col,col...] database table | | Options | -h | Specify a remore hostname or IP address on which the mSQL server is running. The default is to connect to a server on the localhost using a UNIX domain socket rather than TCP/IP (which gives better performance) | | -f | Specify a non-default configuration file to be loaded. The default action is to load the the standard configuration file located in INST_DIR/msql.conf (usually /usr/local/Hughes/msql.conf) | | -v | Verbose mode | | -s | Use the character Char as the separation character. The default is a comma. | | -e | Use the specifed Char as the escape character. The default is \ | | -c | A comma separated list of column names into which the data will be inserted. Note : there can be no spaces in the list. | | Description | msqlimport loads a flat ASCII data file into an mSQL database table. The file can be formatted using any character as the column separator. When passed through msqlimport, each line of the txt file will be loaded as a row in the database table. The separation character as specified by the -s flag, will be used to split the line of text into columns. If the data uses a specific character to escape any occurence of the separation character in the data, the escape character can be specified with the -e flag and will be removed from the data before it is inserted. |
Mini SQL 2.0 (Beta) Run Time Configuration
Introduction
mSQL 1.x offered several configuration options, including such details as the user the server should run as, the location of the TCP and UNIX sockets for client/server communications, the location of the database files etc. The problem with configuring mSQL 1.x was that all these details were hard-coded into the software at compile time. Once the software was compiled and installed you couldn't easily change those settings. To overcome this problem, mSQL 2.0 utilises an external run-time configuration file for definition of all these values. The file is called msql.conf and is located in the installation directory (usually /usr/local/Hughes). An application can choose to use a different configuration file by calling the new msqlLoadConfigFile( ) API function. All standard mSQL applications and utilities provide a command line flag, -f ConfFile , that allows you to specify a non-standard configuration file. When an application first calls the mSQL API library, a check is made to see if a configuration file has been loaded via a call to the msqlLoadConfigFile( ) function. If no such call has been made, the API library loads the default config file. Any values that are specified in that file will over-ride the normal operating paramaters used by mSQL.
Structure of the config file The configuration file is a plain text file organised into sections. The file can contain blank lines and comments. A comment is a line that begins with the '#' character. Each section of the configuration file has a section header, which is written as the section name enclosed in square brackets (for example [ general ]). Currently the only section defined is the general section although further sections covering security and access control will be added later. Configuration values within a section are presented using the config parameter name followed by and equals sign and then the new value. There can only be one entry per line and if an entry is defined multiple times in the one config file the last value defined will be used. If a parameter is not defined in the config file then an internal default value will be used at run-time.
Elements of the General section The following configuration parameters are available in the general section of the config file. Please note that %I may be used in configuration entries to signify the mSQL installation directory (e.g. /usr/local/Hughes). | Parameter | Default Value | Definition | | Inst_Dir | /usr/local/Hughes | The full path to the installation directory. This is the directory in which all the mSQL files are located (such as the program files, the database files etc). | | mSQL_User | msql | The user that the mSQL server should run as. If the server is started by a user other than this user (e.g. it is started as root from a boot script) it will change UID so that it runs as the specified user. | | Admin_User | root | The user that is allowed to perform privileged operations such as server shutdown, cration of databases etc. | | Pid_File | %I/msql2.pid | The full path of a file in which the PID of the running mSQL server process will be stored. | | TCP_Port | 1114 | The TCP port number on which the mSQL server will accept client/server connections over a TCP/IP network. If this value is modified it must be modified on the machine running the client software also. | | UNIX_Port | %I/msql2.sock | The full path name of the UNIX domain socket created by the mSQL server for connections from client applications running on the same machine. |
Example configuration file Below is a sample configuration file. This file does not achieve anything as it just sets the parameters to their default values.
# # msql.conf - Configuration file for Mini SQL Version 2 # #-------------------------------------------------------------- # # This file is an example configuration and may require # modification to suit your needs or your site. The values # given are the default values and will be used by the # software if either this file is missing or a specific value # is not specified. # #--------------------------------------------------------------
[general]
Inst_Dir = /usr/local/Hughes mSQL_User = msql Admin_User = root Pid_File = %I/msql2.pid TCP_Port = 1114 UNIX_Port = %I/msql2.sock
|
GUIDE TO THAT’S AN ORDER LE SETUP, ADMIN OPTIONS AND SHOPPING
Introduction
Welcome to That’s An Order LE. This guide will walk you through the setup, administrative and shopping features of That’s An Order LE. Using That's An Order LE you will be able to add 25 products, state tax rates, shipping methods and rates, and product options including sizes, colors, a description and image using the following step by step setup process. Once the setup is complete you will be able to edit any of the features you setup using the Admin Options area at:
Setup Store
Finally, when you have configured That's An Order LE for your preferences, you can view your online store at:
http://www.supportteam.net/cgi-bin/thatsanorder_LE
That’s An Order LE Setup
To begin setup of That's An Order LE, point your browser to:
http://supportteam.net/cgi-bin/thatsanorder_LE.setup
Step 1. Set Tax Rate The first step is setting a tax rate. You need to select the state that you will be charging tax in, and then enter the rate in decimal format (i.e., a 6% tax rate should be entered as .06) If you are not going to charge sales tax for any state, check the box for "No Tax For Any State". Note: You must click this box to proceed without entering a tax rate. If you try to proceed with out checking the box you will encounter a Warning Error telling you to enter a tax rate for selected state. At this point, use your browser’s " ;back" button to return to the Step 1. screen and check the "No Tax For Any State" box. If you need to charge sales tax in more than one state, click the "Add Additional Tax Rate" button and follow the same directions for adding the first state and tax rate. For more states and tax rates, continue clicking the "Add Additio nal Tax Rate" button after entering each state and tax rate. There is no limit to the number of rates you can add. Note: If you add the same state twice with different tax rates you will encounter a Warning Error. You will be able to add or delete tax rates in the administration area after you have completed That’s An Order LE setup. When you have added all the state tax rates that you need, click the "Go To Step 2" button.
Step 2. Set Shipping Rates The second step is setting the way in which any shipping costs will be charged, and entering the specific shipping rates for each method of shipping. First choose from the list of four shipping charge options by clicking on the appropriate option button. Click the "Enter Rates" button.
Figure shipping costs per item ordered If you are going to figure shipping costs per item ordered, you will be prompted to enter the type(s) of shipping you will have available (e.g., ground, air, express) and the shipping charge per each item ordered that is cor related with it. In the column titled "Type of Shipping" enter one shipping method in each box numbered 1-5 as you want it to appear to your customer. In the column titled "Shipping Charge Per Each Item Ordered" enter the shipping charge per each i tem ordered. That's An Order LE will automatically display it in dollars and cents format. If you have more than 5 types of shipping, click the "Add Additional Shipping Rates" button, and add the types of shipping and shipping charge per each item ordered in the same way as 1-5. There is no limit to the number of rates you can add. When you have entered the type(s) of shipping you want, click the "Go To Step 3" button.
Figure shipping costs based on total amount of order If you are going to charge for shipping based on the total amount of the order, you will be prompted to enter the type(s) of shipping you will have available (e.g. ground, air, express) and the shipping charge for amounts b etween two total amounts. In the column "Type of Shipping" enter one shipping method in each box numbered 1-5 as you want it to appear to your customer. In the column titled "Total Charge is Between These Amounts", enter a low and high total charge value to define a range for the corresponding shipping charge. For example, if you are charging a $2 shipping rate for totals between $1 and $10, enter 1 in the first box and 10 in the next box, followed by $2 in the shipping rate box. Be careful not to overlap values. In this example, use $10.01 for your next low value, $20 for your next high value, $20.01 for your next low value, and $30 for your next high value, and so on. In the column titled "Shipping Charge" enter the shipping charge for each total charge. That's An Order LE will automatically display it in dollars and cents format. If you have more than 5 types of shipping, click the "Add Additional Shipping Rates" button, and add the additional information in the same way as 1-5. When you have entered the type(s) of shipping you want, click the "Go To Step 3" button. Note: If you encounter a Warning Error after entering the shipping rates, carefully read the warning message and use your browser’s back button to return to the Step 2. page to correct your error.
Figure shipping costs based on a percentage of the total amount of order. If you are going to charge for shipping based on a percentage of the total order, you will be prompted to enter the type(s) of shipping you will have available, and the corresponding percentage of the total amount of the order that will equal the s hipping cost. In the column "Type of Shipping" enter one shipping method in each box numbered 1-5 as you want it to appear to your customer. In the column titled "Percentage of Total Amount of Order" enter the percentage of the total amount of the purchased order that will equal the shipping charge for the order. Enter the percent in decimal form (e.g., enter 6% as .06).
Do not charge for shipping If you are not going to charge for shipping, click the "Do not charge for shipping" option button , followed by the "Enter Rates" button, to continue to Step 3.
Step 3. Upload Header File The third step is uploading a header file from your files, or a disk. The header file will be used to create a header at the top of each page in your store, check out area and order form. This file may contain an image. I f so, the image must be in the format: <img src= "/image_dir/image_name.gif"> You can add the width and height parameters, but it is required that you use a relative path and quotes or images will not display correctly on the secu re server. To select your header file, click the "Browse…" button to search for the file on your computer or a disk. When you find the header file click the "Open" button or double click on the header file to enter it in the box. When you have entered the header file, click the "Go To Step 4" button to continue.
Step 4. Upload Footer File The fourth step is uploading a footer file from your files, or a disk. The footer file will be used to create a footer at the bottom of each page in your store, check out area and order form. This file may contain an image. If so, the image must be in the format: <img src= "/image_dir/image_name.gif"> You can add the width and height parameters, but it is required that you use a relative path and quotes or images will not display correctly on the s ecure server. You may want to use a file that contains your company's name, address, email, URL, phone number, and other general information. To select your footer file, click the "Browse…" button to search for the footer file on your computer or a disk. When you find the footer file click the "Open" button or double click on the footer file to enter it in the box. When you have entered the footer file, click the "Go To Step 5" button to continue.
Step 5. Product Information The fifth step is selecting the information you want displayed with a specific product. In addition to displaying the product’s name and price, you have the option of displaying image(s), size(s), color(s), and a descr iption. If you wish to display any or all of these parameters click the "Yes" option button next to the parameter you desire. Click the "No" option button next to a parameter you do not want displayed. Note: That’s An Order will support any image that can be viewed in an HTML document (.jpg, .gif, etc.) If you wish to display one of the parameters for some products, but not all, you must click the "Yes" option button, and later choose to omit or include it when you are entering your products. Note: Deciding which parameters to display will decide the format of the product pages in your store. Choosing all the parameters will format each page to display all parameters, whether you want to display it for each individual product or not. For example, if you choose to display an image, and you don’t have images for all your products, there will be an empty space instead of an image for those products that you don't have images for. When you have chosen the parameters you wish you include, click the "Continue" button.
Step 5 (continued). Product Sizes To enter the available size(s) of your products ,enter one size per line in the box. If you have products that are not offered in the same size(s) enter the available sizes in the box. You will have a chance later to c hoose which product is offered in which size(s). For example, if you sell both cars and T-shirts, a car may be offered in "2-doors" and "4-doors", while a T-shirt may be offered in "small", "medium", and "large". In this case, enter 2-door, 4-door, s mall, medium, and large on separate lines in the box. Note: Entering all available sizes in the setup process creates a checkbox for each size. This will save you from having to type them in later for each individual product when you are adding products in the Admin Options area. If your product does not come in different sizes, i.e. it only comes in one size, you may want to enter any size information in the description of the product. When you have entered all of the available sizes, click the "Enter Sizes" button to continue. Note: Don’t worry if you forget a size or enter a size that is not available. You will be able to edit sizes when you enter your products.
Step 5 (continued). Product Colors To enter the available product color(s), enter one color per line in the box. If you have products that are not offered in the same color(s), enter the available colors in the box. You will have a chance later to choose wh ich product is offered in which color(s). For example, if you sell both cars and T-shirts, a car may be offered in "silver", and "cherry red", while a T-shirt may be offered in "red", "blue" and green". In this case, enter silver, cherry red, red, blue, and green on separate lines, in the box. Note: Entering all available colors in the setup process creates a checkbox for each color. This will save you from having to type them in later for each individual product when you are adding products in the Admin Options area. If your product does not come in different colors, i.e. it only comes in one color, you may want to enter any color information in the description of the product. When you have entered all of the available colors, click the "Enter Colors" button to continue. Note: Don’t worry if you forget a color or include a color that is not available. You will be able to edit colors when you enter your products.
Step 6. Server Information In order for your online store to work correctly in secure mode (SSL), which safeguards your customers' orders, you must enter your server name. In the box provided enter the name of the machine (computer) that you were given when you signed up for your server. When you have entered the machine name, click the "Go To Step 7" button to continue.
Step 7. Upload Email Text for Customer Email When your customer places an order, they will receive an email confirming their order. You need to enter a file that will appear in the email the customer receives after placing an order. This is a regular text file (not H TML), and should include your contact information, return policy, etc. All line breaks and other formatting will show as you have created it. The actual order information will appear below this text. To select your email text file, click the "Browse" button to search for the file on your computer or a disk. When you find the file, click the "Open" button or double click on the file to enter it in the box. To continue click the "Go to Step 8" button.
Step 8. Admin Information In Admin Information you have the opportunity to enter an email address, username, password, and store name for your online store. The email address you type is the one that will receive the order emails from your customers . Your username and password are what you will use to enter into the admin info editing area to change product information. The name of the store is what customers will see as the name of the online store when they receive order confirmation emails. Enter the appropriate information in the boxes provided and click the "Complete Set Up" button to complete That’s An Order LE setup. Remember to record your username and password in a safe place.
That’s An Order LE Administrative Functions
In order to add products, edit product information, and perform other administrative functions in your online store, go to:
http://supportteam.net/cgi-bin/thatsanorder_LE.setup
Enter your username and password in the boxes provided. Click the "Login" button. If you forgot your password, click the "Forgot Password" button and follow the directions on the screen for retrieving your username and password. To obtain your username and password off your server, you must be able to telnet to your server.
Add Product To add a product to your online store, in Admin Options, scroll to "Add Product" and click the "Go!" button. In the Add Product page, you will be able to fill in boxes for Product Name, Price, Description, Product Image, Available sizes, Additional Sizes, Available Colors, and Additional Colors. Note: You will only see image, size, color and description opt ions, if you chose to display those options in Step 5. of That’s An Order LE setup. Enter each parameter as you want it to appear to your customer in the online store. To select the available sizes and colors for the given product, check the check box next to the desired color(s) or size(s). Adding additional colors or sizes will add additional checkboxes to be available the next time you add a product. When you are finished adding the product click the "Add Product" button to return to the Admin Options page. To add more products, scroll to "Add Product" and click the "Go!" button.
Edit/Delete Product Note: To edit or delete a product, you must first add a product to the database. If you wish to edit product information or delete a product information, in Admin Options, scroll to Edit/Delete Product and click the "Go!" button. You will see a screen with a list of the products you have added to your store in the column titled "Product Name", and a column titled "Delete" containing check boxes. To delete a product check the box next to it in the "Del ete" column and click the "Delete Products" button. To edit a product, click the name of the product to get to the edit product page. In the Edit Product page, make any desired changes to the product information, then click the "Edit Product" button to return to the Admin Options page.
Edit/Delete Tax Rates To edit or delete a tax rate, in Admin Options, scroll to "Edit/Delete Tax Rates" and click the "Go!" button. You will see a list of the current states and tax rates that you have entered. To make any desired changes, click on the boxes and either scroll to desired state, or enter a new tax rate. To delete a tax rate, delete the rate next to the state. To add a tax rate, enter a rate and choose a state in the blank spaces provided. When you have made the desired changes, click the "Edit/Delete Tax Rates" button to return to the Admin Options page.
Edit/Delete Shipping Rates To edit or delete the way in which you charge for shipping, or the shipping rates, in Admin Options, scroll to "Edit/Delete Shipping Rates" and click the "Go!" button. You will see the four shipping rate options listed with option buttons next to them. To change the way in which you charge for shipping, click on the option button next to the method you want to use. To make the change and return to the Admin Options page, click the "Edit/Delete Shipping Rates". Note: If you change the type of shipping it will delete all rates and you'll have to enter new rates or none will appear in your online store. To edit shipping rates, click the underlined text next to the option button that you have selected. Make any desired changes in the boxes provided. You can add up to 4 shipping rates by typing values in the boxes. You can delete shipping rates by c learing the values in the boxes. Click the "Edit Shipping" button to return to the Admin Options page.
Edit Admin Information To change your admin email address, username, password, or store name, in Admin Options, scroll to "Edit Admin Information" and click the "Go!" button. In the displayed boxes you will see the current admin information. To make any desired changes, click the appropriate box, delete the current information, and type in any changes. Note: All fields are required. Click the "Edit Admin Information" button to make the changes and return to the Admin Options page.
Edit Product Information To change the information categories that are displayed for each product, in Admin Options, scroll to Edit Product Information and click the "Go!" button. To change what information is displayed about products, select either "Yes" to display or "No" to hide "Images", "Sizes", "Colors", and "Descriptions". Click the "Edit Product Informatio n" button to make the changes and return to the Admin Options page. If you changed either size or color from a "No" to a "Yes", you will need to add at least one size or color as detailed in Step 5 of setup "Product Sizes" and "Product Colors". To edit the actual images, sizes, colors or descriptions, click on the underlined text next to the option buttons and then edit the information in the boxes provided. Click the button at the bottom of the screen to make the changes and return to the Admin Options page.
Upload New Header/Footer/Email Files To change your header, footer or email files, in Admin Options, scroll to "Upload New Header/Footer/Email Files" and click the "Go!" button. Note: The boxes displayed are blank. If you enter any new information in them, your previously entered information will be overwritten. Leaving the boxes blank will keep the previously entered file(s) intact. To enter a new header, footer or email file click in the appropriate box. and click the "Browse…" button to search for your file on your computer or a disk. When you find the file, click the "Open" button, or double click on it to enter it into the box. When you have made all desired changes, click the "Overwrite Files" button to return to the Admin Options page.
Edit Machine Name To edit your machine name, in Admin Options, scroll to "Edit Machine Name" and click the "Go!" button. In the box provided you will see the current machine name displayed. To change it, delete the current name and retype the new name. Click the "Edit Machine Name" button to make the change and return to the Admin Options page.
Delete Current Setup File and Start New Setup Warning! This will delete all files associated with That’s An Order LE, including images, files, product information and all setup options. If you wish to delete all previously entered setup information, in Admin Options, scroll to "Delete Current Setup File and Start New Setup" and click the "Go!" button. You will see a Delete Warning, and two buttons. If you wish to continue to delete the current setup, click the "Continue Delete Setup" button. If you do not wish to continue deleting setup, click the "Cancel Delete" button. If you press the "Continue Delete Setup" button, follow setup Steps 1-8 as outlined above.
Viewing Your Online Store
Once you setup That's An Order LE the way you want it to appear to your customer, you can test out your online store. Go to:
http://supportteam.net/cgi-bin/thatsanorder_LE
You can now shop in your store as if you are a customer.
Please note the following about the checkout process: - The customer has the option of secure (SSL) or regular checkout. Secure checkout will ensure that orders are not viewed by outside parties.
- That's An Order LE creates a unique order number for each order made.
- Certain information (quantity, size, color, state, and shipping method) is required when placing an order.
- Certain fields (first name, last name, address, day phone, credit card number, and cardholder's name) are required of the customer when filling out the online order form.
- The order form checks the validity of the credit card number and the expiration date however, it is still possible that the card is not good.
- The final total including tax and shipping is displayed to the customer before the order is finalized.
- When the customer completes their order a message thanking them for shopping at your store and informing them that they will receive an order confirmation via email is displayed.
Other things to note about That's An Order LE: - That's An Order LE creates an email database which can be used for sales, mailings, etc. It can be found at:
http://supportteam.net/thatsanorder/secure/email.db - That's An Order LE creates a master backup file which will store all order information, except for credit card numbers, for security reasons. It can be found at:
http://supportteam.net/thatsanorder/secure/master.db Tech Notes: - The program does not allow " around the product name, they will be changed to '
- A # sign is not allowed in the product name, and will be removed by the script if added.
- All products will automatically display in alphabetical order.
W:MAIL
Attaching a File to an Outgoing Email Message
To attach a file to an outgoing Email Message simply click on the Browse Button in the Attachments Area of your Message Screen. Select the file to attach and then click on the attach button. You must be using a Browser that supports File Uploading to utilize this feature.
Checking for New Mail
To check for new mail in your W:Mail Account simply click on the Inbox Icon in the W:Mail Menu. This will refresh the Inbox by checking for any new messages on the Mail Server.
Composing Mail
To compose an Email Message using your W:Mail Account simply click on the Compose Button in the W:Mail Menu. The Compose Message screen provides inputs for the recipients Email address, CC Addresses, Attachments, the message Subject, and the body of the message. Once the mail message has been composed simply click on the Send Now Button to send your Email Message.
Delete E-mail Messages
To delete an Email message from your Inbox or any other User Folder simply select the message by ticking the tick-box next to the message you wish to delete. Once you have selected the message (or messages) you wish to delete simply select the Trash Folder in the "Move to" Selector and click the "Move to" Button.
Using the Filter Manager
W:Mail features a Filter Manager which can filter new mail arriving into your W:Mail Account. You can specify up to a maximum of 5 Email Filters. To activate a new filter simply click the "Add Filter" Button in your Filter Manager. To create the filter you will need to nominate which Message Field you want to apply the filter to, the text to search for in the nominated field, and an action to take if a message matches the rule. Actions can be either to trash the message or move it into one of your personal folders
Using the Folder Manager
The Folder Manager allows you to Add, Delete, or Rename Personal Mail Folders. To Add a new folder simply type in the name of the new folder and press the Create Button. To Delete a folder simply select the folder in the list of activated folders and press the Delete Folder Button. To modify (rename) an existing Folder simply select the folder to rename, type in a new name for the folder, and click the Rename Button.
Forward an Email Message
To Forward an Email message from your W:Mail Account simply open the message viewing Window by clicking on the messages subject. At the bottom of the Message screen you will find a "Forward" Button which when clicked will open up the Compose Message Window with the quoted Message. You will need to supply the recipients Email Address, a subject, and you may also want to attch a file to the outgoing message. Once you have completed the message simply click the "Send Now" Button to send the Forwarded Email Message.
Move to Folder
To move a Message to another Folder simply select the message by clicking the tick-box next to the message (or messages) you wish to move. Select the folder you wish to move them to and then press the "Move to Folder" Button to complete moving the selected message into the desired Folder.
Open Folder
To open a Personal Message Folder simply select the Folder the Open Folder Selector and then Press the "Open Folder" Button. This will display the Personal Folder along with a list of the messages the Folder contains.
Options
The Options Icon in the menu gives you access to some of your W:Mail Accounts various features including: a Contact Manager, Folder Manager, Filter Manager, and the Mail Account Setup facilities for your Signature and Real Name.
Reading an E-mail Message
To read an Email Message simply click on the subject of the message you want to read. This will open the message reading Window which will contain the Email Message and any attachments that were included with the Email Message.
Replying to a Message
To Reply to an Email message from your W:Mail Account simply open the message viewing Window by clicking on the messages subject. At the bottom of the Message screen you will find a "Reply" Button which when clicked will open up the Compose Message Window with the quoted Message. You will need to supply the message body, and you may also want to attach a file to the outgoing message. Once you have completed the message simply click the "Send Now" Button to send the Replied Email Message.
Signature File
The signature File can contain any information or text that you would like to attach to the bottom of each Email message you send using your W:Mail Account.
Using the Contact Manager
Access to your Personal Contact Manager can be found by clicking on the Options Icon in the W:Mail menu. Inside the Options Menu you will find a Contact Manager Icon which gives you access to Add, Modify, or delete Contacts.
VISITORBOOK PRO!
Introduction
Welcome to VisitorBook Pro and congratulations on owning the best guestbook system around! At Command-O Software, we're confident that VisitorBook Pro is the best guestbook software around: it's packed with features, has a cool but useful interface, and is supported by a great manual and staff, should you need us!
By now, you've expanded the VBPro files and may have already started tinkering with it a bit. This manual will take you through the entire process of running a VBPro system: from getting it running to creating and maintaining new books.
From here, continue to the next section of this chapter, beginning the installation process.
Note: For the latest documentation, updates, add-ons, and all other VBPro information, go to
http://www.visitorbook.com/.
Installing VBPro: Pre-install decisions
Before you begin the main tasks involved in setting up a VBPro system, you should determine a few things that will help make the other tasks easier to understand and complete.
CGI Location Before you upload any of the VBPro components, you will need to have and idea of where to place them. VBPro consists of several CGI scripts that need to be in a directory on your web server that is capable of executing CGI scripts. Most often, your service provider will point you to the "cgi-bin" directory. This will often be the best place to store the CGI scripts. However, if you have the ability, you may wish to create a directory inside cgi-bin, called parhaps "vbpro", which will store the CGI scripts. In this manner, you can keep the files together and organized in a directory inside cgi-bin.
Data File Location You will also need to determine where you want to store the datafiles for the VBPro system (book entry information, system access records, and so on). The VBPro system will look for all the data files in this one directory; therefore, it is crucial that this directory is in a safe place. For example, it would not be a good idea to create a data directory that is accessible on the web. If at all possible, you will want to create a directory for data that is NOT accessible from a web browser -- in other words, it should reside outside of your main HTML or htdocs directory.
General Setup Tree For the setup of the VBPro system, it is a good idea to have a feel to the structure, or tree, of the VBPro setup. Below, a simple text diagram shows one possible setup. Thinking out this stage for your own server will help you when you configure the setup files and will also speed the process of uploading files.
/usr/local/apache/vbfiles /books /vbtemplates /Standard_Guestbook cgi-lib.pl masteradmin.pass vb.shared.lib.pl /usr/local/apache/cgi-bin/vbpro vb.config.pl vbadmin.cgi vbmasteradmin.cgi
Installing VBPro: Editing the files
For the VBPro system to function properly, several configuration options must be set based on your system layout and personal preferences. Though getting this step right may take a bit more time depending on your experience and knowledge, it is the most crucial step in getting the system to function. VBPro consists of several scripts that perform ceratin funtions. Most of the scripts need the same set configuration information, and all of this information is stored in one configuration file. As a result, relatively little has to be done to each individual script. First, you must modify each of the three CGIs (vbpro, vbadmin, vbmasteradmin) to point to the Perl program on your system. This means the first line of each of the programs must contain a pound sign, an exclamation point, and the full path to the perl program. If you do not know what should go here, there are a few ways to find out:
- Ask your ISP/Service Provider what the correct path to Perl is - In Telnet, type 'which perl' or 'whereis perl' - On your ISP, snoop around in someone else's CGI and see what they've got
Some settings for the path to Perl are:
#!/usr/bin/perl #!/usr/local/bin/perl #!/bin/perl #!/usr/sbin/perl
After you have the correct path to Perl set, the only other thing that must be modified in each program is the configuration file information. The program needs to know where to look for the configuration file that stores all the other information you will input. Decide now (if you haven't already done so) where you are going to place this file. (See Section I, Chapter 2 if you need help deciding where things go.)
To change this variable, simply modify the location that is already inside the quotes. Be sure to leave the double quotes in place. For example, your configuration will look similar to this (the path will be different):
$configfile = "vb.config.pl";
Once your VBPro system is working, almost every aspect of maintaining several guestbooks and users is easily managed thanks to VBPro's comprehensive web-based administrator tools. However, in order for these tools to function properly, the main configuration file must be configured correctly. Therefore, it is reccomended that you understand what each option in the configuration file does as you go along editing it. This section steps you through each variable in the vb.config.pl file.
$templatedir = "/usr/local/apache/vbtemplates";
This is the path of the directory where VBPro template files are stored. These files are used only in the master admin program. Nevertheless, they are crucial; if no templates are installed, new books can only be created using the custom book process (powerful, yet more time consuming.)
$sharedlib = "/usr/local/apache/vbfiles/vb.shared.lib.pl";
Path to the Command-O VBPro shared library. This file contains VBPro code that is used by most of the three programs. Putting it all in one file saves space since the code in it isn't written several times among the three CGIs. Like all of the VBPro files, this should be located in a safe place on your server.
$cgilib = "/usr/local/apache/vhosts/hoho/vbfiles/cgi-lib.pl";
This is the path of the CGI-LIB library. Written by Steve Brenner, CGI-LIB is a popular file containing many functions that making processing forms, among other things, easier for developers such as Command-O Software. This file is required.
$cgi_url = "http://domain.xyz/cgi-bin/vbpro/vbpro.cgi";
This should be the URL of the "vbpro" CGI (by default, it is named vbpro.cgi). This value is used by the Master Admin program when making new books. Particularly, it will automatically place this value in templates that ask for it. (All Command-O templates use this technique).
$masterpass = "/usr/local/apache/vbfiles/masteradmin.pass";
This is the path of the password file for the master administrator. A default version of this file was included in the VBPro distribution.
$mailprog = "/usr/sbin/sendmail";
This is the location of your mail program on your server (this is usually called sendmail). If you want to find this and have a shell account, login and type "which sendmail" (no quotes).
$basebookdir = "/usr/local/apache/vbfiles/books";
This is the path of the directory where books will be created. This may be something like /usr/local/etc/httpd/vbpro/books . Information about guestbooks will be stored in this directory. BE CAREFUL -- don't end this value with a forward slash (/)! Follow the example above.
$root_livedir = "/usr/local/apache/htdocs/books";
When a new book is created using the the master admin program, this is the absolute top place where the book HTML files will be allowed to be created. This should probably be set to a designated "books" directory inside your main htdocs directory for easiest maintainence and security. However, if you set this to simply your htdocs directory -- or worse, nothing at all -- whoever uses the master admin program (which should be just you or very few people) can create books anywhere inside that directory. This is not a huge risk since only at most few responsible people other than yourself should have access to the master admin program. Nevertheless, the stricter, the better.
$root_liveurl = "http://domain.xyz/books";
This URL corresponds with the directory above. Be certain not to include a trailing slash (do not end this url with a /).
$picture_url = "http://web.hoho.com/vbpro/pics";
The administrator programs use a few graphics in their interfaces. Upload the images that came with the software somewhere on your web site and point to that directory here.
$logouturl = "http://domain.xyz";
After the user admin or master admin logs out, the CGI will redirect them to this page. Not very important, as long as you have something.
Installing VBPro: Uploading the files
Provided you completed Step 2 and thought about where your files should go, this next step should be easy. Following the structure provided as an example in Step 2 (or using your own choices), upload the corresponding files and create the necessary directories on your server. Except for included images, all of the VBPro related files are text files. Therefore, if you have an option, upload all of the files (except images) in text mode (as opposed to binary). Usually FTP programs these days have an "Auto" default setting and are smart enough to upload the files the correct way without any tinkering.
Installing VBPro: Setting permissions
Setting the permissions of your folders and files is another crucial step in starting you VBPro system. Your UNIX-based host relies on a system of permissions in order to control what users on your system can access and run specific files and programs. While it is not necessary (in our estimation) to describe the typical permissions system in its entirety and in detail, we will explain what you need to know to understand how to set the VBPro permissions correctly. When you or anyone visiting your web site uses one of the VBPro CGI scripts, the web server runs the script and attempts the desired task (such as adding an entry to a guest book. In most setups, you will need to change the settings on files and folders on your server -- which are called permissions -- in order to allow the web server to view and edit text files, create and view directories, and execute scripts (the three main programs). So what permissions exactly does the web server need? Well, for many of the text files, the web server needs to be able to view and edit them. For most directories, the web server needs the permissions to list the contents and create new files in it. For all of the scripts, the web server needs to be able to execute them. Looking at each file, we could tell you exactly what permissions are needed and what are not necessary. However, doing this would take you much more time to set up, and would not be guarateed to work uniformly across all servers that run VBPro. So, we will tell you some groups of files and what permissions to assign them; if you wish to be more specific in setting permissions so as to enhance the security of your setup, we encourage you to experiment with your setup and/or contact your server admin. Basically, if you are on a shared system, some of the files below could potentially be accessed and/or modified by a knowledgable user (specifically, files where the last number of the permission mode is 7). Again, we encourage you to learn more about permissions from your service provider and how they apply to your on your setup.
File list Set the following files according to the permissions in brackets.
/usr/local/apache/vbfiles [755] /books [777] /vbtemplates [755] /Standard_Guestbook cgi-lib.pl [755] masteradmin.pass [777] vb.shared.lib.pl [755]
/usr/local/apache/cgi-bin/vbpro vb.config.pl [755] vbadmin.cgi [755] vbmasteradmin.cgi [755]
How to set the permissions To set the permissions for the files using a telnet/shell account, follow the example below. Type the following command in to the telnet window for each file (be sure to change the permission mode/numbers as necessary).
chmod 777 /path/to/file_or_directory
There are two ways to set the permissions using an FTP client, depending on your computer platform. On a Macintosh, we use Fetch 3.0. Find the file you want to change, and click once on it. Go to the "Directory" menu, and select "Set Permissions..." Select all of the boxes for 777, and click OK. For 755 files, click all of the boxes in the first column, the top box only in the middle column, and all of the boxes in the last column. Repeat this process for all files and directories as needed. On a Windows machine, a popular way to do it is using WS FTP. Go to the directory that contains the file you want. Right click with your mouse, and select "Site" from the window that pops up. Then, type "chmod 777 books" (or whatever the mode/file is). Repeat this process for all the files and directories as needed.
Installing VBPro: Testing the setup
If all went well in the last five chapters, then your VBPro setup should be ready for prime time. The first way to test this is to log in to the masteradmin CGI. First, locate the masterlogin.html file. If you haven't already done so, modify the HTML form in this file to point to the masteradmin.cgi script on your server. Then, upload the form to your server and log in with the user id "admin" and default password "admin". If all goes well, you will be presented with the main admin screen. However, this first test will probably not fail. We're not saying that our programs or documentation lead you in to building a flawed setup; rather, from our experience in distributing and supporting CGIs over many many years, we have seen that typically new users have trouble setting up programs for the first time. Additionally, you could have configured the programs with invalid information about your server. Follow this troubleshooting checklist when things don't work. - Are you getting a server error (something like "Internal Server Error") or a VBPro error (the error page begins with "VBPro: Error")? If it is a VBPro error, then you know the CGI executes and your setup (permissions or configuration file) is flawed somewhere. If, however, you get a server error, continue following the checklist to pinpoint the problem.
- Check your web server's error log. Can you glean any useful information for the error message? Can you ask your system admin what it might mean?
- Did you use the correct path to perl in the scripts?
- Did you upload the files in ASCII mode? Try viewing a script in your FTP ot telnet program. Does it look okay? Do you see strange characters or is the file all on one line? If so, you need to re-upload the file in text mode and in such a manner that your FTP program will translate it correctly. Experiment.
- Rethink your permissions. Try setting every file and folder related to VBPro to 777. See if it works, then set the permissions back (because leaving files accessible like this is not a good idea from a security standpoint). If doing this worked, then play around with the permissions until you find the setup works. Ask your ISP for help if you have resolved it to be a permissions problem.
- Check the file name. Do the scripts end with .pl or rather do they end with .cgi? Though either should work, your server may be finnecky or configured to only support one in a particular directory.
- Check all user-configured options. Are you sure they are correct? Would your system admin be of help to verify?
Installing VBPro: Using the Master Admin program
VisitorBook Pro was designed from the ground up as a guestbook system that could easily be modified and controlled through the web. One of VBPro's most powerful programs, the Master Admin program allows you to create, maintain, and delete any number of guestbooks in your guestbook system. In later chapters in this section, we delve into the specifics of how different modes of the program work. For now, let's just get accquainted with the basic functionality of the program as a whole. The Master Admin program (and the VBPro system in general) is written with the assumption that in the installed guestbook system, there will be one "master admin" who controls the maintainence of the guestbook system and oversees adding news books and related tasks. This master admin is assumed to be a trusted person who is familiar with and has access to your web site and server information. Most likely, you are the master administrator. Alternatively, the master admin could be a few trusted people (yourself included) to whom you have given access information for the master admin program. In any case, it should be hard to figure out who we are refering to when we talk about the master admin. In order to do any sort of editing or administrative functions built in to the master admin program, the master admin must first login. The VBPro distribution comes with a file called "masterlogin.html". This file in turn has a form for logging in to the CGI. Be sure to edit this form to point to the correct CGI on your server. You probably uploaded this HTML login form to some place on your web site. Find it, and view the login page in your favorite web browser. By default, VisitorBook Pro is written with a standard master admin user ID of "admin" and a corresponding password as "admin". (Remember: after you log in for the first time, the first thing you should do is change this password to something less obvious and more secure. Otherwise, anyone guessing or reading the VBPro documentation could gain access to your system with very little effort. After you login for the first time, you will see a few different modes on the master admin main page. They are described below:
New VisitorBook This mode is used for adding a new guestbook to the VBPro system. New guestbooks can be created online based on any pre-defined layout or with custom HTML and options. Creating a new VisitorBook can last anywhere from two to twenty minutes, depending on desired complexity.
Delete a VisitorBook This mode is fairly obvious; it is used for erasing a VisitorBook, including all posts and related from-submitted data.
Edit a VisitorBook This powerful mode can be used to access, display, and modify any preferences set for any book in the current guestbook system.
Change Master Password Click on this mode for a very simple password-changing screen. For more detailed descriptions of how these modes operate, continue by selecting the desired chapter at left.
Installing VBPro: Creating a new book
Creating a new guestbook with the master admin program is typically very quick and painless. Depending on your needs, you can set up a book from scratch or use a pre-defined layout. We will cover both methods on this page. Regardless of which method you choose, some basic information is required that both methods use. So, we will describe the setup process up until the point where you choose what method you'd like, and then we'll describe what to do for each method. First, begin by pressing the button marked "New VisitorBook". This will bring you to the first page of the setup process. You are asked to fill in a few required fields:
- Book Name
This is the name of the book. You can use a word or series of words for this value; it is simply used by the admin program to identify the book. (For example, "Company Guestbook", "Public Guestbook", "Visitors", etc..)
- Book ID
Every guestbook in the system must have a unique ID so that the scripts know what book to deal with. Type in a short but meaningful identifier.
- Login Password
Using the user admin program, you can let the "owner" of this book (if it is not you) to log in and modify current entries and book preferences.
After you figure out these fields, click next to continue the setup process. The next page details setup of the live directory.You must create a live directory on your web site where all web files will be stored. This is where the guestbook will actually be located on your site. Specifically, the default thank you page and actual guestbook page will be created in this directory.
- Live Directory Path
A base path is defined and displayed above this text input. If you want to place the live directory in some pre-existing directory in this base path, enter it here. This can safely be left blank if the base path was setup correctly.
- Live Directory Name
This is the name of the directory that will be created -- in fact, it is the live directory where entry files and such will be stored. You should probably leave this as the same name as the book ID unless you have some compelling reason not to.
- Entry File
File that will be created to store the actual guestbook (with entries).
You must choose a name for the live directory, and a location for it. For example, if you wanted to store your guestbook files in www.mysite.xyz/html/guestbook, you would set the Live Directory Path to html and Live Directory Name to guestbook. Also, note that only the actual Live Directory will be created. For example, if you set the path to html/pages/morestuff, all of those directories must first exist. In other words, the system will not make any other directories to accomodate your path. The value for Entry File is the name of the file (that will be created by the system) which will print guestbook entries. VisitorBook Pro's built-in templates let you quickly build a new guestbook based on one of a variety of HTML layouts and styles. This method should work well for most situations; unless you have a specific idea of exactly what fields you want and other such options, you should be able to find a suitable template with which to base your new book. The important thing to understand about templates is that they merely exist in the setup program; if you make a new book using the "Standard Guestbook" template, you can always change any setup information at a later date. Think of templates as a way to transparently fill in default values for book options, field information, and HTML layout. Most users choose to create a new book based on a template, and customize it later as their needs see fit. If you re going to create your book based on a template, select the template from the pop-up mennu and click "Use Template". Command-O Software includes a few sampler templates that should be enough to get you started; you can create additional templates on your own or check visitorbook.com for updated template downloads. The next page you will see is the last page of the book setup. It gives you a chance to review and modify any setup parameters you wish. Once you have made any changes you desire, click on the "Create Book" button and your new book will be created. VisitorBook Pro's master admin program has the powerful ability to create an entirely new guestbook through your web browser. You can specify every parameter of the book, define any number of fields, and set all relevant options online so your new book is ready-to-go once you create it! Though this method is powerful, it is more time consuming than setting up a book with a template. Review this method prior to cerating a book with it; you will need to prepare some HTML ahead of time to paste into a form input, for example. Click on the "Custom Book Setup Assistant" button. You see a form where you can add fields. You can create a new field of your own by typing in the expected form input and a title, or you can use one of several built in fields. Specifically:
- System Date
The date, according to your server, at the time the form was submitted.
- System Time
The time, according to your server, at the time the form was submitted.
- User IP Address
The remote address of the user. If the user's web browser send VBPro the user's hostname (eg, user005.serviceprovider.xyz), VBPro will record that value. Else, it will simply record the user's IP address (eg, 192.168.1.5).
Below the form section, you will see a section of all fields currently in the new guestbook. Click on the number next to the field to remove the field. You can play around on this screen all you want, adding and deleting fields at will. Remember, your changes are not saved until you click the submit button near the bottom of the page, labeled "Continue Custom Setup". Next, you will be asked to fill out a few template fields. Follow the directions on the page to get a better understanding of how these work and what they do. You may wish to write this part of the setup ahead of time so you can just paste your HTML in; if you spend too long on this page, you might get logged off. Also, it is a good idea to keep a copy of your HTML on your local hard drive (rather than simply typing your book's HTML into the form input) in case you encounter problems later when creating the book. In this manner, you will have a backup offline. Alternatively, you could leave these fields blank for now and edit the actual data in the useradmin or masteradmin programs later when you actually want to use the new book. When you finish with this page, the next page will present you with a handful of options that you can set on the new book. These are pretty much the same value that you can set and modify later with the admin programs. Finally, when you are ready, click "Continue Custom Setup" on this page and you will arrive at the summary page. If all information looks to be in order, click "Create Book". If, however, you see any changes that need to be made, you must usse your browser's back button to return to the appropriate setup stage.
Installing VBPro: Modifying a book
Modifying a book allows you to instantly change any options or informaton about the guestbook through your web browser. You can change the maximum number of posts, register bad words, or instantly change the way the entire book looks, all through either of the admin programs. For this example, we will use the master admin program. The user admin program functions exactly the same as the edit book mode of the master admin program, except that the user admin program will only let the user modify that user's book. To modify a book, first log in to the master admin program and press the "Edit a VisitorBook" button. The next screen that will appear asks you to select a book to edit. Since you can modify any book you wish, you must select which book specifically you want to edit. You can only edit one book at a time. The next screen that appears is the main book editing screen. You are presented with a few different panels of controls, each with different functions.
- Basic Options
This section contains a few pretty simple controls on the book. This section controls how entries are dealt with, from processing bad words to limiting the number of entries. Changes to this section should be pretty straightforward; toggle controls on and off using radio buttons and popups.
- Fields
This section controls the behavior of the VBPro system and what fields it interprets. You can set which fields are required to contain data by click on the check box for that field in the "Req'd" column. You can also change the form input value, though this is probably not very useful (how often are you going to be changing the names of your form fields?)
- Templates
By customizing and modifying the templates in this section, you can quickly change the appearence of your guestbook. If you want each entry to look different, or the entry file's layout to be different, you cannot simply edit the entry HTML file! You must instead edit these templates so that the next time the entry file is generated, it will be refreshed based on these updated templates. Note: every time you click "Submit Changes", the admin program will automatically refresh the entry HTML file, reflecting any changes you have made.
- Banned IPs and Words
This section controls what words are considered "bad", which may or may not be used to screen posts, depending on your settings. Currently, the badwords are simply checked as a whole word, with one word per line. The banned IPs must be in IP format (eg, 192.168.1.5) and not written as hostnames (eg, user005.serviceprovider.xyz will not function correctly.)
Creating and Maintaining Books: Deleting a book
Deleting a book is simple, but you should know a few things about how it works before you try to delte a book. The process removes the book's datafiles from the system, but it does not remove the actual HTML. So, the book's directory in your vbfiles folder will be removed, but the guestbook html, form, and any toher related HTML files will not be erased. If you want to get rid of these too, you should do that manually in your FTP or telnet program. When you are ready to delete a book, click on the "Delete a VisitorBook" button on the main admin control screen. The next page that appears will prompt you for which book to delete. Select the book from this pop-up menu and click "Select Book". Before VBPro erases the files, you will be asked to confim the operation. To do this, you must type the word "yes" in the text box and then click "Delete". The book's datafiles will be permanently erased and you will be returned to the main screen.
The User Admin Program: Controlling user access
VisitorBook Pro comes shipped with a powerful master administrator program that can handle almost every task needed for each book. However, the trusted sidekick of this program is the user administrator program, simply called "vbadmin.cgi". Through this program, users have access to any setup information they might need to change. Controlling access to this program allows you to designate other people to control a specific book or books. Allowing access to the user admin program is simple; it is controlled through the master admin program. To allow access to the program, simply assign the book a password -- either when you create the book or by modifying the book. Setting nothing as the password, or a blank password, will result in the user admin program disallowing that book to be accessed through the user admin program. On the master admin edit screen, this is accomplished by erasing the text "-- modify to change --" and clicking "Submit Changes". Note that it is necessary to use the user admin program to access the post-approval mode. If you create a book where posts must be approved, you will need to log in to the user admin program to approve these posts.
The User Admin Program: Overview of user abilities
Should you decide to give other people access to a book or books through the user admin program, they will have a few abilities as described below. The user will be free to modify any aspect of the book's layout and function. In glancing at the "Edit VisitorBook" screen, you should be able to see that they have a wide array of tools. These same configuration options are accessible by you through the master admin program. Additionally, the user can control posts in the approval section. The user who has access to the book through the user admin program can control what gets seen on the book and what does not. In this manner, the admin can act effectively as a moderator of the book. The user may change his or her password by modifying the field on the "Edit VisitorBook" screen. That is, if the text field for password is anything other than "-- edit to change --", the new password will be the contents of the field. (The reason the system uses this method as opposed to simply showing you the existing password is that the password is stored in such a way as to make it practically impossible to determine the password from the encrypted (or hased) value).
|
 |
|
 |
 |
|
|
 |