Skip to content

Instantly share code, notes, and snippets.

@dchud
Last active August 29, 2015 13:56
Show Gist options
  • Save dchud/8940811 to your computer and use it in GitHub Desktop.
Save dchud/8940811 to your computer and use it in GitHub Desktop.
20-minute guide to installing DSpace-4.0 from binary release on Ubuntu 12.04 LTS
# dchud's 20 minute guide to installing DSpace 4.0 from the binary release
# on a clean ubuntu 12.04 server running on aws ec2 or where-have-you
#
# this guide assumes you are already comfortable with *nix system administration
#
# this guide leaves out anything to do with the many details of configuring
# DSpace itself; it just gets you to the "it's up and running" step
#
# to start: get your clean ubuntu-12.04 system up to date
$ sudo apt-get update && sudo apt-get upgrade
# install necessary dependencies
$ sudo apt-get install openjdk-7-jre openjdk-7-jdk ant postgresql maven2 tomcat7 libapache2-mod-jk
# maven2 brings in openjdk-6-jre, need to select java 7
$ sudo update-alternatives --config java # choose openjdk-7
# enable postgres connections your preferred way:
$ sudo vim /etc/postgresql/9.1/main/pg_hba.conf
# i tend to do it this way, change the last value in the second uncommented
# line (line #90) to "md5":
local all all md5
# save and exit, then restart postgresql
$ sudo service postgresql restart
# use "postgres" account to set up "dspace" account and database in pgsql
$ sudo su postgres
# create a dspace user and database for postgresql
postgres$ createuser -U postgres -d -A -P dspace
postgres$ createdb -U dspace -E UNICODE dspace
# exit the "postgres" account
postgres$ exit
# download the 4.0 binary release
$ wget "http://downloads.sourceforge.net/project/dspace/DSpace%20Stable/4.0/dspace-4.0-release.tar.bz2?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fdspace%2Ffiles%2FDSpace%2520Stable%2F4.0%2F&ts=1391562970&use_mirror=netcologne"
# rename file
$ mv "dspace-4.0-release.tar.bz2?ETC-ETC-ETC" dspace-4.0-release.tar.bz2
# unwrap the renamed file
$ tar xvjf ~/dspace-4.0-release.tar.bz2
# dive on in
$ cd dspace-4.0-release
# pull down dependencies using maven
$ mvn package
# assuming successful build...
$ cd dspace/target/dspace-4.0-build
# set up a system-wide dir for dspace using dspace's preferred layout
$ sudo mkdir /dspace
# give it the right permissions
$ sudo chown -R ubuntu:ubuntu /dspace
# now, build the stuff
$ ant fresh_install
# set up tomcat to use the newly-built dspace webapps via a symlink
# first move the default webapps dir aside
$ sudo mv /var/lib/tomcat7/webapps /var/lib/tomcat7/webapps-orig
# now fake out tomcat with a symlink to dspace's webapps
$ sudo ln -s /dspace/webapps /var/lib/tomcat7/webapps
# to connect tomcat to apache or otherwise on port 80:
$ sudo vim /etc/tomcat7/server.xml
# uncomment AJP connector line (line 95) in tomcat server.xml:
# by "uncomment" i mean remove the leading "<!--" and trailing "-->"
# around this line:
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
# save and exit
# enable the AJP connector module in apache
$ sudo a2enmod proxy_ajp
# edit the apache site config to proxy using this connector:
$ sudo vim /etc/apache2/sites-available/default
# add these two lines near the top of the file, just below the ServerAdmin line
ProxyPass / ajp://localhost:8009/
ProxyPassReverse / ajp://localhost:8009/
# save and exit
# NOTE: this is where it gets hand-wavy. still working on it.
# the key issue is to set write permissions on the dirs listed below
# so that tomcat7 or whichever system user you set up to run dspace
# processes in tomcat can write as needed.
# so perhaps create a group that tomcat7 can join and tomcat7 to it
# then write permissions are required on these dirs with group write:
# /dspace/assetstore
# /dspace/solr/search/index
# /dspace/upload
# /dspace/log
# restart tomcat *after* changing permissions
$ sudo service tomcat7 restart
# then restart apache
$ sudo service apache2 restart
# dspace should be up and running, visit in your browser:
# http://your-server-name/jspui or
# http://your-server-name/xmlui
# create a DSpace e-person with "administrator" group membership
$ /dspace/bin/dspace create-administrator
# answer the questions
# log into your site with the account you just created
# NOTE: dspace configuration goes here
# NOTE: groups, news blocks, identifiers/handles, themeing, etc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment