Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Multiexcerpt macro
nameSETUPENVIRONMENTVARIABLES

Setting the CollectionSpace Environment Variables

For the CollectionSpace server to install and run properly, it requires the following shell environment variables to be defined for the collectionspace user account. Ensure that the following values correspond to the collectionspace user's shell environment. In the next paragraph, we provide instructions for setting these environment variables automatically when you login as the collectionspace user.

  • CSPACE_JEESERVER_HOME: The full path to the apache-tomcat-8.5.51 directory that was created when you unpacked the CollectionSpace tarball; example, "/opt/collectionspace/apache-tomcat-8.5.51"
  • CATALINA_HOME: The full path to the apache-tomcat-8.5.51 directory, usually 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 example value for this variable in the next section is a Java Virtual Machine (JVM) memory setting.
  • JAVA_HOME: The full path to your Java 8 directory.

  • DB_HOSTThe hostname or IP address of the server running PostgreSQL. (Commonly 'localhost' when running on the same machine as tomcat)
  • DB_PORT:  The port for the Postgresql servicer. Usually 5432
  • DB_CSADMIN_PASSWORD: The password for the administrative database user for the CollectionSpace application. This must match the password for the user that you specified while setting up PostgreSQL in the prerequisites section. (This administrative user by default will be named csadmin, and will be a postgresql 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 databases. Nuxeo is 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 authentication and authorization.
  • 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 databases.
  • CSPACE_INSTANCE_ID: String appended to default CollectionSpace database names. Use a value of "_default" by default. If your instance of CollectionSpace is sharing a PostgreSQL server with other CollectionSpace instances, this environment variable provides a way to distinguish your databases from others.
  • JEE_PORT: The HTTP port for the Services layer. Usually 8180
  • ANT_OPTS: Environment options for the Apache Ant build tool. The recommended options below are Java Virtual Machine (JVM) memory settings.
  • MAVEN_OPTS: Environment options for the Maven build tool. The recommended options below are Java Virtual Machine (JVM) memory settings.

By default, all but the "core" CollectionSpace tenants/profiles are disabled. You'll need to explicitly enable the tenants you want to use by setting environment variables for them.

  • CSPACE_CORE_CREATE_DISABLED_OPT: Default value is true. If set to false, enables the core/common tenant.
  • CSPACE_ANTHRO_CREATE_DISABLED_OPT: Default value is true. If set to false, enables the Anthropology tenant.
  • CSPACE_BONSAI_CREATE_DISABLED_OPT: Default value is true. If set to false, enables the Bonsai tenant.

  • CSPACE_BOTGARDEN_CREATE_DISABLED_OPT: Default value is true. If set to false, enables the Botanical Garden tenant.
  • CSPACE_FCART_CREATE_DISABLED_OPT: Default value is true. If set to false, enables the Fine and Contemporary Art tenant.
  • CSPACE_HERBARIUM_CREATE_DISABLED_OPT: Default value is true. If set to false, enables the Herbarium tenant.
  • CSPACE_LHMC_CREATE_DISABLED_OPT: Default value is true. If set to false, enables the Local History and Material Culture tenant.
  • CSPACE_MATERIALS_CREATE_DISABLED_OPT: Default value is true. If set to false, enables the Materials tenant.
  • CSPACE_PUBLICART_CREATE_DISABLED_OPT: Default value is true. If set to false, enables the Public Art tenant.

Your CollectionSpace instance can be configured to fetch data from another CollectionSpace instance. For example, the Materials profile/tenant can be configured to fetch shared authority and vocabulary data from a CollectionSpace instance that is set up to share common authority data. The following environment variables can used to create a connection to that CollectionSpace instance.

  • CSPACE_CLIENT_SAS_URL_OPT: The URL to the "shared" CollectionSpace instance -e.g., https://core.dev.collectionspace.org:8180/cspace-services/

  • CSPACE_CLIENT_SAS_USER_OPT: A username for an account on the "shared" CollectionSpace instance.

  • CSPACE_CLIENT_SAS_PASSWORD_OPT: The password for the account on the "shared" CollectionSpace instance.

  • CSPACE_CLIENT_SAS_SSL_OPT: Set to true if the "shared" CollectionSpace instance is running SSL/HTTS.

The example below is for a Linux Bash shell. As the collectionspace user, edit ~/.bashrc (or ~/.bash_profile) and be sure to substitute the actual values for that are specific to your environment. Log in as the collectionspace user:

Now edit the .bashrc file:

Add the following lines of text to the end of the .bashrc file:

bashtrue

Save your changes and exit the vim editor. Next, make sure to source your ~/.bashrc so the environment variables are set and available. The next time you login to the collectionspace account, these environment variables will be set automatically.

WARNING: Use difficult to guess values for the password environment variables above -i.e., the ones ending with "_PASSWORD". The value for the environment variable DB_CSADMIN_PASSWORD should be the password you created when you setup PostgreSQL in a previous section of this installation guide.

...

If successful, you should see output that looks something like this:

Code Block
HTTP/1.1 200 
CacheVary: Origin
Vary: Access-Control-Request-Method
Vary: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0Access-Control-Request-Headers
Set-Cookie: JSESSIONID=24D1AC4DA8CFDA0DE2D144C2D3971889; Path=/cspace-services; HttpOnly
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
X-Frame-Options: DENY
X-Content-Type
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: nosniffDENY
Content-Type: application/xml
Content-Length: 560580
Date: ThuTue, 2219 JunMar 20232024 1917:3933:3227 GMT

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns2:system_info_common xmlns:ns2="http://collectionspace.org/services/systeminfo"><displayName>CollectionSpace Services v7v8.2<0</displayName><instanceId>_default</instanceId><version><major>7<instanceId><version><major>8</major><minor>2<major><minor>0</minor><patch>0<minor><patch>0-SNAPSHOT</patch><build>0cb870d<patch><build>c049973</build></version><javaVersionString>1.8.0_362<402</javaVersionString><host>Architecture:amd64aarch64 Name:Linux Version:6.5.15.0-75-generic<13-orbstack-00122-g57b8027e2387</host><hostTimezone>UTC</hostTimezone><hostLocale>en-US</hostLocale><hostCharset>UTF-8</hostCharset></ns2:system_info_common>

...