All Versions
- DSpace 7.x (Current Release)
- DSpace 8.x (Unreleased)
- DSpace 6.x (EOL)
- DSpace 5.x (EOL)
- More Versions...
Contribute to the DSpace Development Fund
The newly established DSpace Development Fund supports the development of new features prioritized by DSpace Governance. For a list of planned features see the fund wiki page.
Frontend (UI) Installation Guide for 7.0 or 7.1 ONLY
In DSpace 7.0 and 7.1, the Frontend installation required configuring your UI before you could build the UI. This required a slightly different installation process, and this installation process required a full rebuild whenever configurations changed. The configuration file and several scripts also had different names. This page provides a guide for those who are still on 7.0 or 7.1.
This guide will not work for 7.2!
If you are running DSpace 7.2 (and later), you MUST instead following the new Frontend Installation process documented at Installing DSpace. The new Frontend Installation instructions are easier and also allow you to rebuild/redeploy with minimal downtime.
Yarn v1.x is available at https://classic.yarnpkg.com/. It can usually be install via NPM (or through your Linux distribution's package manager). We do NOT currently support Yarn v2.
# You may need to run this command using "sudo" if you don't have proper privileges npm install --global yarn
PM2 is very easily installed via NPM
# You may need to run this command using "sudo" if you don't have proper privileges npm install --global pm2
dspace-7.0 or dspace-7.1
) or branch.Install all necessary local dependencies by running the following from within the unzipped "dspace-angular" directory
# change directory to our repo cd dspace-angular # install the local dependencies yarn install
Create a Production Configuration file at [dspace-angular]/src/environments/environment.prod.ts
. You may wish to use the environment.common.ts
as a starting point. This environment.prod.ts
file can be used to override any of the default configurations listed in the environment.common.ts (in that same directory). At a minimum this file MUST include a "rest" section (and may also include a "ui" section), similar to the following (keep in mind, you only need to include settings that you need to modify).
export const environment = { // The "ui" section defines where you want Node.js to run/respond. It often is a *localhost* (non-public) URL, especially if you are using a Proxy. // In this example, we are setting up our UI to just use localhost, port 4000. // This is a common setup for when you want to use Apache or Nginx to handle HTTPS and proxy requests to Node on port 4000 ui: { ssl: false, host: 'localhost', port: 4000, // NOTE: Space is capitalized because 'namespace' is a reserved string in TypeScript nameSpace: '/' }, // This example is valid if your Backend is publicly available at https://api.mydspace.edu/server/ // The REST settings MUST correspond to the primary URL of the backend. Usually, this means they must be kept in sync // with the value of "dspace.server.url" in the backend's local.cfg rest: { ssl: true, host: 'api.mydspace.edu', port: 443, // NOTE: Space is capitalized because 'namespace' is a reserved string in TypeScript nameSpace: '/server' } };
yarn config:check:rest
This script will attempt a basic Node.js connection to the REST API that is configured in your "environment.prod.ts" file and validate the response.yarn start
" and trying to access it via http://[mydspace.edu]:4000/
from your web browser. KEEP IN MIND, we highly recommend always using HTTPS for Production.environment.common.ts
configuration file you can also copy them into this same file.Build the User Interface for Production. This uses your environment.common.ts
and the source code to create a compiled version of the UI in the [dspace-angular]/dist
folder
yarn run build:prod
environment.prod.ts
, then you will need to rebuild the UI application (i.e. rerun this"yarn run build:prod" command).Assuming you are using PM2, create a JSON configuration file describing how to run our UI application. This need NOT be in the same directory as the dspace-angular codebase itself (in fact you may want to put the parent directory or another location). Keep in mind the "cwd" setting (on line 5) must be the full path to your [dspace-angular]
folder.
{ "apps": [ { "name": "dspace-angular", "cwd": "/home/dspace/dspace-angular", "script": "yarn", "args": "run serve:ssr", "interpreter": "none" } ] }
yarn run serve:ssr.
This is the command that starts the app (after it was built using yarn run build:prod
)Using Windows? This "dspace-angular.json" file needs to have a slightly different structure on Windows. First, all paths must include double backslashes (e.g. C:\\dspace-angular). Second, "cluster" mode is required. Finally, because of a known issue in PM2, you must point the "script" at the "npm/node_modulesyarn/bin/yarn.js" file directly. So, here's how this configuration looks on Windows platforms:
{ "apps": [ { "name": "dspace-angular", "cwd": "C:\\path\\to\\dspace-angular", "script": "C:\\path\\to\\npm\\node_modules\\yarn\\bin\\yarn.js", "args": "run serve:ssr", "interpreter": "none", "exec_mode": "cluster" } ] }
Now, start the application using PM2 using the configuration file you created in the previous step
# In this example, we are assuming the config is named "dspace-angular.json" pm2 start dspace-angular.json # To see the logs, you'd run # pm2 logs # To stop it, you'd run # pm2 stop dspace-angular.json
environment.prod.ts
yarn start
(which is a simple build & deploy process for the UI). This command might provide a more specific error message to you, if PM2 is not giving enough information back.sudo apt install apache2
sudo en2mod proxy; sudo a2enmod proxy_http
Now, setup a new VirtualHost for your site (preferably using HTTPS / port 443) which proxies all requests to PM2 running on port 4000.
<VirtualHost _default_:443> .. setup your host how you want, including log settings... SSLEngine on SSLCertificateFile [full-path-to-PEM-cert] SSLCertificateKeyFile [full-path-to-cert-KEY] # Proxy all HTTPS requests from Apache to PM2 on port 4000 # NOTE that this proxy URL must match the "ui" settings in your config.prod.yml ProxyPass / http://localhost:4000/ ProxyPassReverse / http://localhost:4000/ </VirtualHost>
[dspace-angular]/config/ssl/
folder and add a key.pem
and cert.pem
to that folder (they must have those exact names)