Databank installation instructions
From ImageWeb
Databank VM Setup
Virtual machine details
- Ubuntu 10.04.1 32 bit i386
- 512MB RAM
- 8GB Harddrive (all of hard disk not allocated at the time of creation)
- Network: NAT
- 1 processor
- hostname: databank
- Partition disk – guided – use entire disk and set up LVM
- Full name: Databank Admin
- username: databankadmin
- password: ****
- NO encryption of home dir
- No proxy
- No automatic updates
- No predefined software
- Install Grub boot loader to master boot record
Packages Installed
sudo apt-get install build-essential sudo vim /etc/apt/sources.list Add the following repository to the list deb http://archive.canonical.com/ lucid partner sudo apt-get update sudo apt-get install openssh-server sudo apt-get install sun-java6-jdk Accept the licenses sudo apt-get install python-dev sudo apt-get install curl sudo apt-get install links2 sudo apt-get install apache2 sudo apt-get install apache2-utils sudo apt-get install python-setuptools # sudo easy_install pairtree==0.5.6-T sudo easy_install pylons==0.9.7 sudo easy_install repoze.who==2.0a4 sudo easy_install rdflib==2.4.2 sudo easy_install rdfobject sudo easy_install solrpy sudo easy_install uuid # sudo rm -r /usr/local/lib/python2.6/dist-packages/rdflib-3.0.0-py2.6.egg/ sudo apt-get install git-core sudo apt-get install unzip sudo apt-get install python-libxml2 sudo apt-get install python-libxslt1 sudo apt-get install libapache2-mod-wsgi
Installing VMWare tools
Select Install Vmware tools from the VMWare console
sudo mkdir /mnt/cdrom sudo mount /dev/cdrom /mnt/cdrom cd tmp cd /tmp ls -l tar zxpf /mnt/cdrom/VMwareTools-7.7.6-203138.tar.gz vmware-tools-distrib/ ls -l sudo umount /dev/cdrom sudo apt-get install linux-headers-virtual sudo apt-get install psmisc cd vmware-tools-distrib/ sudo ./vmware-install.pl (Accept all of the default options)
Installing Tomcat version 6
NOTE: for the demonstration system, I used the standard Ubuntu installation of Tomcat
ls -l /usr/lib/jvm/java-6-sun
As root, add the following lines to /etc/profile
CATALINA_HOME=/opt/tomcat JAVA_HOME=/usr/lib/jvm/java-6-sun export CATALINA_HOME export JAVA_HOME
exit echo $JAVA_HOME echo $CATALINA_HOME cd /tmp wget http://www.mirrorservice.org/sites/ftp.apache.org/tomcat/tomcat-6/v6.0.32/bin/apache-tomcat-6.0.32.tar.gz ls -l tar xzvf apache-tomcat-6.0.32.tar.gz ls -l sudo mv apache-tomcat-6.0.32 /opt/tomcat ls -l /opt/tomcat/ cd /opt/tomcat/bin/
Start tomcat and check the installation was fine
./startup.sh links2 http://localhost:8080 ./shutdown.sh
Installing Solr
cd /tmp/ wget http://apache.favoritelinks.net//lucene/solr/1.4.1/apache-solr-1.4.1.tgz ls -l tar xzvf apache-solr-1.4.1.tgz ls -l apache-solr-1.4.1/dist/ ls -l /opt/tomcat/webapps/ cp apache-solr-1.4.1/dist/apache-solr-1.4.1.war /opt/tomcat/webapps/solr.war ls -l apache-solr-1.4.1/example/solr/ sudo cp -r apache-solr-1.4.1/example/solr/ /opt/solr ls -l /opt/solr/ sudo chown -R databankadmin:databankadmin /opt/solr/ ls -l /opt/solr/ ls -l /opt/
Modify catalina.sh to increase RAM and define the solr home directory. Add the following line to the top of the file
CATALINA_OPTS="-Xmx512m -Dsolr.solr.home=/opt/solr"
cd /opt/tomcat/bin/ ./startup.sh links2 http://localhost:8080/solr
Installing Redis (http://redis.io/)
cd /tmp wget http://redis.googlecode.com/files/redis-1.2.6.tar.gz ls -l tar xzf redis-1.2.6.tar.gz ls -l sudo cp -r redis-1.2.6 /opt/redis sudo chown -R databankadmin:databankadmin /opt/redis/ cd /opt/redis/ make
Run the redis server to see that it is working fine
./redis-server
Install the python redis client (https://github.com/andymccurdy/redis-py)
sudo easy_install redis==1.34.1
Install RecordSilo (pull from Github)
cd ~ mkdir git-src cd git-src git clone git://github.com/anusharanganathan/RecordSilo.git cd RecordSilo/dist/ sudo easy_install RecordSilo-0.4.11-py2.6.egg
Copy RDFDatabank (pull from Github)
145 cd /opt/ 148 sudo git clone git://github.com/anusharanganathan/RDFDatabank.git 150 sudo chown -R databankadmin:databankadmin /opt/RDFDatabank/
Configure RDFDatabank
Create a password file Create a file 'passwd' in the root directory of the application using 'htpasswd' or similar:
151 cd RDFDatabank/ 152 htpasswd -c passwd admin
[enter admin password]
Edit the production.ini file In the file production.ini, edit the granary root with the IP address / domain name of your databank instance. Also, change the solr endpoint (especially the port to 8080, if you used Tomcat)
Edit the file users.py Edit the file rdfdatabank/config/users.py. Add any users you wish to access or work with this application. This has a variable _USERS used by ./rdfdatabank/lib/ident_md.py which would best be replaced by a DB lookup or similar. For now, adjust it to suit your users. The important thing is the 'role'.
Check the settings in who.ini
Edit the dispatch.wsgi file In the mod_wsgi/dispatch.wsgi file, edit the location of your databank source in packages resources, cache dir and pylons application ini file (production.ini). The directory egg-cache is used by python to unpack egg files
Edit the apache file in sites-available. The location of dispatch.wsgi nneds to be edited as per your installation (NOTE: I created a file in /var/log/apache2/).
175 cd /opt 176 sudo mkdir apachelog 177 sudo chown -R databankadmin:databankadmin /opt/apachelog/
178 cp docs/solr_config/conf/schema.xml ../solr/conf/ 179 cp docs/solr_config/conf/solrconfig.xml ../solr/conf/ 180 cd tomcat/bin/ 181 ./startup.sh
Copy the apache site to sites-available. Edit the site details (location of databank). Enable mod wsgi and the site databank_wsgi
201 sudo cp RDFDatabank/docs/apache_config/databank_wsgi /etc/apache2/sites-available/ 202 ls -l /etc/apache2/sites-available/ 203 ls -l /etc/apache2/sites-enabled/ 204 a2dissite 000-default 181 sudo a2enmod mod_wsgi 205 sudo a2ensite databank_wsgi
Change permission, so www-data has access
233 sudo chown -R databankadmin:www-data apachelog/ 234 sudo chown -R databankadmin:www-data RDFDatabank/ 235 sudo chown -R databankadmin:www-data solr/
Start redis-server in a screen
screen cd /opt/redis ./redis-server ctrl-a ctrl-d (to detatch the screen)
Restart apache
239 sudo /etc/init.d/apache2 restart
Pylons testing
To test pylons and dump messages on the command line
sudo /etc/init.d/apache2 stop
sudo paster serve development.ini
(the url has to be 0.0.0.0 and port 80 in the ini file)

