Chapter 4. Installation

This chapter will explain, in detail, how to install the Web Site Replicator on your server. This chapter goes over the installation process quickly, and assumes you already have knowledge of the needed internet technologies, such as FTP and Telnet.


4.1 Getting Started

The first thing you must do is download the Web Site Replicator from the Downloads section of the Envex Developments Customer Area. Once you have downloaded the script, unzip it to your computer. There are six directories contained within the zip file which are:
  • cgi-bin
  • html
  • images
  • lib
  • manual
  • wsr_data

You must also make sure your web server meets the needed requirements which are explained in section 3.1 Server Requirements of this manual.


4.2 Upload the Files

The first step to install the Web Site Replicator is to upload all needed files to your web server. To start, connect to your web server via FTP.


4.2.1 Upload the /wsr_data/ Directory

First, you must upload the /wsr_data/ directory. This directory should be uploaded below your document root. On the majority of web servers, the document root is one directory level below where all web pages are stored. For example, if all web pages are stored in the /home/username/public_html directory, you should upload the /wsr_data/ directory to /home/username/wsr_data.

Once you have decided where to upload the /wsr_data/ directory, upload it. Make sure you upload all files in ASCII mode. CHMOD the directory to the following permissions:
  • /wsr_data/ - 777
  • /wsr_data/wsr.conf - 777
  • /wsr_data/dat/ - 777
  • /wsr_data/dat/modules.dat - 777
  • /wsr_data/dat/navmenu.dat - 777
  • /wsr_data/dat/styles.dat - 777
  • /wsr_data/htmlt/ - 777
  • /wsr_data/htmlt/members_only/ - 777
  • /wsr_data/htmlt/public/ - 777



4.2.2 Upload the /cgi-bin/ Directory

Next, you need to upload the /cgi-bin/ directory. First, change directories on your web server to your cgi-bin. Once inside your cgi-bin, create a directory named wsr. Upload the contents of the /cgi-bin/ directory from the zip file, to the wsr directory you just created.

Make sure you upload all files in ASCII mode. Once uploaded, CHMOD the /cgi-bin/ directory as follows:
  • backup.pl - 777
  • install.cgi - 755
  • newuser.cgi - 777
  • reminder.cgi - 777
  • update.pl - 777
  • admin/ - 777
  • admin/.htaccess - 777
  • admin/admin.cgi - 777
  • admin/*.pl (all .pl files) - 755
  • backup/ - 777
  • members_only/ - 755
  • members_only/*.pl (all .pl files) - 755
  • modules/ - 755
  • modules/exec.pl - 777
NOTE: If you are familiar with installing CGI scripts, you will notice that the above permissions seem incorrect. Please make sure you CHMOD all files exactly as above, as the permissions are correct. The installation script will modify several files on your server, and CHMOD them to the correct permission, 755.


4.2.3 Upload the /lib/ Directory

Next, you need to upload the /lib/ directory to your server. Once again, change directories on your web server to your cgi-bin, and create a new directory named lib. So you should have now created two directories inside your cgi-bin, wsr and lib. Upload the contents of the /lib/ directory from the zip file, to the lib directory you just created. Make sure you upload all files in ASCII mode. Once uploaded, CHMOD all files in the lib directory to 755.


4.2.4 Upload the /images/ Directory

The next directory you need to upload is the /images/ directory. Change to the images directory to your web server, and create a sub-directory named wsr. Upload the contents of the /images/ directory from the zip file to the wsr directory you just created. Make sure you upload all images in Binary mode, and not ASCII.



4.2.5 Upload the /html/ Directory

The last directory you need to upload is the /html/ directory. Change directories on your server to your document root (where all web pages are stored). Upload the contents of the /html/ directory from the zip file to your document root. Make sure you upload all files in ASCII mode. Once uploaded, CHMOD the files to the following permissions:
  • show.cgi - 777
  • members_only/ - 777
  • members_only/.htaccess - 777
  • members_only/members_only.cgi - 777


4.3 Run Installation Script

You should now have all files uploaded to your web server, and the permissions set correctly. The next thing you need to do is run the installation script. Open up your web browser to the /cgi-bin/install.cgi script on your server which should be located at:
http://www.domain.com/cgi-bin/wsr/install.cgi

The first page which is displayed when you run the install.cgi script asks for your registration number. In the provided text box, please enter the registration number which Envex Developments supplied you with. If you receive an error, your registration number will be automatically deactivated, and you will need to contact Envex Developments in order to have it reactivated.

If you entered a correct registration number, the installation form will appear. Fill out all fields in the installation form, and click on the Install the Web Site Replicator v4.0 submit button.

Another page should then come up saying that the Web Site Replicator has been successfully installed on your server. Depending on how your web server is setup, this page may also ask you to CHMOD several files. Please follow these directions if they appear.

Last, make sure you delete the install.cgi script from your server, as it is only a security hazard now.


4.4 Compile members.c Script

The next thing you need to do is compile the members.c script which should be located in the document root of your server. Telnet into your server and change directories to your document root, where the members.c script is located. At the telnet prompt type the following:
gcc -o members members.c

This will compile the members.c script, and create a new file named members, in your document root. CHMOD the new members file to 755, and delete the members.c script from your server.


4.5 Change the DefaultType

This is one of the more difficult tasks involved with installing the Web Site Replicator because it completley depends on how your web server is setup. You must change the DefaultType directive of Apache to cgi-script. The best way to do this is to create a .htaccess file in your document root, where the complied members script is located. The .htaccess file should contain the one following line:
DefaultType cgi-script

If you own a dedicated web server, it is recommended that you change the Apache httpd.conf configuration file. Simply open up the httpd.conf file, and change the DefaultType directive to cgi-script.

To test this, open up your web browser and view the compiled members script on your server, which should be located at:
http://www.domain.com/members

If everything is working properly, you will receive an error which says, "No Username Given".


4.6 Load Crontab File

The last thing you need to do is load your Crontab file. To do this, telnet into your server and change to the /wsr_data/ directory of your server. The installation script created a new file inside this directory named cron.wsr. To load the Crontab file, type the following at the telnet prompt:
crontab cron.wsr

If no errors are given, the Crontab file has been successfully loaded. If you receive a "permission denied" error, it is most likely because your web host does not offer Crontab. Please contact your web host, and ask them to activate Crontab on your account.


4.7 Installation Complete

If you have successfully completed all above steps, the Web Site Replicator is now fully installed on your server. The next thing you must do is setup your program. To do this, please read through Chapter 5. Setting Up Your Program, and follow the instructions.