Access DSpace 7.1 frontend locally

408 views
Skip to first unread message

Rafael Borges Ferreira Afonso

unread,
Jan 27, 2022, 3:07:50 PM1/27/22
to DSpace Technical Support
Hello, I'm trying to perform local installation of DSpace 7.1.1 on Ubuntu 18.04 server from a virtual machine on a local network initially for testing. This is my second installation attempt, I've tried several different configurations to try to get it to work, but it always crashes at this point. I can access the backend of a machine on the same network through http://10.1.1.11:8080/server, install the frontend that is communicating with the backend (tested by the yarn config:check:rest command), I can compile the frontend with yarn start and finish without errors:

$ dist./node server
[HPM] Proxy created: / -> http://localhost:8080/server/sitemaps
[18:01:54 GMT+0000 (Coordinated Universal Time)] Listening at http://localhost:4000/

But when I try to access the same way as the API by http://10.1.1.11:4000/ I have the ERR_CONNECTION_REFUSED.

I believe that some server configuration is missing, does anyone have something similar? I've had this problem for a few days.

Sorry for the english, it literally came out of google translator.

Tim Donohue

unread,
Jan 27, 2022, 3:26:23 PM1/27/22
to DSpace Technical Support
"ERR_CONNECTION_REFUSED" is a very generic error, so it's unclear what the cause is in this scenario. But, it could be that port 4000 isn't open. I see you accessed the site via an IP address instead of localhost... if the machine at IP 10.1.1.11 is blocking access to port 4000, then you would get a connection refused error.

If you want the UI to be available on a non-localhost URL (e.g. a domain or IP address), you may need to either ensure port 4000 is opened, or install a proxy (like Apache or Nginx) which can redirect requests from a standard port (like 80 or 443) to localhost:4000. There's a basic example of such a proxy in the Installation guide on step 9 : https://wiki.lyrasis.org/display/DSDOC7x/Installing+DSpace#InstallingDSpace-FrontendInstallation

The other option is, if you are just wanting to try out DSpace 7, you can try and access the site using http://localhost:4000/ instead of via an IP address.

If you have further questions, let us know on this list.
Tim

Mohammad S. AlMutairi

unread,
Jan 27, 2022, 11:54:12 PM1/27/22
to DSpace Technical Support
Hello,

Frontend won't be accessible because you running it on the loopback adapter ( localhost - 127.0.0.1 ). With the current frontend setup you can't access the frontend remotely ( sort of ) but you can if you browse from the machine where the frontend is installed. Tim directions is the way to go so don't neglect it if you want to setup your server in a good and clean way for production but if all you need of this configuration is to try out DSpace 7 temporarily you still can get it accessible by the machine IP address if you set:

in local.cfg or dspace.cfg:
dspace.server.url = http://10.1.1.11:8080/server
dspace.ui.url = http://10.1.1.11:4000

in environment.prod.ts
  ui: {
    ssl: false,
    host: '10.1.1.11',
    port: 4000,
    // NOTE: Space is capitalized because 'namespace' is a reserved string in TypeScript
    nameSpace: '/',
    // The rateLimiter settings limit each IP to a "max" of 500 requests per "windowMs" (1 minute).
    rateLimiter: {
      windowMs: 1 * 60 * 1000,   // 1 minute
      max: 500 // limit each IP to 500 requests per windowMs
    }
  },
  // The REST API server settings.
  // NOTE: these must be "synced" with the 'dspace.server.url' setting in your backend's local.cfg.
  rest: {
    ssl: false,
    host: '10.1.1.11',
    port: 8080,
    // NOTE: Space is capitalized because 'namespace' is a reserved string in TypeScript
    nameSpace: '/server',
  },

make sure port 4000 & 8080 is opened in the firewall and can be accessed across the network for this setup to work.

Good luck

Rafael Borges Ferreira Afonso

unread,
Jan 28, 2022, 7:35:52 AM1/28/22
to DSpace Technical Support

Good morning, thanks for the reply Tim Donohue and alo...@gmail.com, your explanation made me see the problem more clearly thank you. The problem really was in environment.prod.ts it was using host as localhost instead of the ip I use to access internally.
Thank you very much again now I can continue the system.

Mohammad S. AlMutairi

unread,
Jan 28, 2022, 10:08:03 AM1/28/22
to DSpace Technical Support
Glad I was of a help to you.

Cheers

Reply all
Reply to author
Forward
0 new messages