Installing on Mac OS X 10.8 and later
Last tested on (possibly with earlier CollectionSpace release):
February 2013 with OS X 10.8.2.
Installing Prerequisites
Make sure you are a logged in as a user with Administrative rights and sudo privileges.
Installing Xcode
Beginning with OS X 10.9 ("Mavericks"), it may be possible (as yet unverified) for you to install the XCode command line tools via a single command, rather than having to complete all of the steps below. SeeInstalling Homebrew in Mac OS X 10.9 (Mavericks). Tools for compiling and building source code aren't included by default on recent versions of Mac OS X. Apple's free Xcode suite of tools provides these tools, and you will first need to install it. To install Xcode and its command line tools:App Store
application. (You can find it in your /Applications
folder.)/Applications
folder.)System Component Installation
screen.Preferences ...
from the Xcode
menu.Downloads
icon.Command Line Tools
from the Downloads->Components
tab.
Updating Mac OS X
Select Software Update...
from the Apple menu. Among other things, this will guide you through:
- Updating Mac OS X to version 10.8.2, or to whatever may be the latest version of Mac OS X 10.8 ("Mountain Lion") as of this writing.
- Applying the latest Apple security updates to your operating system.
Performing a Software Update will also help ensure that you will have updated copies of certain other CollectionSpace installation prerequisites, such as the Ant and Maven build tools.
Installing Java
To install Java 7:
- Visit Oracle's Java SE download page
- Click any of theÂ
Java Platform (JDK) 7u... Download
 buttons on that page. - Click theÂ
Accept License Agreement
 button. - Follow the next steps described in Oracle's guide, How do I install Java for my Mac?:
- One minor but important change from that guide: you'll be downloading a file whose name begins withÂ
jdk
, rather thanÂjre
 as described in the guide.Â
(As of this writing, the file you will want to download is namedÂjdk-7u13-macosx-x64.dmg
: the Java Development Kit (JDK) for Java 7 Update 13.)
- One minor but important change from that guide: you'll be downloading a file whose name begins withÂ
Installing ImageMagick
ImageMagick is a graphics package required by the CollectionSpace system for displaying and manipulating images.
Linux users have the benefit of using built-in package managers - tools that install software packages - to install many of the necessary prerequisites for installing CollectionSpace.
Mac OS X does not come with a built-in package manager. Instead, the following steps will first install Homebrew, an easy and lightweight package manager, as a means to install ImageMagick.
Run the Homebrew install script:
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
For more information on installing Homebrew, see the "Install Homebrew" section of the Homebrew home page.
Next, install Git, a fast version control system used by Homebrew, to initiate the installation of ImageMagick:
brew install git
Next, install a package that includes a shared library required by ImageMagick:
brew install libtool --universal
Finally, install ImageMagick:
brew install imagemagick
If you plan to upload TIFF images to your CollectionSpace system, you may need to instead:
brew install libtiff brew install imagemagick --with-libtiff
If for any reason your ImageMagick installation via Homebrew fails, try:
- Diagnosing Homebrew issues by entering
brew doctor
inside your Homebrew Library directory (e.g. inside/usr/local/Library
on some systems), and resolving any issues found by following the instructions provided. - Using a third-party ImageMagick installer from Cactuslab. This installation includes TIFF support.
Installing the PostgreSQL database server
REQUIRED: Although the next steps are in a separate page, they are mandatory for the install to work.
Follow the instructions for installing and setting up the PostgreSQL server on this page. After installing and setting up the PostgreSQL server, return to this page and complete the remaining CollectionSpace-related installation steps below.
Installing CollectionSpace
Getting CollectionSpace
Go to the directory where you want to install CollectionSpace:
cd /usr/local/share
Download the tarball:
wget https://s3-us-west-2.amazonaws.com/cs-public-shared-files/releases/5.1/cspace-server-5.1.tar.gz
Unpack tarball:
tar zxvof {multi-excerpt-include:pageTitle=VERSION INCLUSIONS|name=TARBALL-NAME|nopanel=true}
This will create an apache-tomcat-7.0.57 directory.
Your account will need to have write permission to the newly-created apache-tomcat-7.0.57 directory and all of its subdirectories. You can test this by trying to touch
 or edit a file in that directory tree (but make sure you are not currently su or sudo).
