Java Development Kit
- If you do not have Java SE (Standard Edition) Development Kit 6.0 or later already installed, you will need to download and install it from Java SE Downloads first.
Apache Tomcat
- Download Apache Tomcat.
- Both versions 6.0 and 7.0 are used for development and / or testing.
- Install Apache Tomcat
MySQL
- Download MySQL from MySQL Downloads
- MySQL version 5.5 and Oracle version 11g are currently being used in development and testing.
- Install MySQL
Installation
- Download the latest UniTime 3.4 distribution from UniTime Downloads
- All distributions are platform independent, distributed in either .zip or .tar.gz format
- Alternatively, you can download the most recent nightly build from UniTime Nightly Builds
- Unzip the archive
tar -xvzf unitime-3.4_bld199.tar.gz
- Install timetable database
- MySQL installation scripts are located in doc/mysql folder of the distribution
- File schema.sql contains the database schema, file woebegon-data.sql contains test data (Woebegon College Test Suite, see Online Demo for more details).
- If you want to change the default user name / password, edit the file schema.sql first. The user is created at the very beginning of the script.
- Timetable database can be created and populated using the mysql command line tool
- After running "schema.sql", you need to populate the database either using "woebegon-data.sql" or "blank-data.sql" file
- When woebegon-data are used, you will be able to login into the application using the same credentials as described on our online demo page
- When blank-data are used, there is only administrator account created. Both user name and password are admin.
mysql -uroot -p -f <schema.sql
mysql -uroot -p <woebegon-data.sql
- Deploy UniTime application
- Copy web/UniTime.war to Tomcat/webapps, where Tomcat is the folder where Tomcat is installed.
- On unix based systems (including Mac OS X), java virtual machine that is running tomcat needs to be switched to headless mode. You can do that using JAVA_OPTS environment variable prior to starting tomcat:
export JAVA_OPTS="${JAVA_OPTS} -Djava.awt.headless=true"
- Also, you might need to give Tomcat more memory to work with by changing the upper limit on the memory that it can allocate (especially if you are planning not to run any remote solver servers -- see below; default is 64MB). You can do that using JAVA_OPTS environment variable as well:
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024m"
- Tip: If you have installed Tomcat on a linux based machine from a package (e.g., by running apt-get install tomcat7), you will need to make sure that there is a data folder available within the tomcat directory and that the Tomcat has enough permissions to write files in there. This can be accomplished with something like:
mkdir /var/lib/tomcat7/data chown tomcat7 /var/lib/tomcat7/data
- Tomcat configuration (including the JAVA_OPTS variable) is located in the /etc/default/tomcat7 file in this case.
Upgrade
- To upgrade an existing UniTime installation, only the new UniTime.war file should be placed in the Tomcat/webapps folder instead of the existing one. All the necessary changes to the database are done automatically during the first deployment. The most safe way to do so is as follows:
- Stop tomcat
- Backup the existing database (e.g., using mysqldump on MySQL or exp on Oracle)
- In Tomcat/webapps, remove UniTime folder and replace the existing UniTime.war with the new one
- Delete the content of Tomcat/work folder.
- Start the tomcat
- If you are using remove solver servers, the appropriate JARs needs to be updated as well.
- If upgrading from UniTime 3.3
Customization
- Custom Properties
- There are a lot of properties that are defined in file application.properties that is located in timetable.jar that is located in UniTime.war at WEB-INF/lib. These properties can be changed in one of the following ways:
- By providing custom property file, this file should be named custom.properties and located in UniTime.war at WEB-INF/classes.
- Alternatively, custom property file can be located somewhere else, with system property tmtbl.custom.properties pointing to it.
- By adding and/or changing the appropriate properties directly in the UniTime application -- see Administration / Defaults / Configuration menu item when logged in as administrator.
- By adding these properties in Tomcat/conf/catalina.properties
- By providing JVM that is running tomcat with the appropriate system properties, for instance:
export JAVA_OPTS="${JAVA_OPTS} -Dtmtbl.title=Timetabling Demo"
export JAVA_OPTS="${JAVA_OPTS} -Dtmtbl.custom.properties=~/my.properties
- Tip: Name the custom properties file Tomcat/conf/unitime.properties and put all the properties you need in there. For UniTime to use the file, add the following line to Tomcat/conf/catalina.properties
tmtbl.custom.properties=${catalina.base}/conf/unitime.properties
- If the same property is defined on multiple places, the first one from the following order will be taken:
- UniTime Configuration (Administration / Defaults / Configuration menu item)
- System property (-Dproperty=value, or defined in Tomcat/conf/catalina.properties)
- File custom.properties (UniTime.war/WEB-INF/classes/custom.properties or as defined by tmtbl.custom.properties system property)
- File application.properties (UniTime.war/WEB-INF/lib/timetable.jar/application.properties)
- Database Connection
- Database connection can be changed using custom properties. However, please note that these properties cannot be defined using the UniTime application (Administration / Defaults / Configuration menu item), since the database connection needs to be configured before the database can be accessed. For instance, custom.properties file can contain:
# MySQL Configuration Example
connection.url=jdbc:mysql://localhost:3306/timetable
connection.username=timetable
connection.password=unitime
connection.driver_class=com.mysql.jdbc.Driver
dialect=org.hibernate.dialect.MySQLInnoDBDialect
tmtbl.uniqueid.generator=org.hibernate.id.TableHiLoGenerator
default_schema=timetable
Remote Solver Server(s)
- By default, all timetabling problems are solved within the application (using the same Java Virtual Machine), however, especially for bigger institutions, it might be desired to solve the timetabling problems by one or more separate solver servers. To run a remote solver, do:
java -Xmx1024m -jar solver/timetable.jar host:9998
or
java -Xmx1024m -jar solver-min/solver.jar host:9998
Parameter host is the name of the machine where the web server is executed. The difference between the two distributions is that solver-min contains only the necessary classes to connect to the web server. The rest are downloaded using a special class loader. Communication between the web server and the solver server is done using SLL. The solver servers also communicate directly with the database for loading input data and saving the solution. Database connection properties are taken from the web server. The load is automatically and seamlessly balanced between the remote solvers. The remote solver server also automatically reconnects itself when the web server is restarted. When the remote solver is shut down, all active timetabling instances are backed up and restored when the solver server is started again. The following properties can be defined (and passed as system properties):
- tmtbl.solver.register.port
- web server listens on this port for all remote solvers to connect (same port needs to be defined on both sides, default is 9998)
- tmtbl.solver.remote.port
- a remote solver accepts commands on this port, during start up it binds itself on this port or on the first available port after this port (default is 1200)
- tmtbl.solver.register.host
- host name of the web server (default is localhost)
- tmtbl.solver.home
- directory where the remote solver will put its files (logs, backuped or passivated problem instances, etc.)
- tmtbl.custom.properties
- location of custom property file (see above)
Example:
java -Xmx1024m -Dtmtbl.solver.home=~/solver -jar solver-min/solver.jar host:9998
The remote solvers can be managed in the UniTime application, see Timetables / Manage Solvers menu item when logged in as an administrator.
Using Oracle Database
Here are some notes about using Oracle Database
- The following custom properties needs to be set (connection url, username, password may vary)
# Oracle Configuration Example
connection.url=jdbc:oracle:thin:@localhost:1521:xe
connection.username=timetable
connection.password=unitime
connection.driver_class=oracle.jdbc.driver.OracleDriver
dialect=org.hibernate.dialect.Oracle10gDialect
tmtbl.uniqueid.generator=org.hibernate.id.SequenceGenerator
- If the schema is different to timetable, the default_schema property needs to be changed as well
default_schema=timetable
- File ojdbc5.jar (or later) needs to be copied either to Tomcat/common/lib (if Tomcat 5 is used, where Tomcat is the folder where Tomcat is installed), Tomcat/lib (it Tomcat 6 is used), or in Tomcat/webapps/UniTime/WEB-INF/lib. This file can be downloaded, e.g., from Oracle10g JDBC Drivers
- Oracle installation scripts are located in doc/oracle folder of the distribution
- Alternatively, the database can be imported using imp tool and the woebegon.dat from the CVS.
imp timetable/###### file=woebegon.dat full=y
- User timetable needs to be created first, e.g., using sqlplus
sqlplus system create user timetable identified by ######;
grant dba to timetable;
exit
Notes- The UniTime application can be deployed on JBoss Application Server or, in theory, on any other J2EE server
- Here are the UniTime 3.2 Installation notes on Debian Lenny (using Oracle XE 10g)
- Here are the UniTime 3.3 Installation notes on Debian Squeeze (using Oracle XE 10g)
|
|