Dspace7 works with ip but not with fqdn

386 views
Skip to first unread message

Jorge Costa

unread,
Dec 12, 2022, 7:18:33 AM12/12/22
to DSpace Technical Support
http://[ip]:4000/home works just fine.
ITs integrated with my AD
I can log in , browse , deposit , delete etc

http://[domain name]:4000/home
gets me 500 Service Unavailable

/etc/hosts has an entry for the domain name to its ip

The dns server has an entry

What did I miss ?
Thanks

Mohammad S. AlMutairi

unread,
Dec 12, 2022, 8:24:24 AM12/12/22
to DSpace Technical Support
Check your settings in local.cfg or dspace.cfg and config.prod.yml or post them here.

Mohammad S. AlMutairi

unread,
Dec 12, 2022, 8:32:25 AM12/12/22
to DSpace Technical Support
On Monday, December 12, 2022 at 3:18:33 PM UTC+3 jorge...@gmail.com wrote:
http://[domain name]:4000/home
gets me 500 Service Unavailable
Do you have any specific reason to run it on port 4000?. If you don't just change port 4000 to port 80 and access it without having to write the port something like this ( http://[domain name]/home ).

Jorge Costa

unread,
Dec 12, 2022, 11:25:01 AM12/12/22
to DSpace Technical Support

This is the config from /dspace/config/dspace.cfg
#
# DSpace Configuration
#
# NOTE: The DSpace Configuration File is separated into several sections:
#  * General Configurations
#  * UI Configurations

#------------------------------------------------------------------#
#------------------GENERAL CONFIGURATIONS--------------------------#
#------------------------------------------------------------------#
# These configs are used by underlying DSpace API, and are         #
# therefore applicable to all interfaces                           #
# Local configuration should be made in local.cfg (where possible) #
# Global or more complex configuration can be hardcoded here       #
#------------------------------------------------------------------#
##### Basic information ######

# DSpace installation directory
# Windows note: Please remember to use forward slashes for all paths (e.g. C:/dspace)
dspace.dir = /dspace
dspace.hostname = dspace7.lnec.pt
csvexport.dir = ${dspace.dir}/exports

# URL of DSpace backend ('server' webapp). Include port number etc.
# DO NOT end it with '/'.
# This is where REST API and all enabled server modules (OAI-PMH, SWORD,
# SWORDv2, RDF, etc) will respond.
dspace.server.url = http://193.136.104.100:8080/server

# URL of DSpace frontend (Angular UI). Include port number etc.
# DO NOT end it with '/'.
# This is used by the backend to provide links in emails, RSS feeds, Sitemaps,
# etc.
dspace.ui.url = http://193.136.104.100:4000

# Name of the site
dspace.name = DSpace7

# assetstore.dir, look at DSPACE/config/spring/api/bitstore.xml for more options
assetstore.dir = ${dspace.dir}/assetstore

# Default language for metadata values
default.language = en_US

# Solr server/webapp.
# DSpace uses Solr for all search/browse capability (and for usage statistics).
# Since DSpace 7, SOLR must be installed as a stand-alone service.
solr.server = http://193.136.104.100:8983/solr

# Solr core name prefix.
# If you connect multiple instances of DSpace to a single Solr instance, you
# can organize them with a common core name prefix.
solr.multicorePrefix =

# Solr connection pool.
# If you change these values, the changes are not effective until DSpace is
# restarted.
#
# Maximum open connections to Solr:
# solr.client.maxTotalConnections = 20
#
# Maximum open connections per Solr instance:
# solr.client.maxPerRoute = 15
#
# Default keep-alive time for open Solr connections, in milliseconds:
# solr.client.keepAlive = 5000
#
# Maximum lifetime of a pooled connection, in seconds:
# solr.client.timeToLive = 600



Theres a local.cfg in there as well , Im not sure which takes precedence/priority

Jorge Costa

unread,
Dec 12, 2022, 11:25:35 AM12/12/22
to DSpace Technical Support
The default install sends it to 4000
i never bothered to change it ...
Dont think it will influence my problem either way ?

Tim Donohue

unread,
Dec 12, 2022, 12:06:42 PM12/12/22
to DSpace Technical Support
Hi,

The problem may be that you forgot to change the "dspace.ui.url" setting (on the backend) to include the domain name.  When changing the URLs (from IP to hostname), you have to ensure you update the URL settings in the backend's "local.cfg" (both "dspace.server.url" and "dspace.ui.url") and the frontend's "config.*.yml" (especially the "rest" section here).

