|
The cgi scripts on the web server are usually installed by running
a file called install.pl. If you do not have 'command line' access
to the web server then it is possible (though a little fiddly) to
set up all the required files using an FTP client.
Whilst it would be easier if you could run the install.pl script,
all it does is create directories, copy files into these directories
and sets permissions on the directories.
Setting up on Unix
In the following example, the html and cgi-bin directories are off
the root of the web server's directories. Your web server 'root' may
be something like:
/home/httpd/
/usr/local/apache/htdocs/username/WWW
/usr/local/apache/htdocs.
/var/www/
You can find out your web server root by FTPing the file 'cwd.cgi'
up into the scripts directory (eg cgi-bin) on your web server. If
you access this from a browser, it will tell you where it is running
from. From this you know what the local cgi-bin root path is, and
you should be able to work out the local html root path as well.
An example competition directory name of /tipping has been used,
though you can call it what you like.
Basically, install.pl does the following:
- Creates a directory /tipping under the html (sometimes called
htdocs) directory.
- Creates a directory /tipping/images under the html directory.
- Creates a directory /tipping/reports under the html directory.
- Copies all the images from the /images directory in the tar.gz
file into the above images directory.
- Creates a directory /tipping under the cgi-bin directory.
- Creates a directory /tipping/data under the cgi-bin directory
directory.
- Creates a directory /tipping/style under the cgi-bin directory
directory.
- Copies all the files from the /cgi-bin directory in the tar.gz
file into the above /tipping directory and set permissions as
follows:
.cgi = 544
.pl = 664
To set permissions on a unix machine, the chmod command is
usually used. An example of doing this for the .cgi files is:
chmod 544 *.cgi
- Copies all the files from the /style directory in the tar.gz
file into the above /tipping/style directory and set permissions
as follows:
.fra = 664
.tpl = 644
- Creates a new 'site.pl' which is places in the above /tipping
directory, having written the required pathing information in
it. A copy of an example site.pl for a unix machine is below.
- Copies all the files from the /data directory in the tar.gz
file into the above /tipping/data directory and sets 664 permissions
on them.
- Creates an index.htm file and puts it in /tipping. You will
not be able to do this step manually, you will have to use the
Web Interface. To do this, enable the "Start Page" option
in the Options dialog of the Web Interface. The next time you
upload
your competition settings, an index.htm will be created for you.
- Changes permission (755) and owner (web browser runs as) on:
/tipping under the html directory
/tipping/reports under the html directory
/tipping/images under the html directory
/tipping/data under the cgi-bin directory
/tipping/style under the cgi-bin directory
To change the owner of a directory on a unix server, the command
chown is normally used. Here is an example on how to set the
tipping directory, where the web server user is 'nobody':
chown nobody.nobody tipping/
If you have problems setting the permissions of the directories
and files, there is a more comprehensive discussion in the Web
edition FAQ.
Example Site.pl for a Unix system
This is based on a web server directory of /home/httpd/. Your site
may be different. Please copy the example below and use it to create
a file called site.pl in the competition's cgi-bin directory (eg /home/httpd/cgi-bin/tipping/),
and change the settings to be relevant for your server.
# Full path to the servers main HTML
# directory root.
$util::htmlroot = '/home/httpd/html';
# Full path to the servers main CGI
# directory root.
$util::cgiroot = '/home/httpd/cgi-bin';
# This is the extension for CGI scripts.
# Needs to be .pl on windows and .cgi
# elsewhere. This is because on PCs,
# the normal association is between .pl
# and perl.exe, whereas on most Unix
# web servers, CGI scipts must have a
# .cgi extension.
$util::cgiext = '.cgi';
# Relative URLs to interesting dirs in
# the server
$util::ftsURL = '/tipping';
$util::imagesURL = '/tipping/images';
$util::reportsURL = '/tipping/reports';
$util::cgiURL = '/cgi-bin';
# Full file paths to some places
$util::htmldir = '/home/httpd/html/tipping';
$util::imagesdir = '/home/httpd/html/tipping/images';
$util::reportsdir = '/home/httpd/html/tipping/reports';
# Relative to cgidir
$util::datadir = 'data';
# Location of template files, can be relative to $util::cgidir
$util::templatedir = 'style';
# The user name the web server runs as
$util::serveruser = 'nobody';
1;
Setting up on Windows NT, 2000 or XP
In the following example, the wwwroot and scripts directories are
off the root of the web server's directories. Your web server 'root'
may be something like c:\inetpub or d:\inetpub\virtual-server-name\.
You can find out your web server root by FTPing the file 'cwd.cgi'
up into the scripts directory on your web server, and renaming it
to cwd.pl. If you access this from a browser, it will tell you where
it is running from. From this you know what the local scripts root
path is, and you should be able to work out the local html root
path as well.
An example competition directory name of /tipping was used, though
you can call it what you like.
Basically, install.pl does the following:
- Creates a directory /tipping under the wwwroot directory.
- Creates a directory /tipping/images under the wwwroot directory.
- Creates a directory /tipping/reports under the wwwroot directory.
- Copies all the images from the /images directory in the tar.gz
file into
the above images directory.
- Creates a directory /tipping under the scripts directory.
- Creates a directory /tipping/data under the scripts directory.
- Creates a directory /tipping/style under the scripts directory.
- Copies all the files from the /scripts directory in the tar.gz
file into the above /tipping directory.
- Copies all the files from the /style directory in the tar.gz
file into the above /tipping/style directory.
- Creates a new 'site.pl' which is places in the above /tipping
directory, having written the required pathing information in
it. A copy of an example site.pl is below.
- Copies all the files from the /data directory in the tar.gz
file into the above /tipping/data directory.
- Creates an index.htm file and puts it in /tipping in the wwwroot
directory. You will not be able to do this step manually, you
will have to use the Web Interface. To do this, enable the "Start
Page" option in the Options dialog of the Web Interface.
The next time you upload your competition settings, an index.htm
will be created for you.
To make sure the permissions on the files are correct so that your
web server, please refer to our Web
edition FAQ.
Example Site.pl for an NT/2000/XP system
This is based on a web server directory of c:\inetpub\. Your site
may be different. Please copy the example below and use it to create
a file called site.pl in the competition's cgi-bin directory (eg c:\inetpub\scripts\tipping\),
and change the settings to be relevant for your server.
# Full path to the servers main HTML
# directory root.
$util::htmlroot = 'c:\inetpub\wwwroot';
# Full path to the servers main CGI
# directory root.
$util::cgiroot = 'c:\inetpub\scripts';
# This is the extension for CGI scripts.
# Needs to be .pl on win95 and .cgi
# elsewhere. This is because on PCs, the
# normal association is between .pl and
# perl.exe, whereas on most Unix web
# servers, CGI scipts must have a .cgi
# extension. If it needs to be changed,
# it will be set in config.pl
$util::cgiext = '.pl';
# Relative URLs to interesting dirs in
# the server
$util::ftsURL = '/tipping';
$util::imagesURL = '/tipping/images';
$util::reportsURL = '/tipping/reports';
$util::cgiURL = '/scripts';
# Full file paths to some places
$util::htmldir = 'c:\inetpub\wwwroot\tipping';
$util::imagesdir = 'c:\inetpub\wwwroot\tipping\images';
$util::reportsdir = 'c:\inetpub\wwwroot\tipping\reports';
# Relative to cgidir
$util::datadir = 'data';
# Location of template files, can be relative to $util::cgidir
$util::templatedir = 'style';
# The user name the web server runs as
$util::serveruser = 'IUSR';
1;
|