Database and AVH Web Application

1. Download the following applications and install them in the AVH server machine: It is assumed that the person installing the MySQL server has some MySQL administration knowledge. The person installing the AVH application is expected to know how to give permissions to users to access the avh database from the machine hosting the AVH portal.
 * Java 1.5
 * Jakarta Tomcat 5.5+
 * MySQL 5.0+ with InnoDB

2. Login as the root user or as a user who has permissions to create databases in machine hosting the AVH database. Create a database called avh in the MySQL server.

CREATE DATABASE avh;

Give permissions to the user@host who will be accessing that database.

GRANT ALL PRIVILEGES ON avh.* TO 'user'@'host' IDENTIFIED BY 'password' WITH GRANT OPTION;

Note that in the development version of the AVH application, we used 'gbif' as the user and 'webdev.sapac.edu.au' as the host. The values you have used in the above command will also have to be reflected in the Hibernate configuration file (hibernate.cfg.xml). Remember to modify this file to whatever values you have used in the GRANT command.

3. Create the avh tables in the avh database: Running of the command below assumes that you are inside the avh dist application directory. For example,

$ mysql -u gbif -D avh -h webdev.sapac.edu.au -p < db_scripts/new_db.sql

4. Modify the db_scripts/data.sql file so that the line under line 15 reflects the username, password, email and other information of the AVH administrator. The password of the AVH admin user can be modified later on using the Maintain User interface in the AVH portal.

5. Initialize the tables: Running of the command below assumes that you are inside the avh web application directory. $ mysql -u gbif -D avh -h webdev.sapac.edu.au -p < db_scripts/new_data.sql

6. Copy the avh web application war file to $CATALINA_HOME/webapps/ directory.

7. As JDK1.4 includes an old version of xalan, copy xalan.jar from avh/WEB-INF/lib into tomcat_dir/common/endorsed. This can be ignored for JDK 5.

8. In order to generate images in servlet, two changes need to be done.
 * add export CATALINA_OPTS="-Djava.awt.headless=true" to $CATALINA_HOME/bin/catalina.sh
 * add /usr/X11R6/lib to LD_LIBRARY_PATH

9. Modify the hibernate.cfg.xml file.
 * The "hibernate.connection.url" property needs to be modified to whatever URL the AVH database will be running on.
 * The "hibernate.connection.username" property needs to be modified to the username that can be used to connect to the AVH database.
 * The "hibernate.connection.password" property needs to be modified to the password of the username.

10. Modify the AVH configuration file, avhProperty.properties.
 * Property "mapserverName" is the URL for MapServer, eg. http://webdev.sapac.edu.au.
 * Property "mapfilePath" is the actual path of avh.map file, eg. /var/www/html/avh/.
 * Property "symbollist" lists out icons used by the map.
 * Property "smtpHost" is the SMTP server that is used to send system emails, eg. smtp.adelaide.edu.au.
 * Property "smtpPort" is the port of SMTP server, eg. 25.
 * Property "adminEmail" is the email address used as the sender of system emails.
 * Property "adminName" is the name appears on any email sent by the system.
 * Property "agreementCookieTime" is the expiration time(in hours) of the cookie of public users.
 * Property "startAvhTimer" is a boolean value indicating if indexing thread is started when starting tomcat, eg. true/false.
 * Property "startCollectingTime" is the starting time(24 hour format), e.g. 6 means 6am.
 * Property "interval" is the interval between incremental updates, e.g. 1 means 1 day.
 * Property "tmpFolder" is the location to put temporary files of queries.
 * There are a bunch of limits for different kind of queries.

11. Run the tomcat server by typing the following command in the command line: $ $CATALINA_HOME/bin/startup.sh

12. Go to the index page of the AVH web portal (http://host:port/avh/) and login as the admin user. Modify administrator's password and Harbarium's information(default data just includes Melbourn and Canberra) if needed.

13. Load a database dump from SAPAC. Since SAPAC is using Mysql 5.0.22-standard with InnoDB, it would be good to install the same version. InnoDB is a must, because the database dump generated by an InnoDB server contains SQL statements with InnoDB features. It will have problems when loading it to a MyISAM storage. To load a dump, just run: mysql -u -p -h -D < dumpfile.sql