Chapter 3. Before You Begin

This chapter explains several topics which you should know, before you begin to use the Web Site Replicator. These topics include things such as server requirements, how to setup your web site, and so on.


3.1 Server Requirements

There are several requirements which your web server must meet in order to use the Web Site Replicator. Below are all requirements which your web server must meet:
  • UNIX / LINUX web server
  • Perl 5
  • Telnet / SSH access
  • 2 MySQL databases
  • 750 KB (0.75 MB) disk space for the script
  • Crontab privileges
  • Ability to set DefaultType for Apache
  • gcc Compiler
You must have an account on a UNIX / LINUX web server. The Web Site Replicator will not work on any type of Windows servers. Also, you must have telnet or SSH access to your web server.

The Web Site Replicator requires 2 MySQL databases. The two databases must be blank, and can not be used by any other program. A lot of web hosting companies provide some type of Hosting Control Panel, where you can create the two needed databases. If not, please contact your web host and ask them to create two MySQL databases for your account.

Your web server must also allow you to use Crontab. Crontab is a program on most UNIX / LINUX web servers which allows you to automatically run scripts at set time intervals. The last requirement of the Web Site Replicator is the ability to use the .htaccess file, and set the DefaultType. Most web servers already support this.


3.2 Member Database

Your member database contains your member's contact information, such as their name, e-mail address, password, ect... The member database is created during First Time Setup, and can contain as many fields as you would like.

On a piece of paper, write down all fields which you would like your member database to contain. An example member database would contain the following fields:
  • first_name
  • last_name
  • address
  • city
  • state
  • zip
  • country
  • phone
  • email
  • password
Please note, the fields in your member database can not contain spaces or special characters.


3.3 Setup Your Web Site

There are a few changes which must be made to your web site, before it may be used with the Web Site Replicator. This section will go through exactly what needs to be done to your web site, in order to turn it into a self replicating web site.


3.3.1 The Basics

Your self replicating web site can contain anything you would like, including frames, tables, and Javascript. However, your self replicating web site can not contain any server-side scripting languages, such as Java, ASP, PHP, or Server Side Includes.


3.3.2 Personalize Your Web Site

You will most likely want to personalize your self replicating web site with your member's personal information. To do this, you need to add merge fields into your web pages. A merge field is simply any of the fields in your member database, surrounded by ~ marks.

For example, if one of the fields in your member database is first_name, you would enter the merge field ~first_name~ anywhere in your web pages. This merge field will then be replaced with the member's first name. Merge fields can be placed anywhere in your web pages you would like.


3.3.3 Image Links

The next thing you need to do is change the image links of your web pages from relative URLs to absolute URLs. You should only have one set of images on your web server. You need to change all image links to absolute URLs. For example, if you have the image link:
<img src="images/title.gif">

The above image link needs to be changed to an absolute URL like:
<img src="http://www.domain.com/images/title.gif">



3.3.4 HTML Links

The next thing you need to do is change all HTML links in your web pages to absolute URLs. Basically the exact same as how you changed the image links. This is to ensure that people stay in a member's self replicating web site, and do not stray off to your main site. This makes sure your member's receive proper credit for everyone they refer.

For example, if you have an HTML link in your web site like:
<a href="program.html">

You need to change the above link to:
<a href="http://www.domain.com/members/~username~/program.html">
When someone views a member's self replicating web page, the ~username~ merge field in the above URL will be replaced with the member's username. This will ensure that everyone stays in the member's self replicating web site.

3.4 Additional Server Issues

There are also several additional server issues you may want to take into consideration. These server issues will not affect your program until you have 1000+ members in your database. Most web servers have several "built-in" rules which add restrictions to CGI scripts. These rules are used so your account does not consume too many server resources.

One of these "built-in" rules is that your web server will only allow you to send an X number of e-mail messages through Sendmail at one time. For example, the web server will only allow you to send 500 e-mail messages at once. When you send an e-mail to all members in your database, your web server may stop you from sending e-mails half way through. As a result, you will not be able to e-mail all members in your database.

Another "built-in" rule is that many web servers will only allow a CGI script to run for so long. For example, a web server will only allow a CGI script to run for 60 seconds, and then will automatically stop the script. We have overcome this problem through the Admin Control Panel by adding several Restart Process buttons throughout the script. However, this could cause a problem when the script updates commissions every night. Since the server will automatically stop the script after so long, the script may end up only adding half the commissions.

The only way around these additional server issues is to move your web site to a dedicated web server. With a dedicated server, you can change the server configuration and take these "built-in" rules out.