The following installation guide assumes that you have already installed the MySQL database and Apache Tomcat properly. We are using MySQL3.23.49 and Tomcat4.0. In order to set up Tomcat to use SSL connection, you need an access to a Certificate Authority, e.g. openSSL, to sign the server(Tomcat) certificate.

## Installation Steps

1. Unzip the downloaded the zip file. You should see the following directory structure:

               ustorit_release/
                   |---- build/
                           |---- edu/
                                   |---- stanford/
                                           |---- ....
                   |---- html/
                           |---- index.html
                           |---- IOError.jsp
                   |---- image/
                           |---- folder.gif
                           |---- ....
                   |---- lib/
                           |---- cos-09May2002.jar
                           |---- mm.mysql-2.0.4-bin.jar
                           |---- multipart.jar
                           |---- ....
                   |---- metadata/
                           |---- web.xml
                   |---- mysql_scritps/
                           |---- create.sql
                           |---- drop.sql
                   |---- script/
                           |---- default.js
                   |---- style/
                           |---- defualt.css
                   |---- UserGuide.html
                   |---- InstallGuide.html
                   |---- SetupSSLForTomcat.html

2. Create database and tables.
   1. Assuming MySQL has already been installed, you need to create database for the ustorit. You can choose the database name, say "ustorit".
   2. After the database "ustorit" has been created, you can now prepare for the table creation. First, you need to modify the 2 script files under directory mysql_scripts, i.e. create.sql and drop.sql. Replace every database_name with the real name of the database you just created, "ustorit" in this case. Save the changes and then run the script file to create tables. Please refer to the MySQL menu on how to run the scripts at http://www.mysql.com/documentation/mysql/bychapter/manual_MySQL_Database_Administration.html#Client-Side_Scripts

   For example, change the following line

               CREATE TABLE IF NOT EXISTS database_name.users

   to the following

               CREATE TABLE IF NOT EXISTS ustorit.users

3. Configure the application-wide parameters. Open the file web.xml under the metadata directory, you'll see there are several context-param elements whose values need to be configured. You must provide values for these parameters in order for the application to run, with only one exception to the DatabaseUserPassword. If MySQL admin does not specify a password, then you can leave this value empty.

   For example,

               <context-param>
                   <param-name>DatabaseHost</param-name>
                   <param-value>xyz.stanford.edu</param-value>
               </context-param>
               <context-param>
                   <param-name>DatabaseName</param-name>
                   <param-value>ustorit</param-value>
               </context-param>
               <context-param>
                   <param-name>DatabaseUserName</param-name>
                   <param-value>dbuser</param-value>
               </context-param>
               <context-param>
                   <param-name>DatabaseUserPassword</param-name>
                   <param-value></param-value>
               </context-param>
               <context-param>
                   <param-name>UStoritRootDir</param-name>
                   <param-value>/ABC</param-value>
               </context-param>
               <context-param>
                   <param-name>UStoritAdminEmail</param-name>
                   <param-value>admin@xyz.stanford.edu</param-value>
               </context-param>

4. Create the application context in Tomcat.
   1. Create a new directory, say "ustorit", under the TOMCAT_HOME/webapps/. Then create directory "WEB-INF" under TOMCAT_HOME/webapps/ustorit/. Then create directory "classes" and directory "lib" under WEB-INF.
   2. Copy the following files "indext.html" and "IOError.jsp" under directory "ustorit_release/html" to "TOMCAT_HOME/webapps/ustorit/".
   3. Copy directory "image/", "script/", "style/",together with the files, under directory "ustorit_release/" to "TOMCAT_HOME/webapps/ustorit/".
   4. Copy directory (together with the classes files) "edu/stanford/...." under the directory "ustorit_release/build/" to "TOMCAT_HOME/webapps/ustorit/WEB-INF/classes".
   5. Copy all the files under the directory "ustorit_release/lib/" to "TOMCAT_HOME/webapps/ustorit/WEB-INF/lib".
   6. Copy file "web.xml" under "ustorit_release/metadata/" to directory "TOMCAT_HOME/webapps/ustorit/WEB-INF/".

   Now you should see the following under the application context directory.

               TOMCAT_HOME/
                   |---- webapps/
                           |---- ustorit/
                                  |---- WEB-INF/
                                           |---- classes/
                                                   |---- edu/
                                                           |---- stanford/
                                                                   |---- ....
                                           |---- lib/
                                                   |---- cos-09May2002.jar
                                                   |---- mm.mysql-2.0.4-bin.jar
                                                   |---- multipart.jar
                                                   |---- ....
                                           |---- web.xml
                                   |---- image/
                                           |---- folder.gif
                                           |---- ....
                                   |---- script/
                                           |---- default.js
                                   |---- style/
                                           |---- defualt.css
                                   |---- index.html
                                   |---- IOError.jsp

5. Add the web application context for ustorit to the server.xml configuration file. Open the server.xml under directory TOMCAT_HOME/conf/. Add the following underneath the context for examples.

               <Context path="/ustorit" docBase="ustorit"
                    debug="0" reloadable="true" crossContext="true">
                   <Logger className="org.apache.catalina.logger.FileLogger"
                           prefix="localhost_ustorit_log." suffix=".txt"
               	        timestamp="true"/>
               </Context>

   If you have not enabled the SSL, please refer to online document on how to configure SSL for tomcat at http://jakarta.apache.org/tomcat/tomcat-4.0-doc/ssl-howto.html

6. Start Tomcat.