If you do not have write permissions, you can chown -R the entire directory tree to your user; e.g. sudo chown -R myusername:mygroup apache-tomcat-6.0.33
Optionally remove the tarball:
rm cspace-server-5.1.tar.gz
Make necessary files executable:
chmod u+x apache-tomcat-7.0.57/bin/*.sh
Setting up CollectionSpace
You need an administrative user in PostgreSQL that CollectionSpace can use: one that has been granted full privileges and can grant privileges to other users. Either set up a new user account (recommended), or you can use the postgres
 user that you set up in the prerequisites section of this page. The values myusername
 and mypassword
, below, should be replaced by the actual username and password of this user.
Set up environment variables. Make sure that the following values correspond to your environment:
Tip
The names of three environment variables changed between CollectionSpace versions 4.0 and 4.1. In addition, one new environment variable was added, and one old variable was deleted. These changes are reflected in the instructions below. See Updating environment variables when migrating to CollectionSpace 4.1 or higher for details.
CSPACE_JEESERVER_HOME: The full path to the apache-tomcat-7.0.57 directory that was created when you unpacked the CollectionSpace tarball.
CATALINA_HOME: The full path to the apache-tomcat-7.0.57 directory, identical to the value of CSPACE_JEESERVER_HOME.
CATALINA_PID: The full path to a file which will hold the Tomcat server process number. This is used by the Tomcat shutdown script.
CATALINA_OPTS: Environment options for the Tomcat server process. The recommended options below are Java Virtual Machine (JVM) memory settings which permit allocation of up to 1 GB of RAM to the Java heap and up to 384 MB of RAM for Java Permanent Generation (PermGen) space.
JAVA_HOME: The full path to your Java directory. Apple recommends that you set this to the output of running the command /usr/libexec/java_home
, and by entering that command surrounded with backticks (`), as shown below, you can do that automatically.
DB_CSADMIN_PASSWORD: The password for the administrative database user for the CollectionSpace application. This must match the password for that user that you specified while setting up PostgreSQL, via the instructions in PostgreSQL Installation under Linux. (This administrative user by default will be named csadmin
, and will be a superuser. However, this user will have fewer privileges than the overall database administrator superuser, by default named postgres
.)
DB_NUXEO_PASSWORD: Any database-legal password of your choice for the nuxeo
 database user. This user can work with CollectionSpace data stored in Nuxeo, the content management system underlying CollectionSpace.
DB_CSPACE_PASSWORD: Any database-legal password of your choice for the cspace
 database user. This user can work with CollectionSpace data for users, roles, and access permission.
DB_READER_PASSWORD: Any database-legal password of your choice for the reader
 database user. This user will have read-only access to CollectionSpace data stored in Nuxeo.
ANT_OPTS: Environment options for the Apache Ant build tool. The recommended options below are Java Virtual Machine (JVM) memory settings which permit allocation of up to 768 MB of RAM to the Java heap and up to 512 MB of RAM for Java Permanent Generation (PermGen) space.
MAVEN_OPTS: Environment options for the Maven build tool. The recommended options below are Java Virtual Machine (JVM) memory settings which permit allocation of up to 768 MB of RAM to the Java heap and up to 512 MB of RAM for Java Permanent Generation (PermGen) space.
The example below is for the Bash shell; edit ~/.bashrc
 or ~/.bash_profile
 and be sure to substitute the actual values for your environment:
export CSPACE_JEESERVER_HOME="/usr/local/share/apache-tomcat-7.0.57" export CATALINA_HOME=$CSPACE_JEESERVER_HOME export CATALINA_PID="$CSPACE_JEESERVER_HOME/bin/tomcat.pid" export CATALINA_OPTS="-Xmx1024m -XX:MaxPermSize=384m" \# Note that the JAVA_HOME declaration below uses backticks (`), rather than double quote marks: export JAVA_HOME=`/usr/libexec/java_home` export DB_CSADMIN_PASSWORD="your_csadmin_database_user_password_here" export DB_NUXEO_PASSWORD="your_nuxeo_database_user_password_here" export DB_CSPACE_PASSWORD="your_cspace_database_user_password_here" export DB_READER_PASSWORD="your_reader_database_user_password_here" export ANT_OPTS="-Xmx768m -XX:MaxPermSize=512m" export MAVEN_OPTS="-Xmx768m -XX:MaxPermSize=512m"
If you added these lines to ~/.bashrc
, to ensure these environment variables are present in every new login shell, edit or create the ~/.bash_profile
 file and add the following line to that file:
. ~/.bashrc
Next, the path for PostgreSQL's binaries need to be added to the shell PATH environment.
Mac OS X sets the PATH environmental variable not in ~/.bashrc
 as would be the case in other Linux based OS's but in /etc/paths
.
/etc/paths
 is read-only so you'll need the sudo
 command to save any edits :
sudo vi /etc/paths
Note:Â vi
 is a sample file editor found in Mac OS X but others, like pico
 or emacs
 can be used as well.
The PATH variable below should reflect the path for PostgreSQL's bin/ directory, which is defaulted to /Library/PostgreSQL/9.1/bin
. Change this to reflect your PostgreSQL installation path if you have a custom installation.
Add the following line to the top of the file:
/Library/PostgreSQL/9.1/bin
(If you've installed a version of PostgreSQL other than 9.1, change the version number in the path above accordingly.)
Opening a new Terminal.app window and typing env
 will show a list of all environmental variables.Â
In order to make a newly-created tenant fully functional, you must initialize data for that tenant. The process of initializing data involves reading configuration files in CollectionSpace's Application layer and, from that configuration, creating: The process of initializing authorities and vocabularies/term lists involves two steps: For instance, when you install a brand-new CollectionSpace system, you'll need to initialize data for the demonstration For Linux, Mac OS X, and other Unix-like systems, there is also a shell script available to automate the process of initializing default authorities and term lists for one or more tenants. You can optionally run that script as an alternative to the manual process described above.Initializing default authorities and term lists
1. Logging into the tenant in which you wish to initialize data.
2. Visiting a specific URL to begin the initialization process. (You'll then see on-screen messages describing its progress.)core
tenant. To do so:http://<ip-address>:8180/collectionspace/tenant/core/authorities/initialise
You can optionally choose to populate a CollectionSpace tenant with a set of sample records. These include over 2,000 authority term records for persons and organizations. Typically you would only populate a demonstration or "play" tenant with sample records, to avoid intermingling sample records with "real" records. To populate the demonstration This process of adding sample data is time consuming - it can take 20 minutes or more. During that time, you will see a succession of progress messages in your browser window.Populating with sample records
core
tenant with sample records:http://<ip-address>:8180/collectionspace/tenant/core/reset
Enabling access logging - which is turned off by default - is a recommended best practice. Logging accesses to your CollectionSpace system can often help you troubleshoot configuration, operational, security, and performance issues. To enable access logging: Uncomment the (Optional) To add round-trip timings to access log entries, identifying how long each request to your CollectionSpace system took to process and send a response, change the value of the Procedure
$CSPACE_JEESERVER_HOME/conf/server.xml
(or %CSPACE_JEESERVER_HOME%\conf\server.xml
on a Windows system).AccessLogValve
directive in this file, by removing any XML comment markers (<!--
and –>
) that may be present around that section:<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="localhost_access_log." suffix=".txt" pattern="common" resolveHosts="false"/>
pattern=
attribute from "common"
to the pattern value below, exactly as shown:<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="localhost_access_log." suffix=".txt" pattern="%h %l %u %t "%r" %s %b %T" resolveHosts="false"/>