-
Notifications
You must be signed in to change notification settings - Fork 2
Setup
-
Prerequisites
JDK 1.7
Make sure you are using JDK 1.7 -- running
java -versionshould output something like:java version "1.7.0_10" Java(TM) SE Runtime Environment (build 1.7.0_10-b18) Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)
If you are using JDK 1.6 or before, download JDK 1.7 from Oracle: http://www.oracle.com/technetwork/java/javase/downloads/index.html
Image Magick and Ffmpeg for derivatives processing (we recommend using Homebrew:
brew install imagemagick brew install ffmpeg
-
Database
- MySQL
Install MySQL.
brew install mysql
Set a root password, and create a new database and user:
$ mysqladmin -u root password ABC $ mysql -uroot -pABC mysql> create database dams; mysql> grant all privileges on *.* to 'dams'@'localhost' identified by 'XYZ';
- PostgreSQL
Install PostgreSQL
brew install postgresql
Setup DAMS database and user:
$ sudo -u postgres psql postgres=# create user tomcat with password 'dams'; postgres=# create database dams owner tomcat; postgres-# \q
-
Environment
Create a directory to hold DAMS Repo config and files. Add DAMS_HOME environment variable to your shell environment (e.g., ~/.bash_profile):
DAMS_HOME=/pub/dams
Close any open terminal windows or run ". ~/.bash_profile"
Clone private_config repo from stash:
git clone ssh://git@lib-stash.ucsd.edu:7999/ND/private_config.git
Copy private_config/gimili/dams.properties to this directory and edit to match your local settings.
Setup Ant build.properties
catalina.home=/pub/tomcat deploy.home=${catalina.home}/webapps xsl.home=/pub/dams/xsl -
Tomcat
Download Tomcat 7
http://tomcat.apache.org/download-70.cgi
Edit Tomcat conf/server.xml and add to the GlobalNamingResources:
<Environment name="dams/home" value="/pub/dams" type="java.lang.String"/> <Resource name="jdbc/dams" auth="Container" type="javax.sql.DataSource" username="dams" password="XXXX" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/dams" maxActive="10" maxIdle="3" maxWait="5000" validationQuery="select 1" logAbandoned="true" removeAbandonedTimeout="60" removeAbandoned="true" testOnReturn="true" testOnBorrow="true"/>
If using PostgreSQL, use
org.postgresql.Driverfor the driver class name, andjdbc:postgresql://localhost/damsfor the JDBC URL.To enable SSL on port 8443, uncomment and update the SSL connector config:
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true" maxThreads="150" scheme="https" secure="true" keystoreFile="conf/tomcat.keystore" keystorePass="XXXXXXXX" clientAuth="false" sslProtocol="TLS" />
Then generate a keystore in the tomcat/conf/ directory:
keytool -genkey -alias tomcat -keyalg RSA -keystore tomcat.keystore -validity 3650
When prompted, enter the same password as the keystorePass parameter above, and fill answer the questions about the name/organization creating the keystore (the answers to these aren't important).
Add a user to tomcat/conf/tomcat-users.xml:
<?xml version='1.0' encoding='utf-8'?> <tomcat-users> <role rolename="dams-repository"/> <user username="lib-app-damspas" password="XXXXXXXX" roles="dams-repository"/> </tomcat-users>
Start Tomcat.
-
Solr
Create solr home directory with solr.war file, solr.xml and a core with Hydra's config. These can be copied from hydra-jetty:
cp -a jetty/solr /pub/solr cp jetty/webapps/solr.war /pub/solr/solr.war
Deploy solr deployment descriptor to tomcat/conf/Catalina/localhost/solr.xml:
<Context docBase="/pub/solr/solr.war" debug="0" crossContext="true" > <Environment name="solr/home" type="java.lang.String" value="/pub/solr" override="true" /> </Context>
-
ARK minter
In your CGI directory (in MacOSX: /Library/WebServer/CGI-Executables/, in RHEL: /var/www/cgi-bin/), create a Perl script called minter:
#!/usr/bin/perl open( FILE, "<", "minter.dat" ); $num = <FILE>; close FILE; print "Content-Type: text/plain\n\n"; $n = $ENV{'QUERY_STRING'}; unless ( $n ) { $n = 1; } for ( $i = 0; $i < $n; $i++ ) { $num++; print "id: 20775/zz" . sprintf("%08d",$num) . "\n"; } open( FILE, ">", "minter.dat" ); print FILE $num; close FILE;
chmod 755 minterCreate the minter data file:
touch minter.dat chmod a+w minter.dat
Make sure Apache is running by minting an ark:
http://localhost/cgi-bin/minter -
DAMS Repository
Clone this repo:
git clone git@github.com:ucsdlib/damsprivate.git
Copy the MySQL JAR file to the Tomcat lib directory:
cp srb/lib2/mysql-connector-java-5.0.4-bin.jar /pub/tomcat/lib/
Build dams.war and deploy to tomcat
ant clean webapp local-deploy
Initialize events and object triplestores.
tmp/commands/ts-init.sh dams tmp/commands/ts-init.sh events tmp/commands/test_01_init.sh
-
ActiveMQ/DAMSolrizer (Optional)
Download ActiveMQ
http://activemq.apache.org/download.htmlCopy the activemq.xml config file from private_repository
cp private_config/gimili/activemq.xml activemq/conf/
Add ACTIVEMQ_HOME to your environment (.profile, etc.)
export ACTIVEMQ_HOME=/pub/activemqStart the ActiveMQ daemon
$ activemq/bin/activemq start
Uncomment the queue.url and queue.name properties in dams.properties and redeploy DAMS Repo.
Setup DAMSolrizer daemon to index objects from the ActiveMQ queue. This does not need to be on the same server as ActiveMQ (it requires the damspas application, so it could be setup on that machine).
Clone the damspas repo:
git clone git@github.com:ucsdlib/damspas.git
Start the solrizerd daemon, with the hydra_home parameter specifying the damspas application directory, and the host parameter specifying the host ActiveMQ is running on:
RAILS_ENV=localdams /pub/damspas/bin/damsolrizerd start --hydra_home /pub/damspas --host localhost