change localhost to the server ip when listening DSpace 7.4 !

1,564 views
Skip to first unread message

Alex Perez

unread,
Nov 22, 2022, 4:46:14 PM11/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, 8: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, 11: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, 1:04:58 PM11/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, 9: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, 9: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, 10:29:54 PM12/26/22
to DSpace Technical Support


error3.PNG

Mohammad S. AlMutairi

unread,
Dec 26, 2022, 11: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, 11: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

suresh patil

unread,
Jul 24, 2024, 7:24:22 AM7/24/24
to DSpace Technical Support
Hi Rupinder,

i have added below part


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


still the website shows 500 error when tried to access from other system within the LAN (it works fine with the {your IP Address}:4000 from the system where DSpace is installed)

Thanks

suresh patil

unread,
Jul 24, 2024, 8:56:28 AM7/24/24
to DSpace Technical Support
Any changes required to be done in the following files apart from local.cfg  & config.prod.yml


/etc/tomcat9/server.xml
dspace.conf

On Friday, March 3, 2023 at 4:38:48 PM UTC+5:30 Rupinder Singh wrote:

suresh patil

unread,
Jul 26, 2024, 8:51:31 AM7/26/24
to DSpace Technical Support
Hi All,

anybody running DSpace 7.6.1 in the LAN through LAN IP without HTTPS?

if so please give the complete settings.


 Repository works fine in the same system where i have installed DSpace through URL : http://IP:4000

but while trying to access it from another system within the LAN it shows 500 service unavailable error.

i have done the following changes. HAVE I MISSED ANYTHING???
  1. local.cfg - replaced localhost with LAN IP & added  rest.cors.allowed-origins = ${dspace.ui.url}
  2. config.prod.yml - replaced localhost with LAN IP

Thanks & Regards
Suresh Patil

Saad Itani

unread,
Sep 19, 2024, 11:46:40 AM9/19/24
to DSpace Technical Support
same problem it loads the page (dspace ui) then it gives 500; ssl off

Michael Plate

unread,
Sep 19, 2024, 12:02:43 PM9/19/24
to dspac...@googlegroups.com
Hi,

AFAIK DSpace 7+ does not run w/o HTTPS besides localhost.

https://wiki.lyrasis.org/display/DSDOC7x/Installing+DSpace

"
Production Installation (adding HTTPS support): Running the DSpace
Backend on HTTP & port 8080 is only usable for local development
environments (where you are running the UI and REST API from the same
machine, and only accessing them via localhost URLs). If you want to
run DSpace in Production, you MUST run the backend with HTTPS support
(otherwise logins will not work outside of your local domain).
"

Michael


Am 19.09.24 um 13:46 schrieb Saad Itani:
[…]

Israel Irizarry

unread,
Oct 8, 2024, 4:54:23 PM10/8/24
to DSpace Technical Support
Hi everyone!

I am experiencing a similar issue. I do have https support for the UI and REST I believe. Here is the config.prod.yml portions and the local.cfg settings. I am using 7.6.
--------------------------------------------------------------------------------------------------------------------- config.prod.yml
ui:
  ssl: false
  host: cuvault.cumberland.edu
  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: 60000 # 1 minute
    max: 500 # limit each IP to 500 requests per windowMs
  # Trust X-FORWARDED-* headers from proxies (default = true)
  useProxies: true
rest:
  ssl: true
  host: cuvault.cumberland.edu
  port: 443
  nameSpace: /server
--------------------------------------------------------------------------------------------------------------------- local.cfg

dspace.ui.url = https://cuvault.cumberland.edu
rest.cors.allowed-origins = ${dspace.ui.url}
# Name of the site
dspace.name = DSpace at Cumberland University

I have tried so many different settings, but I keep getting an error 500 when trying to access dspace on another computer in our network. It works on the server just fine. I am not sure if there is a setting I am missing or a configuration that I have wrong.

Israel Irizarry

unread,
Oct 8, 2024, 4:55:20 PM10/8/24
to DSpace Technical Support
When I go to https://cuvault.cumberland.edu/server it loads just fine on an computer on our network. It seems to just be dspace's frontend ( https://cuvault.cumberland.edu ).

DSpace Technical Support

unread,
Oct 24, 2024, 5:41:23 PM10/24/24
to DSpace Technical Support
Hi, 

If you are still hitting a 500 error from the DSpace User Interface, this is usually the sign of a misconfiguration.  See the troubleshooting options listed in our Common Installation Issues with regards to 500 errors.

Tim
Reply all
Reply to author
Forward
0 new messages