If that's not the problem, then I'd recommend following our Troubleshooting guide to find the error *behind* that 500 exception.  A 500 exception can be thrown for a variety of reasons, so we'd need to determine the exact reason why it's thrown in this scenario.  So, follow the troubleshooting guide to see if there are other errors in the UI or backend logs which provide more info: https://wiki.lyrasis.org/display/DSPACE/Troubleshoot+an+error#Troubleshootanerror-DSpace7.x(orabove)

Tim

Tim Donohue

unread,
Dec 12, 2022, 12:10:42 PM12/12/22
to DSpace Technical Support
I forgot to add... if you are trying to simply make the UI available on the web, I'd highly recommend considering keeping the UI running on "localhost:4000" and using a Proxy to respond at https://[domain name].  See our installation guide, step 8 "Add HTTPS support" for the Frontend install: https://wiki.lyrasis.org/display/DSDOC7x/Installing+DSpace#InstallingDSpace-FrontendInstallation   (If for some reason you don't want HTTPS, you can follow those same instructions to setup HTTP...just make sure to use port 80 and ignore the HTTPS/SSL setup.  I don't recommend ever running in HTTP in production though, as that's a major security issue.)

Tim

Mohammad S. AlMutairi

unread,
Dec 12, 2022, 10:40:46 PM12/12/22
to DSpace Technical Support
On Monday, December 12, 2022 at 7:25:01 PM UTC+3 jorge...@gmail.com wrote:
Theres a local.cfg in there as well , Im not sure which takes precedence/priority
local.cfg  should have a higher priority over dspace.cfg. If this is a a new installation remove/rename local.cfg to local.cfg-old and just use dspace.cfg instead for this testing and try this:

1) echo "193.136.104.100 [domain name]" >> /etc/hosts
2) edit dspace.cfg
#Remove dspace.hostname or comment it out. You don't need it. Not for what you are using it for here.
#dspace.hostname = dspace7.*********
dspace.server.url = http://[domain name]:8080/server
dspace.ui.url = http://[domain name]
solr.server = http://localhost:8983/solr

3) edit config.prod.yml
ui:
  ssl: false
  host: localhost
  port: 80

rest:
  ssl: false
  host:  [domain name]
  port: 8080

4) Run (yarn test:rest) to check your configuration. You should see:
RESPONSE: 200

Checking JSON returned for validity...
        "dspaceVersion" = DSpace 7.5-SNAPSHOT
        "dspaceUI" = http://[domain name]
        "dspaceServer" = http://[domain name]:8080/server
        "dspaceServer" property matches UI's "rest" config? true
        Does "/api" endpoint have HAL links ("_links" section)? true

5) Build the frontend.


** You need to shutdown/disable the webserver if you have one running on your server or you can run it on a different port or just run the frontend on port 4000 and use a reverse proxy to talk to it as Tim recommended and please remember running DSpace unsecure is unwise unless it's a temporarily setup for any reason you have.

** Avoid Running Solr on any other IP address but localhost. See the reason why in the screenshot ( https://wiki.lyrasis.org/display/DSPACE/Solr#Solr-Bypassinglocalhostrestrictiontemporarily )

2022-12-13_6-37-21.jpg

Jorge Costa

unread,
May 8, 2023, 12:41:05 PM5/8/23
to DSpace Technical Support

Thanks  Mohammad S. AlMutairi
Its still not working
The problem is that the changes dont do anything . Everything is overidden by local.cfg in /dspace.
When I have 
I can access via the domain name
if I change that to an ip address in the local.cfg file I can only access by Ip !
I cant do both
This is my current yarn test


dspace-angular-dspace-7.3]$ yarn test:rest
yarn run v1.22.19
$ ts-node --project ./tsconfig.ts-node.json scripts/test-rest.ts
Building production app config
Overriding app config with /home/jmmcosta/dspace-angular-dspace-7.3/config/config.prod.yml
...Testing connection to REST API at http://193.136.104.100:8080/server/api...


RESPONSE: 200

Checking JSON returned for validity...
        "dspaceVersion" = DSpace 7.3
        "dspaceUI" = http://dspace7.lnec.pt:4000
        "dspaceServer" = http://193.136.104.100:8080/server

        "dspaceServer" property matches UI's "rest" config? true
        Does "



What am i missing?
Reply all
Reply to author
Forward
0 new messages