Subs Configuration Help

This page provides help on configuring and customising your Subs system. Configuration of Subs usually only needs to be done once when you first install or upgrade Subs.

Note Before you configure Subs and as a separate exercise, you will have to set up the access control on your web site so that it uses the Subs password file to authorise users. Setting up the access control on your web server is not an optional step. If you do not do it, anyone and everyone will be able to access your supposedly protected information. Subs does not set up the .htaccess or .nsconfig files or whatever your web server needs to protect the files your users want to subscribe to. You will need to be (or have access to someone) familiar with the access control system on your web server in order to do this.

Index


Configuration page

There is a single page that allows you to configure and reconfigure most things in Subs. The Configuration page is usually installed
here. There is also a link at the bottom of each administrator page.

You will usually have to enter the 'admin' user name and password before you can access the Configuration page.

To configure or reconfigure Subs, load that page, change some or all of the fields and press the "Change Configuration" button at the bottom of the page.


Fields

This section explains the meaning of each of the fields on the Configuration page.

Database file name

This field specifies the file name and the type of your User Database. The User Database holds the details of all your users, including their passwords and Credit Card numbers. For security reasons, you should make sure this file is in a secure place, and certainly not in your web server directory. Enter the absolute path to the file, for example /usr/local/etc/users.

The Type field allows you to specify the format of the User Database. The choices are:

If you change the file name or file type after you have already populated your User Database, Subs will not copy or convert the file to the new location or format. You will effectively start a new database in the new location and format. The Subs distribution includes a utility to convert User Databases from one format to another. We recommend that you make a suitable choice of database type and location before you start to add users, and stick with them.

Password file name

This field gives the name of the password file that your web server will use to authorise your users. The name you give here must agree with the name of the password file given in your access control file.

The password file is an NCSA style password file, ie each line is of the form userName:encryptedPassword.

The password file will be rewritten whenever you edit a users details, whenever you press "Update Password File" or whenever the update program runs. It will contain an entry for every user with either Trial or Approved status, and whose access has started but not expired at that time.

Host computer type

This field specifies the type of host computer and operating system that your web server is running on.

Web server type

This field specifies the type of Web server you are running.

Date format

This field allows you to choose the format for entering and displaying dates in the Subs system. Choose the one that is most common in your country. In USA you will probably choose mmddyy, while in UK, Australia and Europe, you will probably choose ddmmyy. You can change this field any time you like.

Default subscription period

This field specifies the default subscription period that will appear in the "Access end date" of the Edit User page. It allows you to save time when you enter new users by hand. Set this field to the subscription period usually requiested by your users. You can change this field any time you like.

Logo URL

This field specifies the URL of a logo that will appear at the top of each Subs page. You can change this field any time you like.

Your Service Name

This field specifies a short name of your site or the service you are offering through your Web site. It will appear at the top of each Subs page to identify your system, and will also appear in the subject line of outgoing email. Choose the well known public name of your service. You can change this field any time you like.

Web server 'admin' password

This field specifies the password for the 'admin' user. In order to access any of the administrative or configuration pages you will normall have to enter a user name of 'admin' and this password. (The only exception to this is the first time you configure your system, when you will not be required to enter a password at all). Choose a password that is hard to guess, does not appear in any dictionary, and preferably contains some digits or punctuation. Remember your admin password. Without it you cannot configure Subs or access your User Database or administration pages.

Administrator full name

Administrator email address

These fields specifies the full real name and email of the administrator of your Subs system. They appear as a contact at the bottom of each page, and as the "from" address in outgoing email. You should enter the name and email address of a person or group who is able to deal with customer account and access problems. You might for example give the name and email addres of your support organisation.

Location of the 'sendmail' program

This field gives the absolute path to the Unix sendmail program on your web server. This is required for Subs to automatically send email to new and expiring subscribers. It is often something like /usr/lib/sendmail, but you should check with your web server host administrator to be sure.

Location of web server access log

This field specifies where the access log for your web server is. It should be a full path name. Typical values are /usr/local/etc/httpd/logs/acccess_log. This field is used by
pirateCheck so it can analyse accesses to your web site. If you do not use pirateCheck, you do not need to enter anything into this field.

Email text to send to new subscribers

This is the text of email that will be sent automatically when you add a new user to Subs, when you change a user to Approved, or when you extend the subscription end date. It is only sent if you have entered an email address for the user. The email would usually express some thanks for subscribing and give them their user name and password.

This text can include a number of special keywords that will be replaced with actual details when the mail is sent:

Online Registration Policy

This menu controls how new users are treated during online registration. If you are not using online registration, ignore this field. The available options are:

Use this Card Processor

This menu selects the Credit Card Processor you wish to use. The options are:

CreditNet Merchant ID

If you selected CreditNet, enter the merchant ID that you get from CCN.

CreditNet Merchant Password

If you selected CreditNet, enter the merchant password that you get from CCN.

