Manually setting up the webfrontend

 

Back to FAQ

 

As a last resort...

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.

Unix instructions   Windows instructions

 

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:

  1. Creates a directory /tipping under the html (sometimes called htdocs) directory.
  2. Creates a directory /tipping/images under the html directory.
  3. Creates a directory /tipping/reports under the html directory.
  4. Copies all the images from the /images directory in the tar.gz file into the above images directory.
  5. Creates a directory /tipping under the cgi-bin directory.
  6. Creates a directory /tipping/data under the cgi-bin directory directory.
  7. Creates a directory /tipping/style under the cgi-bin directory directory.
  8. 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

  9. 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

  10. 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.
  11. 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.
  12. 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.
  13. 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 a Windows Web Server
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:

  1. Creates a directory /tipping under the wwwroot directory.
  2. Creates a directory /tipping/images under the wwwroot directory.
  3. Creates a directory /tipping/reports under the wwwroot directory.
  4. Copies all the images from the /images directory in the tar.gz file into
    the above images directory.
  5. Creates a directory /tipping under the scripts directory.
  6. Creates a directory /tipping/data under the scripts directory.
  7. Creates a directory /tipping/style under the scripts directory.
  8. Copies all the files from the /scripts directory in the tar.gz file into the above /tipping directory.
  9. Copies all the files from the /style directory in the tar.gz file into the above /tipping/style directory.
  10. 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.
  11. Copies all the files from the /data directory in the tar.gz file into the above /tipping/data directory.
  12. 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 a Windows 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;


Back to FAQ