change localhost to the server ip when listening DSpace 7.4 !

508 views
Skip to first unread message

Alex Perez

unread,
Nov 22, 2022, 11:46:14 AM11/22/22
to DSpace Technical Support
Hello everyone, I ask for your help with the following case that I find myself in. I already have a version of DSpace 7.2.1 with Ubuntu Server 20.04 LTS, it was already implemented in July 2022 and it works correctly, it already has https through port 8443 and everything is fine with this server, but it happens that we have decided to update to version DSpace 7.4 with Ubuntu Server 22.04 LTS already has many improvements according to the documentation https://wiki.lyrasis.org everything was going well with the installation and configuration until I get to the part where it should see the published port 4000 to connect to the external as this should work like this for a published government institution.

But in this installation, port 4000 is only listening on the (127.0.0.1) localhost and I can have it, but only locally, as seen in the photo that I attached.


DSpace.PNG

Listen localhost.PNGListen IP address.PNG

My question would be how do I change that the listener is the IP address of the server, in this case 192.168.100.118 and not the localhost.

After several attempts I have not been able to change it and make it listen:

192.168.100.118:4000 instead of 127.0.0.1:4000 as it currently is.

I already changed the parameters of my files local.cfg, config.prod.yml, allow cors, etc/hosts etc



Thank you very much in advance for any help you can give me.



dspace7.4_version.mp4

Mohammad S. AlMutairi

unread,
Nov 22, 2022, 3:21:49 PM11/22/22
to DSpace Technical Support
Hello

I think it got hard coded to use localhost in recent versions so just leave it running on the loopback adapter and use a reverse proxy to talk to it. Use the steps you see in the attached file as hints and make sure tomcat is set to run on port 8080.

Good luck

example.txt

Mohammad S. AlMutairi

unread,
Nov 22, 2022, 6:03:18 PM11/22/22
to DSpace Technical Support
I had to try it on DSpace version 7.5-SNAPSHOT and it's working just fine without any SSL configuration (HTTP Setup) so it's not hard coded as I thought. See the attached video as a confirmation. Try to pull a fresh copy of dspace-angular and start a front end fresh installation.

Settings in dspace.cfg
dspace.server.url = http:// 192.168.100.212:8080/server
dspace.ui.url = http://192.168.100.212:4000

Settings in config.prod.yml:
ui:
  ssl: false
  host: 192.168.100.212
  port: 4000
  nameSpace: /

rest:
  ssl: false
  host: 192.168.100.212
  port: 8080
  nameSpace: /server

2022-11-23_1-59-33.mp4

Alex Perez

unread,
Nov 25, 2022, 8:04:58 AM11/25/22
to DSpace Technical Support
Hello friends, I followed the steps you indicate me I reinstalled the frontend and the video gave me an idea of what to do and work correctly thank you very much for the help.

Regards
25-11-22.mp4

Mohammad S. AlMutairi

unread,
Nov 25, 2022, 4:01:18 PM11/25/22
to DSpace Technical Support
Hello Alex,

Glad you had it worked & You welcome. You might need to use a reverse proxy in your environment instead. That's what DSpace documentation recommends and that's how most of the people using DSpace 7 are setting it up.

Alex Perez

unread,
Dec 26, 2022, 4:35:49 PM12/26/22
to DSpace Technical Support
Problem Blocked CORS  https / http


Hello friends I hope you are very well, I would like to ask for help with the following already set up my DSpace server in a test environment and then get to do production and works well the backend communicates well with the frontend on port 8443 I set it in Tomcat 9. 58 and use the Reverse Proxy for port 4000 in Apache2 and pass the address of locahost:4000 add the module a2enmod headers to send the policy "X-Forwarded-Proto: https" so far so good but when loading the site https://ride2.tse.go.cr where the proxy is responsible for redirecting to port 4000 the CORS policy blocks me from sites like "https://api7.dspace.org/server/api", https://api7.dspace.org/server/api/config/properties/registration.verification.enabled ".  
 I do not know what else can be changed to correct this blocking CORS and already load my site as it does instantly and then already sends an error 500 that I could not correct in this version in 7.2 I did not pass that and worked fine.

thank you very much in advance for the help you can give me



--
All messages to this mailing list should adhere to the Code of Conduct: https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx
---
You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dspace-tech...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dspace-tech/dd632e3d-837a-44aa-90e7-e37cf6671e70n%40googlegroups.com.

Alex Perez

unread,
Dec 26, 2022, 5:29:54 PM12/26/22
to DSpace Technical Support


error3.PNG

Mohammad S. AlMutairi

unread,
Dec 26, 2022, 6:40:18 PM12/26/22
to DSpace Technical Support
Hello Alex,

I need you to send me these files. I'll modify them for you.

  1. /etc/tomcat9/server.xml
  2. local.cfg
  3. config.prod.yml
  4. dspace.conf

Cheers

Rupinder Singh

unread,
Mar 3, 2023, 6:08:48 AM3/3/23
to DSpace Technical Support
Hi everyone 
this is what I tried and resolved this issue 
edit your local.cfg file 
and search for the parameter where dspace UI URL is defined 
it should be something like this 

dspace.ui.url = http://{your IP Address}:4000
below this line add the following directive 
rest.cors.allowed-origins = ${dspace.ui.url}  

Restart your tomcat service and try accessing the dspace over the network via the server IP address. 
It should work just fine. 

Thanks 
Rupinder Singh
Assistant Librarian 
Central University of Punjab
Reply all
Reply to author
Forward
0 new messages