Setting up a new server
To run ResourcePlanner, you need a web server, and a copy of MySql server version 4.1 or later. Any web server which will run CGI executables will do, but Apache is probably the simplest to set up (and is free). Currently supported operating systems for the server are x86 Linux and Microsoft Windows. Clients may use any O/S, although full drag and drop functionality is currently only available in selected browsers at the moment.
The instructions that follow assume you are reasonably familiar with installing programs on your server, and running programs from the command line.
Setting up a Linux server
Requirements:
No particular tuning of MySQL is required - all you need is a root or other login with permission to create databases and users.
For Apache, you need to change or add the following settings in the Apache configuration file (usually httpd.conf or apache.conf, in /etc or /etc/httpd or /etc/apache, depending on the distribution of Linux you are running).
- Set the ExecCGI Option in the cgi-bin directory
- Include index.htm in the DirectoryIndex list
- Set a User and Group for Apache to a suitable user and group from /etc/passwd and /etc/group (usually apache, www-data or httpd).
Here are example extracts from httpd.conf:
User apache
Group apache
DocumentRoot /var/www
ServerName resplan
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory "/var/www">
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options ExecCGI
Order allow,deny
Allow from all
</Directory>
DirectoryIndex index.htm index.html
When you have set up your conf file, make a note of the DocumentRoot and ScriptAlias /cgi-bin/ directories (/var/www and /usr/lib/cgi-bin in the example above).
- Create directories for the ResourcePlanner files:
mkdir /var/www/resplan
mkdir /var/www/resplan/logs
mkdir /var/www/resplan/documents
mkdir /var/www/resplan/help
mkdir /var/www/resplan/Images
mkdir /usr/lib/cgi-bin/resplan
mkdir /usr/lib/cgi-bin/resplan/templates
mkdir /usr/lib/cgi-bin/resplan/backups
- Extract the supplied compressed tar file into a temporary directory (say temp):
mkdir temp
cd temp
tar xvzf resplan.tar.z
- Copy the cgi-bin part of ResourcePlanner to the Apache cgi-bin directory:
cp -r temp/cgi-bin/* /usr/lib/cgi-bin/resplan
- Copy the html part of ResourcePlanner to the Apache document root directory:
cp -r temp/www/* /var/www/resplan
- Change the ownership and permissions on all the copied files (you will need to be root to do this):
chmod g+w /var/www/resplan /var/www/resplan/*
chmod g+w /usr/lib/cgi-bin/resplan/backups
chown apache /var/www/resplan /var/www/resplan/*
chown apache /usr/lib/cgi-bin/resplan/backups
chgrp apache /var/www/resplan /var/www/resplan/*
chgrp apache /usr/lib/cgi-bin/resplan/backups
- For backup and restore to work, the following programs must be on the PATH and runnable by the Apache user:
- mysql (MySQL command-line client)
- mysqldump (MySQL command-line backup utility)
- gzip (GNU compression utility - www.gzip.org)
- zcat (GNU decompression utility - www.gzip.org)
- sed (for editing the backup file for portability between MySQL versions - Unix standard program)
- mpack (for emailing the backup attachment - ftp://ftp.andrew.cmu.edu/pub/mpack/)
The MySQL programs come with MySQL, and can be found int he MySQL binary directory. The others either come as standard with your version of Linux, or can be installed as optional packages.
- Set up a cron job to process recurring tasks every 24 hours:
crontab -e
Insert a line containing:
48 0 * * * cd /usr/lib/cgi-bin/resplan; /usr/lib/cgi-bin/resplan/recurringtasks.cgi
This sets up recurring tasks processing to happen at 48 minutes after midnight every night. Some Linux distributions come with preinstalled cron scripts which run every night (called crontab.daily, or similar) - you may prefer to add the command to this script instead.
- See also Configuring ResourcePlanner below.
Setting up a Microsoft Windows server with Apache
Requirements:
No particular tuning of MySQL is required - all you need is a root or other login with permission to create databases and users.
For Apache, you need to change or add the following settings in the Apache configuration file (C:\Program Files\apache group\apache2\conf\httpd.conf), and you need to make sure Apache is running as a service.
- Set the ExecCGI Option in the cgi-bin directory
- Include index.htm in the DirectoryIndex list
Here are example extracts from httpd.conf:
DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs"
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory "C:/Program Files/Apache Group/Apache2/htdocs">
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ "C:/Program Files/Apache Group/Apache2/cgi-bin/"
<Directory "C:/Program Files/Apache Group/Apache2/cgi-bin/">
AllowOverride None
Options ExecCGI
Order allow,deny
Allow from all
</Directory>
DirectoryIndex index.htm index.html
When you have set up your conf file, make a note of the DocumentRoot and ScriptAlias /cgi-bin/ directories (C:/Program Files/Apache Group/Apache2/htdocs and C:/Program Files/Apache Group/Apache2/cgi-bin/ in the example above).
- Extract the supplied Zip file into C:/Program Files/Apache Group/Apache2.
- For backup and restore to work, the following programs and libraries must be copied to the ResourcePlanner executable folder (C:/Program Files/Apache Group/Apache2/cgi-bin/resplan/ in the examples above):
- mysql.exe (MySQL command-line client)
- mysqldump.exe (MySQL command-line backup utility)
- libmysql.dll (MySQL client library)
- gzip.exe (GNU compression utility - www.gzip.org)
- zcat.exe (GNU decompression utility - www.gzip.org)
- mpack.exe (for emailing the backup attachment - ftp://ftp.andrew.cmu.edu/pub/mpack/)
The MySQL ones can be found in "C:\Program Files\MySQL\MySQL Server 4.1\bin\". The others are freely downloadable programs.
- Set up a scheduled task to process recurring tasks every 24 hours. The command is C:\Program Files\Apache Group\Apache2\cgi-bin\recurringtasks.cgi, and it should run in directory C:\Program Files\Apache Group\Apache2\cgi-bin every day (ideally just after midnight, if the server is left on overnight).
- See also Configuring ResourcePlanner below.
Tips:
- Notice that in the Apache configuration file, the path separator is /, not the more usual Windows standard \.
- If Apache won't run as a server, it could be that you have some other service listining on port 80 (the default port for web servers). MSN Messenger and Skype are among the programs which can be configured to do this - you will need to go into their options to stop them listening on port 80. Also, you will need to open port 80 for Apache on any personal firewall you may be running.
- If you have changed your document root and/or cgi-bin directories in your Apache configuration, you will need to extract the Zip file to your new location(s).
Setting up a Microsoft Windows server with IIS
Requirements:
- MySql database server 4.1 or later, from www.mysql.com.
- IIS HTTP Server (on your Windows CD, accessable using Control Panel|Add Remove Programs|Add/Remove Windows Components).
No particular tuning of MySQL is required - all you need is a root or other login with permission to create databases and users.
- Extract the supplied Zip file into C:\inetpub\wwwroot (or your web site home directory, if this is different).
- Move the folder C:\inetpub\wwwroot\htdocs\resplan into C:\inetpub\wwwroot. You can then delete C:\inetpub\wwwroot\htdocs.
- Open the Windows Firewall to allow connections to IIS (or to port 80) (see Windows Firewall in Control Panel).
- Set up a virtual directory called cgi-bin with execute permission...
- Right-click on My Computer
- Select Manage
- Navigate to Services and Applications\Internet Information Server\Web Sites\
- Right-click in the right hand pane
- Select New|Virtual Directory
- Enter cgi-bin as the directory name
- Enter C:\inetpub\wwwroot\cgi-bin as the path
- Tick Execute (such as ISAPI applications or CGI)
- Add write permissions to the logs and backup directories
- Open My Computer
- Navigate to C:\inetpub\wwwroot\resplan
- Right-click, and select New|Folder
- Create a folder called logs
- Right-click on the folder, and choose Properties
- Select the Security tab
- Choose Internet Guest Account in the top pane
- Check the Allow check box in the Write row.
- Allow write access to the C:\inetpub\wwwroot\cgi-bin\resplan\backups folder in the same way.
- For backup and restore to work, the following programs and libraries must be copied to the ResourcePlanner executable folder (C:\inetpub\wwwroot\cgi-bincgi-bin\resplan\):
- mysql.exe (MySQL command-line client)
- mysqldump.exe (MySQL command-line backup utility)
- libmysql.dll (MySQL client library)
- gzip.exe (GNU compression utility - www.gzip.org)
- zcat.exe (GNU decompression utility - www.gzip.org)
- mpack.exe (for emailing the backup attachment - ftp://ftp.andrew.cmu.edu/pub/mpack/)
The MySQL ones can be found in "C:\Program Files\MySQL\MySQL Server 4.1\bin\". The others are freely downloadable programs.
- Set up a scheduled task to process recurring tasks every 24 hours. The command is C:\inetpub\wwwroot\cgi-bin\recurringtasks.cgi, and it should run in directory C:\inetpub\wwwroot\cgi-bin every day (ideally just after midnight, if the server is left on overnight).
- See also Configuring ResourcePlanner below.
Creating a new plan
Start mysql as root (or another user with full privileges), and perform the following commands:
CREATE DATABASE demo;
GRANT ALL PRIVILEGES ON demo.* TO 'resplan'@'%';
SET PASSWORD for 'resplan' = PASSWORD('SteveLee');
The above commands assume you wish to create a new database called >demo, and your standard ResourcePlanner SQL user name and password are resplan and SteveLee respectively.
Now you have created the database, load it with empty tables using the following command:
mysql -uresplan -pSteveLee demo <resplan.create.sql
You also need to add a URL to your home page to point to the new plan, which should look like this:
<A HREF="http://your.server.com/resplan/?DBNAME=demo">Resource Planner</A>
Configuring ResourcePlanner
You will find a file called ".resplan.cfg" in your /resplan directory - this contains configuration information for ResourcePlanner. It can be edited with any text editor, and contains the following configuration variables:
- CGI_DIR
- This should be set to the pathname of the Apache (or other web server) cgi-bin directory, followed by "/resplan/" - e.g. /usr/lib/cgi-bin/resplan/ or C:/Program Files/Apache Group/Apache2/cgi-bin/resplan/.
- WWW_DIR
- This should be set to the pathname of the Apache (or other web server) document root directory, followed by "/resplan/" - e.g. /var/www/resplan/ or C:/Program Files/Apache Group/Apache2/htdocs/resplan/.
- TEMPLATE_DIR
- This should be set to the ResourcePlanner template directory - e.g. /usr/lib/cgi-bin/resplan/templates/ or C:/Program Files/Apache Group/Apache2/cgi-bin/resplan/templates/.
- DOC_DIR
- This should be set to the relative path from the document root to the directory where documents are stored - e.g. documents/.
- LOGFILE
- This should be set to the absolute path where resplan should store its debug log file - e.g. /var/www/resplan/logs/resplan.log or C:/Program Files/Apache Group/Apache2/htdocs/resplan/logs/resplan.log.
- ERRFILE
- This should be set to the absolute path where resplan should store its error log file - e.g. /var/www/resplan/logs/errors.log or C:/Program Files/Apache Group/Apache2/htdocs/resplan/logs/errors.log.
- DBHOST
- This should be set to the host name of the MySQL server - e.g. localhost.
- DBNAME
- This should be set to the database name to connect to if none is supplied in the ResourcePlanner URL - e.g. demo.
- DBUSER
- This should be set to the user name to connect to the MySQL server - e.g. resplan.
- DBPASS
- This should be set to the password for MySQL - e.g. SteveLee.
- DBPORT
- This should be set to the port number MySQL is running on, or 0 for the default - e.g. 0.
- EXPIRE_INTERVAL
- This should be set to the length of time before a user's login will time out for inactivity - e.g. 1 HOUR. Note this interval is in MySQL DATE_ADD format, so the interval may be MINUTE, HOUR, DAY, MONTH or YEAR (always singular, not plural)
Note that all the directory variables MUST end with a slash / character.
Customizing ResourcePlanner
The entire user interface of ResourcePlanner is contained in HTML pages, either in the resplan directory in the document root, or in the resplan/templates directory under cgi-bin. The help is in resplan/help in the document root. All the web pages use CSS (Cascading Style Sheets), so the look and feel can easily be customized. The templates allow more detailed changes to be made to the information shown on all the dynamic pages, and even the main menu can be changed.
A customization document which explains all the styles used, all the template tokens, etc. is available from [email protected].
Of course, if you customize these files, your customizations will be overwritten if you upgrade ResourcePlanner to the next version - you need to keep track of your changes with a tool such as CVS.