Installing and Configuring the Dependencies

Thanks to the hard-working developers at UC Berkeley, organizations that use the CollectionSpace platform, “a web-based, open source collections management and information system for museums and other collecting institutions,” can now deploy and extend their very own web applications.  We are going to show you how on a production server

Built on Python’s popular web framework, Django, the web applications are highly customizable. By default, they provide two core features. These are:

  1. the public searching or browsing of an institution’s collections (authorized ip-addresses can be specified by the host server if necessary), and
  2. separate internal applications for authorized users only (e.g. search applications returning sensitive collections information, reporting, or bulk image uploading).

Most of what you need to know, and things you would like to know, can be found on UC Berkeley’s GitHub repository. For deploying the default webapp specifically, you will need to go to their CSpace Django Project. Be sure read what’s published in the readme as familiarizing yourself with the many terms and processes will only help make deployment easier.

We assume that you already have an instance of CollectionSpace running on your desired server. If not, please refer to the CollectionSpace Installation Wiki to learn how.

Installing Dependencies

Step 1: Install the Apache2 web server

Before you do anything, make sure to update any existing packages:

$ sudo apt-get update

In a terminal window, assuming that your current user has sudo permission, run the command:

$ sudo apt install apache2

This will install the Apache2 web server at the directory /etc/apache2.

Start up the Apache2 web server by executing:

$ service apache2 start

You should be prompted with:

“* Starting web server apache2”

Other helpful, self explanatory, commands include:

$ service apache2 [ status | stop | restart ]

By default, the Apache2 web server runs on port 80. With that said, if the installation was successful, navigating to http://<your ip-address> will display the default Apache2 web server page. Use http://localhost if the installation was done on your local machine.

Step 2: Install Apache Solr

Apache Solr is what UC Berkeley web applications use to search and navigate through your CollectionSpace instance. We recommend that you go beyond the documentation we provide here and what has been provided at the CSpace Django Project GitHub repository. You can download and view the full Apache Solr guide at:

https://cwiki.apache.org/confluence/display/solr/Apache+Solr+Reference+Guide.

In brief:

“Solr is highly reliable, scalable and fault tolerant, providing distributed indexing, replication and load-balanced querying, automated failover and recovery, centralized configuration and more.”

Continuing with the installation, in your terminal window, go to your home directory:

$ cd ~

Download the latest version of Apache Solr from Solr’s downloads into your home directory.  As of June 2016, the latest version is 6.1.0.

The file name should be remotely similar to this:

solr-6.1.0.tgz

Copy the link location and execute the following command in your terminal window:

$ wget [paste link here]

For example:

$ wget http://mirrors.ocf.berkeley.edu/apache/lucene/solr/6.1.0/solr-6.1.0.tgz

Once downloaded, go ahead and extract the tar file, replacing “x.y.z” with your downloaded version, specifically extracting the Solr installation script:

$ tar zxf solr-x.y.z.tgz solr-x.y.z/bin/install_solr_service.sh --strip-components=2

Next, install Solr as a service:

$ sudo bash ./install_solr_service.sh solr-x.y.z.tgz

Note: make sure that the current Java version being used by your system meets the dependency requirements for your Solr instance. For release 6.1.0, Solr requires Java version 8. The script will fail otherwise. If you have multiple Java version installed, you can execute the command: sudo update-alternatives –config java to change the version.

If you would like, you can specify various options for the installation.

For example:

$ sudo bash ./install_solr_service.sh solr-x.y.z.tgz -i /opt -d /var/solr -u solr -s solr -p 8983
i = install directory for Solr installation archive

d = install directory for logs, etc (live writable files)

u = user who owns the Solr files

s = the service name, which is solr by default

p = the port solr should bind to

f = for upgrading Solr, overwrites the symlinks and init scripts of old installations. You may need this option if you run into problems with your initial install and would like to try again.

If the command executed successfully, you should be prompted accordingly. For instance:

“ Waiting up to 30 seconds to see Solr running on port 8983 [/]  

Started Solr server on port 8983 (pid=10320). Happy searching!

Found 1 Solr nodes:

Solr process 10320 running on port 8983

{   

“solr_home”:”/var/solr/data”,   

“version”:”6.1.0 4726c5b2d2efa9ba160b608d46a977d0a6b83f94 – jpountz – 2016-06-13 09:46:58″,

“startTime”:”2016-06-28T20:30:56.365Z”,  

“uptime”:”0 days, 0 hours, 0 minutes, 11 seconds”,

“memory”:”16.9 MB (%3.4) of 490.7 MB”

}

Service solr installed.”

To make sure Solr installed correctly, visit http://<your ip-address>:8983/solr/#/

If you see the Solr Admin page, you are in great shape!

Again, we recommend taking some time to review the Solr documentation in order to understand how to leverage the full potential of Solr.

Step 3: Install Python’s Package Manager, PIP and Virtual Environment

Chances are that you already have pip and Python installed on your machine. You can check by executing:

$ python -V

Returning, “Python 2.7.6” (or similar).

Note: For the default UC Berkeley web applications, you’ll need Python 2.7, not 3+.

and

$ pip -V

Returning, “pip 8.1.1 from /usr/local/python2.7/dist-packages (2.7)” (or similar)

If you discover that you do not have one or more of the above, check out the Hitchhiker’s Guide to Python for instructions on how to resolve these dependencies.

Finally, once you have both Python and pip, do:

$ sudo pip install virtualenv

This installs Python’s virtualenv globally, which we will be using in the second part of this blog post.

To summarize the above, you should now have the following dependencies properly installed and running on your server:

  1. A CollectionSpace instance (assumed and not covered in this post)
  2. An Apache2 web server
  3. An Apache Solr instance
  4. Python 2.7.*
  5. Python’s package manager, pip 8.1+
  6. Python’s VirtualEnvWrapper

In part 2 of this blog series, we will show you how to successfully configure Solr, Apache2, the default web application, and its corresponding virtual environment. Until then, if you have any questions regarding CollectionSpace or need help deploying your default web application, please feel free to reach out to us.

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>