Path to PGP program

If you selected CreditNet, enter the full path to the PGP program, typically /usr/local/bin/pgp.

Path to PGP home directory

If you selected CreditNet, enter the complete path to the PGP home directory you created as part of the PGP installation.

Prices

This section allows you to configure the prices for the different subscription periods you are offering. There will be one row for each subscription period listed in @defaultPeriods in util.pl. You should enter a price in dollars for each period. Prices should be entered like 10.00, but just 10 will do. These prices will be shown in the menu on the public online registration page, and will also be passed to you credit card processor if you selected "Immediate access after authentication" in
Online Registration Policy

File Formats

All file formats have one record per user. All file formats contain the following "Standard" fields in this order: DBM Files use the user name as the key. The value is the "Standard" fields separated by NULLs. Flat Files are one record (ie one user) per line. A line consists of NULL separated fields. The first field is the user name, followed by the Standard fields. Comma Separated files are one record (ie one user) per line. A line consists of comma separated fields. The first field is the user name, followed by the Standard fields. If a field contains a comma, it is surrounded by double quotes ("), and any double quotes in the field are escaped (prefixed) by backslash (\).

Lock File

Subs uses a lock file to make sure only one administrator is able to update the User Database at a time. Its usual location is /tmp/subsLockFile.

update

This program rebuilds the
password file that is read by your web server. It runs through all the users in the User Database. Users that have an account status of either "Trial" or "Approved", and whose access period has started but not expired have their name and encrypted password entered into the password file.

The password file is updated automatically whenever you add or edit a users details, whenever a user registers online or whenever you press the "Update Password File" button on an adminstrator page. But you should also arrange for update to run automatically at least once per day using the Unix cron(1) command. If you do this then users whose subscriptions expire will be automatically removed from the password file. If you didn't run update automatically from cron, you would have to press the "Update Password File" button manually at least once per day, otherwise your expired users would get extra days free access to your site.

Update is run automatically by pirateCheck, so you do not need to run update if you are running pirateCheck regularly.

If you do not understand how to set up cron jobs on your web server host, get your host administrator to help you.

A typical cron entry would look something like:
15 1 * * * cd /usr/local/etc/httpd/cgi-bin/subs/private; ./update
This will cause update to run at 1.15 am every day of the year. Update must be run from the directory where it is installed, hence the cd in the cron entry above.


convertDatabase

This utility program can be used to convert User Databases between DBM, Flat File and Comma Separated files. You might need to do this to initially convert a database of users exported in in Comma Separated format from a spreadsheet program to the Subs DBM format. Alternatively, you might want to export the Subs database to a database or mailing list program in Comma Separated format.

convertDatabase must be run from the directory where it is installed. The -h flag will give help on how to use it.


Other configurable items

You can configure most things with the Configure page as described above. However, keen and knowledgeable administrators can configure many other things too, such as:

pirateCheck

Often, web sites with interesting material that are protected by password become the target of pirates and the hacker community. Valid user names and passwords are circulated and many people will get unauthorised access to the protected material for free.

You can prevent this happening to your site by running the pirateCheck program. PirateCheck analyses your web server access log and looks for usernames that are being used from many different locations. Any accounts that are being used to milk your site are automatically marked as Held and their access privileges disabled. PirateCheck also automatically disables access for subscriptions that have expired.

You can run pirateCheck by hand if you wish, but the best way is to run it automatically from cron(1). That way pirates will be detected and disabled even if you cannot get to your machine. See your system administrator for details on how to run pirateCheck automatically each day from cron(1).

PirateCheck works by looking through the web server access log file that you specify on the Subs Configuration page. It looks at all accesses to protected areas on your web server that occurred in the last 2 days, and counts the number of different browsers used by each user. If it detects more than 4 different browsers in use, it assumes that the user name is in circulation, marks it as Held, and sends email to the Subs administrator. Finally, pirateCheck rebuilds the password file. If you run pirateCheck regularly, you do not need to run update too.

If you do not understand how to set up cron jobs on your web server host, get your host administrator to help you.

A typical cron entry would look something like:
1 15 * * * cd /usr/local/etc/httpd/cgi-bin/subs/private; ./pirateCheck
This will cause pirateCheck to run at 1.15 am every day of the year. PirateCheck must be run from the directory where it is installed, hence the cd in the cron entry above.


Multiple configurations

Subs supports optional multiple configuration files. This is useful if you are administering several different subscription products on the one web server. You can set up several completely different configurations and easily edit and maintain them. You can have several completely different product configurations, each with different user databases and password files.

There are several pages that allow administrators to operate on all your Subs users in all Subs databases at the same time (listAll.cgi, pendingAll.cgi and listSites.cgi) . In order to use these pages, you must set up metaconfig.pl in PRIVATECGIDIR. You will nee to edit this file with a text editor, and invent a short, unique name for each separate Subs configuration you want.


Copyright ©
Open System Consultants