All Versions
- DSpace 7.x (Current Release)
- DSpace 8.x (Unreleased)
- DSpace 6.x (EOL)
- DSpace 5.x (EOL)
- More Versions...
...
Table of Content Zone | ||||
---|---|---|---|---|
| ||||
UNIX-like OS or Microsoft Windows
Node.js (v12.x or v14.x)
Yarn (v1.x)
PM2 (or another Process Manager for Node.js apps) (optional, but recommended for Production)
DSpace 7.x Backend (see above)
|
dspace-7.0-beta5
) or branch.Install all necessary local dependencies by running the following from within the unzipped "dspace-angular" directory
Code Block |
---|
# change directory to our repo cd dspace-angular # install the local dependencies yarn install |
Create a Production Configuration file at [dspace-angular]/src/environment/environment.prod.ts
. You may wish to use the environment.template.ts
as a starting point. This environment.prod.ts
file can be used to override any of the default configurations specified in the environment.common.ts (in that same directory). At a minimum this file MUST include the "ui" and "rest" sections similar to the following (keep in mind, you only need to include settings that you need to modify):
Code Block |
---|
export const environment = { // This example is valid if your UI will be publicly available at httpshttp://mydspace.edu/ // Keep in mind, this usually should be the PUBLIC URL (it should match the URL you will enter in your browser):4000/ // It should also be kept in sync with the value of "dspace.ui.url" in the backend local.cfg (otherwise the backend may not trust your UI) ui: { ssl: truefalse, host: 'mydspace.edu', port: 4434000, // 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/ // It should 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 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.prod.ts
and the source code to create a compiled version of the UI in the [dspace-angular]/dist
folder
Code Block |
---|
yarn run build:prod |
environment.prod.ts
, then you will need to rebuild the UI application (i.e. rerun this 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.
Code Block | ||||
---|---|---|---|---|
| ||||
{ "apps": [ { "name": "dspace-angular", "cwd": "/home/angulardspace/dspace-angular", "script": "yarn", "args": "run serve:ssr", "interpreter": "none" } ] } |
Now, start the application using PM2 using the configuration file you created in the previous step
Code Block |
---|
# In this example, we are assuming the config is named "dspace-angular.json" pm2 start dspace-angular.json # To see stopthe itlogs, you'd run # pm2 stop logs # To stop it, you'd run # pm2 stop dspace-angular.json |
Start the application
Code Block |
---|
# build and start the application
yarn start |
environment.prod.ts
After a few minutes, the user interface will be running on your local machine. Visit http://localhost:4000/[dspace-angular]/config/ssl/
folder and add a key.pem and cert.pem. Then update your "port" and "ssl" settings and rebuild (and restart the app in PM2)After a successful installation, you may want to take a closer look at
...