Hi Tim, The error is:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://127.0.0.1:8355/server/api/authn/status So it is the case that tomcat is refusing the connection. I have tomcat listening only on 127.0.0.1:8355. And Angular is listening at localhost:4000. The problem is, I am using apache as a proxy, so I have 3 addresses, these two, plus our domain name. Apache passes the requests to localhost:4000. I have tried plugging the domain name in for the dspace.ui.url. I get the same CORS error. How else can I present the app to the outside world? I do not think pointing the Angular server directly out on our domain name is a good idea, and I do not know how to set up ssh/tls for this server, anyway. How is one supposed to run this arrangement when one goes live? I just need to make this instance available for my team to test it. Best regards, and thanks for the help! Paul On Tuesday, August 4, 2020 at 4:38:02 PM UTC+2, Tim Donohue wrote: > > Hi Paul, > > Could you provide more info on the CORS errors? > > The reason I ask, is that I wonder what URL the backend thinks you are > sending requests from. CORS errors should only occur if the URL sending > requests (to the REST API) is *not* listed in the "rest.cors.allowed-origins" > setting. So, that makes me suspect that the UI is sending requests under a > URL that is *not* identical to what you set for "dspace.ui.url" in the > backend. > > Generally speaking, the frontend configuration and backend configuration > need to be identical, or you will hit problems. > > So, this means, in the Angular UI, the "ui" environment settings: > > https://github.com/DSpace/dspace-angular/blob/main/src/environments/environment.common.ts#L10-L16 > need to *match* what you configure as "dspace.ui.url" on the backend. > > Similar, in the Angular UI, the "rest" environment settings: > > https://github.com/DSpace/dspace-angular/blob/main/src/environments/environment.common.ts#L20-L26 > need to *match* what you configure as "dspace.server.url" on the backend. > > If the "ui" settings don't match, you are likely to end up with CORS > errors, as the UI will be sending requests from a slightly different URL > and the REST API will block those requests. This is my _best guess_ at > what you might be seeing. > > Tim > > > ------------------------------ > *From:* [email protected] <javascript:> <[email protected] > <javascript:>> on behalf of Paul Warner <[email protected] <javascript:>> > *Sent:* Tuesday, August 4, 2020 12:32 AM > *To:* DSpace Technical Support <[email protected] <javascript:>> > *Subject:* [dspace-tech] dspace7 installation on remote server with apache > > Hi, > > My team wants very much to test dspace 7, and I have an installation on a > remote server that uses apache as the frontend proxy. I did this so I can > offer the site to my team with ssl/tls. They cannot get to the command > line on the server, and a command line browser (w3m) does not work with > angular anyway. So they need a url that is external. > > I have set the rest.cors settings in local.cfg: > > rest.cors.allowed-origins = ${dspace.ui.url} > > and have set the dspace.ui.url to the url to apache. I am still getting > cors errors in the browser (Firefox). There are no errors anywhere else in > the logs. > > Is there a better way to set up dspace 7 so it is visible from a domain > externally? > > Best regards, > Paul > > -- > All messages to this mailing list should adhere to the DuraSpace Code of > Conduct: https://duraspace.org/about/policies/code-of-conduct/ > --- > 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 [email protected] <javascript:>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/dspace-tech/ee9bb9f8-117d-4113-a0d3-548861121d45o%40googlegroups.com > > <https://groups.google.com/d/msgid/dspace-tech/ee9bb9f8-117d-4113-a0d3-548861121d45o%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- All messages to this mailing list should adhere to the DuraSpace Code of Conduct: https://duraspace.org/about/policies/code-of-conduct/ --- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/dspace-tech/806ba430-b794-4490-9e5b-6371e7654819o%40googlegroups.com.
