|
Thank you for purchasing 4 Free Professional! This document outlines the installation
process for the 4 Free package. Installation takes between 15 and 20 minutes.
Before getting started, please make sure you have the following things handy:
- Your MySQL server, username, and password information
- A directory on your server where you intend to install 4 Free
- The full server path and URL to that directory
You'll need this information in order to configure and install 4 Free, so it's
best to make sure that you have it available now.
Step 1: Creating the MySQL Database
The first thing you need to do is create a new MySQL database to use for 4
Free. If you don't have permission to create new databases on your MySQL server,
have your administrator do this for you. Once the database itself has been created,
bring up a MySQL command prompt and enter the command use
databasename, where databasename is the name of the database you created
for 4 Free. Next, open the "tables.sql" file included with the 4 Free
distribution. Copy the entire contents of this file to the clipboard, and paste
them in at the MySQL command prompt. This will create all of the tables in the
database.
Step 2: Setting Configuration Variables
Now you'll need to set the configuration variables inside several of 4 Free's
files. This is the only time you'll need to do this; in the future, you can make
any needed changes with 4 Free's web-based configurator. First, set all of the
variables in the following two files:
The following three files each have a line near the top which says "use
lib" followed by a server path. Open each of these files and replace the
existing path after "use lib" with the path to the directory where you
will be installing 4 Free:
- cronmailer.pl
- dailycron.pl
- admin/setup.cgi
If you will be using 4 Free's survey capability for your members area, that
module has its own configuration file (see Step 7). However, it is suggested that
you deal with that later in the installation procedure.
Step 3: Uploading
After you've set the needed configuration variables, you're ready to upload
everything to your server. When uploading, be sure that all script files (.pl,
.cgi, .php) are uploaded in ASCII mode, and that all image files are uploaded
in BINARY mode. For now, you should make sure that all of the files included in
the 4 Free distribution get uploaded. If you don't plan on using 4 Free's survey
feature, you'll later need to delete a few files from the members directory (see
Step 7).
Step 4: Setting Permissions
Once everything is uploaded, you must set permissions on certain files. This
is easiest from a command line, but some FTP programs will let you do it as well.
For the sake of this guide, it's assumed you will be using a command line. First,
cd to the directory where you uploaded 4 Free. Make sure that all script files
(.pl, .cgi, .php) are chmod 755. The command chmod
-R 755 * will recursively chmod everything in the 4 Free directory to 755,
so that you don't have to bother typing out each script's name.
Next, chmod the following files to either 666 or 777, so that 4 Free's scripts
can write to them:
- Configs.pm
- config.php
- admin/paid (directory)
- admin/payouts (directory)
- backups/ (directory)
- backups/configs (directory)
Finally, you'll need to chmod the members area .htpasswd file to 777 and tell
the members area .htaccess file where to find it. If you don't have an .htpasswd
file yet, you'll need to create one. cd to the members directory and issue the
command htpasswd -cb .htpasswd abcdef
12345 where abcdef and 12345 are a random username/password that you make
up. (Don't actually use abcdef and 12345.) Then chmod 777 the .htpasswd
file, and edit the .htaccess file to specify the full server path to the .htpasswd.
Step 5: Protecting Your Admin Area
Now that everything is uploaded and permissions are set, you want to password
protect the 4 Free admin area so that nobody else can get in and mess around.
It is suggested that you enable .htpasswd protection on 4 Free's /admin directory.
If you don't know how to do this, ask your system administrator to do it for you
(or use the htpasswd command given in Step 4 as a guide). If you don't password
protect your admin directory, anyone could change your settings, mass mail
your users, etc. so it's very important that you do this.
Step 6: Setting Up Cron Jobs
4 Free's day-to-day operations, such as tabulation of statistics and mass mailing,
are done exclusively by your server in order to save you the hassle. However,
you'll need to tell your server what needs to be done and when. You should set
up two cronjobs as follows:
- Run cronmailer.pl every 15 minutes or so
- Run dailycron.pl once each night before midnight (10 or 11pm is suggested)
If you do not know how to set up cron jobs, have your system administrator
add them for you. While you're setting up your cron jobs, double-check the cronmailer.pl
and dailycron.pl scripts to make sure that you set the proper path for the "use
lib" line at the top of each script. If this path is incorrect, the scripts
will not work properly and work will not be performed.
Step 7: Setting Up Your Members Area
By including a survey module called Survey Wizard, 4 Free Pro allows you to
set up a survey which is displayed to each new member the first time they enter
the members area. If you're not interested in using this feature or you don't
have any survey questions you want to ask your members, you can skip this part
and build your members area however you prefer. (You'll want to delete the 4 Free
member directory files out of your members area if you uploaded them earlier.)
You can always come back later and follow these instructions to enable the survey.
Setting up the survey involves several steps. First, open and edit the surveyconfig.php
file. The variables in the file are self explanatory. An image file named "gradient.gif"
is included in the members/surveytemplates directory of the 4 Free distribution,
you should set the $barurl variable to reflect where that GIF file will be on
your server. After setting the configuration variables, paste the contents of
your members area index HTML at the bottom of the index.php file, where indicated.
Be sure to leave the EOT marker and the closing ?> PHP tag as specified in
the file.
Now upload the entire contents of the members directory to the appropriate
location on your server. Make sure that gradient.gif is uploaded in BINARY mode
and that the other files are uploaded in ASCII mode. Rename surveyadmin.php on
the server so that its name can't be guessed by others.
Point your browser to surveyadmin.php (you may have renamed it) inside the
members directory. This script allows you to create the survey by adding as many
questions as you like, and choosing which type of response option - radio buttons,
list, check boxes, or text field - should be given for each question. When you
finish creating the survey, you'll be presented with its ID number - the ID will
be 1, which is already set in the surveyconfig.php file. (If you create a different
survey in the future, you'll need to set the appropriate ID in the config file.)
Installation of the survey module should be complete. The first time your members
enter the members area, they'll be presented with the survey. Once they complete
the survey, a cookie will be set on their browser. The index.php file will read
that cookie and, from then on, display the actual members area instead of the
survey.
Step 8: Making Your Public Pages Work with 4 Free
In order for 4 Free's affiliate hit tracking to work properly, you'll need
wrap all of your front-end HTML inside of the code contained within 4 Free's "blank.php"
script. This is easy to do.
For each page you plan to put up on your site, first make a copy of blank.php
and open it up. Paste the HTML code at the end of the file, after the ?> tag,
and make sure to keep the .php extension. For example, let's say you want to put
up a 3-page preview tour on your site. You'd need to make three copies of blank.php,
rename them (e.g. tour1.php, tour2.php, tour3.php), then open each one and paste
the appropriate HTML at the bottom of the file.
For an actual example of how this should be done, open up the index.php that
came with 4 Free. You'll see that it contains the PHP code from blank.php at the
top, and the HTML of the index page at the bottom. All of this might sound confusing,
but in reality it's a simple copy-and-paste task.
One other thing you might want to consider when building or modifying your
site is 4 Free's "lost password" functionality. You can allow both members
and affiliates to retreive forgotten passwords by entering their email address.
To enable this capability, create a form that posts to the lostpass.cgi script.
Here is some example code:
Password Retrieval for Members
<form action=lostpass.cgi method=POST>
<input type=hidden name=type value=surfer>
Please enter email address to have your info mailed to you.<br><br>
Email Address: <input type=text size=20 name=email><br>
<br><input type=submit value="Get Password">
</form>
Password Retrieval for Affiliates
<form action=lostpass.cgi method=POST>
<input type=hidden name=type value=affiliate>
Please enter either a username or email address to have your info mailed to you.<br><br>
Username: <input type=text size=20 name=username><br>
Email Address: <input type=text size=20 name=email><br>
<br><input type=submit value="Get Password">
</form>
You can place these forms on any of your site's pages (e.g. the login templates)
if you want your members and affiliates to be able to have forgotten passwords
mailed to them.
Step 9: Final Tweaking
Point your web browser to admin/admin.cgi in your 4 Free directory. Click the
"System Setup" link to access 4 Free's web-based configurator, and make
any changes you require. You can use the configurator anytime you need to adjust
4 Free's settings; it automatically backs up and overwrites the Configs.pm and
config.php files with the settings you specify.
You'll probably also want to edit some or all of the HTML templates, which
can be found in the templates directory. When editing, be sure to leave all tokens
in place. Tokens appear %likethis%, as text surrounded by percent signs. They're
essential to 4 Free's operation, so be sure not to accidentally remove them from
the HTML templates. We suggest making a copy of the originals before editing,
just in case.
Step 10: You're Finished!
Installation is complete. See the user manual provided with 4 Free for more
information about using the package.
|