Skip to content

vitrolib install commands

Jim Blake edited this page Dec 21, 2016 · 20 revisions

Commands to use when installing Vitrolib

These commands are mentioned in the VitroLib Installation video, and are included here for your convenience. You can reach this page by either of these URLs:

Installing pre-requisites

Java

Is Java installed?

java -version

Install OpenJDK, version 8

sudo yum install java-1.8.0-openjdk-devel

Git

Is Git installed?

git --version

Install Git

sudo yum install git

Maven

Is Maven installed?

mvn --version

Is Maven available to yum?

yum search maven

Make Maven available to yum. (Only if the previous command failed)

sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo \
     -O /etc/yum.repos.d/epel-apache-maven.repo
sudo sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo

Install Maven

sudo yum install apache-maven

Reset Java preferences

sudo alternatives --config javac
sudo alternatives --config java

Tomcat

Create the tomcat group. (This will do nothing if the group already exists.)

sudo groupadd tomcat

Create the tomcat user ID in the tomcat group. (Again, if the user already exists, this will have no effect.)

sudo useradd tomcat -g tomcat

Install Tomcat

sudo yum install tomcat7 tomcat7-webapps

Start Tomcat

sudo service tomcat7 start

Stop Tomcat

sudo service tomcat7 stop

Where is Tomcat installed? (Tomcat must be running.)

ps -ef | grep tomcat

Create setenv.sh

cd /usr/share/tomcat7/bin
sudo touch setenv.sh
sudo chgrp tomcat setenv.sh
sudo vi setenv.sh

Contents of setenv.sh

export CATALINA_OPTS="-Xms2G -Xmx2G"

MySQL

Is MySQL installed?

mysql --version

Install MySQL

sudo yum install mysql-server

Ensure that MySQL start when the system is re-booted.

sudo chkconfig mysqld on

Make MySQL more secure

/usr/libexec/mysql55/mysql_secure_installation

Start MySQL

sudo service mysqld start

Installing Vitrolib

Add your account to the tomcat group (use your own account name instead of my_account)

sudo usermod -a -G tomcat my_account

Create the distribution directory (use your own path for distribution directory instead of /path/to/vitrolib_distribute, and your own account name instead of my_account)

sudo mkdir /path/to/vitrolib_distribute
sudo chown my_account:tomcat /path/to/vitrolib_distribute
sudo chmod g+rw /path/to/vitrolib_distribute
sudo chmod g+s /path/to/vitrolib_distribute
cd /path/to/vitrolib_distribute

Clone the source repositories

git clone https://github.com/ld4l-labs/Vitro.git -b vitrolib/master
chgrp -R tomcat Vitro
chmod -R g+rw Vitro
chmod g+s `find Vitro -type d`
git init --bare --shared=all Vitro

git clone https://github.com/ld4l-labs/vitrolib.git -b master
chgrp -R tomcat vitrolib
chmod -R g+rw vitrolib
chmod g+s `find vitrolib -type d`
git init --bare --shared=all vitrolib

Create the settings file

cp vitrolib/installer/example-settings.xml vitrolib-settings.xml
vi vitrolib-settings.xml

Create the vitrolib home directory (use the location that you selected instead of /path/to/vitrolib_home)

sudo mkdir /path/to/vitrolib_home
sudo chown tomcat:tomcat /path/to/vitrolib_home/

Run the installation script

cd vitrolib
sudo -u tomcat mvn install -s ../vitrolib-settings.xml

Create the database

mysql -u root -p
CREATE DATABASE vitrodb CHARACTER SET utf8;
GRANT ALL ON vitrodb.* TO 'vitrolibUser'@'localhost' IDENTIFIED BY 'vitrolibPass';

Set the runtime properties

Use the location that you selected instead of /path/to/vitrolib_home

cd /path/to/vitrolib_home/config/
sudo -u tomcat cp example.applicationSetup.n3 applicationSetup.n3

cd /path/to/vitrolib_home/
sudo -u tomcat cp config/example.runtime.properties runtime.properties
sudo -u tomcat vi runtime.properties

Starting and stopping VitroLib

Start Tomcat

sudo service tomcat7 start

Enter this location in your browser (use the hostname or IP address of your server instead of my.server)

http://my.server:8080/vitrolib

Stop Tomcat

sudo service tomcat7 stop

Troubleshooting

Looking at the log file (use your Tomcat location instead of path/to/tomcat)

cd /path/to/tomcat/logs
grep StartupManager vitrolib.all.log
grep ERROR vitrolib.all.log

Using curl

curl --head http://localhost:8080/vitrolib
curl http://localhost:8080/vitrolib