Question about deploying OAI webapp in DSpace 7

349 views
Skip to first unread message

euler

unread,
Aug 12, 2021, 2:25:35 AM8/12/21
to DSpace Technical Support
Dear All,

I would like to ask some clarifications regarding deploying OAI in DSpace 7. I read in the OR2021: DSpace 7 QA about this, specifically question no. 33:

Question: How much does Dspace7 affects the OAI webapp, it seems that the path has to be server/oai?
Answer: The path is based on the path of the server webapp, but you can configure both. So, the server webapp could be deployed at “/” (root), and your OAI path can be configured to be “pmh” (change ‘oai.path’ config), which would put the OAI service at “/pmh”.  So, the path is dependent on your setup & not required to be “/server/oai”.

My question is, what if I want to retain my old repository's OAI base URI which is for example https://myrepository/oai but at the same time I'll also install the frontend in the same server?

Looking at the documentation on the sample VirtualHost configuration, I'm confused on what would be the correct configuration to proxy requests to Tomcat and to the frontend if I don't want to use '/server/oai' path? I already deployed the server webapp at '/' (root) in Tomcat.

Example VirtualHost for installing the backend:
<VirtualHost _default_:443>
    …
    # Proxy all HTTPS requests to "/server" from Apache to Tomcat via AJP connector
    ProxyPass /server ajp://localhost:8009/server
    ProxyPassReverse /server ajp://localhost:8009/server
    …
</VirtualHost>

In order to retain my repository's old OAI base URI, then I assume the configuration for ProxyPass and ProxyPassReverse should look like this(?):
    ProxyPass / ajp://localhost:8009/
    ProxyPassReverse / ajp://localhost:8009/

Since I will also install the front end in the same server, would the above configuration be in conflict with the frontend since both configurations would proxy the path '/'?
Recommended configuration for frontend:
    ProxyPass / http://localhost:4000/
    ProxyPassReverse / http://localhost:4000/

You might say that why not just use the default configuration and be contented with '/server/oai/'. I asked this question because our repository is being harvested by other institutions and I think it would be impractical to tell the harvesting institution to manually change the OAI server in each of the harvested communities/collections.

I hope my use case is clear and I hope someone from the list can provide tips on how to modify the VirtualHost configurations in order to achieve my goals.

Thanks in advance and best regards!
euler

Tim Donohue

unread,
Aug 12, 2021, 3:26:03 PM8/12/21
to euler, DSpace Technical Support
Hi Euler,

You cannot Proxy the same path to two different locations.  So, you are correct that doing something like this for the backend...


ProxyPass / ajp://localhost:8009/
ProxyPassReverse / ajp://localhost:8009/

Would directly conflict with this setting for the frontend...

ProxyPass / http://localhost:4000/
ProxyPassReverse / http://localhost:4000/

The reason is that you cannot proxy "/" both to port 8009 and port 4000.  It just won't work.  The backend and frontend MUST be either on different paths, or have entirely separate URL/domains (e.g. api7.dspace.org and demo7.dspace.org)

So, there's a few other options. 

Either you setup a simple redirect from your old OAI-PMH URL to the new location (e.g. redirect https://my.dspace.edu/oai/ -> https://my.dspace.edu/server/oai/ )

Or, you might be able to try a proxy like this...which says to proxy the /oai/ path to /server/oai:

ProxyPass /oai ajp://localhost:8009/server/oai
ProxyPassReverse /oai ajp://localhost:8009/server/oai

Keep in mind, I haven't tested this out...but, I think​ it should work OK.  You are just letting Apache know that anything requesting the "/oai" path should be proxied to your localhost path of "/server/oai".   The result here though is that likely your OAI-PMH will be available both​ at /oai and /server/oai.... but, maybe that's good enough?

Tim

From: dspac...@googlegroups.com <dspac...@googlegroups.com> on behalf of euler <esn...@seafdec.org.ph>
Sent: Thursday, August 12, 2021 1:25 AM
To: DSpace Technical Support <dspac...@googlegroups.com>
Subject: [dspace-tech] Question about deploying OAI webapp in DSpace 7
 
--
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/45d7cb53-ad07-426f-abbe-53ddc0f0d1f4n%40googlegroups.com.

euler

unread,
Aug 13, 2021, 2:15:39 AM8/13/21
to DSpace Technical Support
Hi Tim,

Thanks for your suggestion. I used:

ProxyPass /oai ajp://localhost:8009/server/oai
ProxyPassReverse /oai ajp://localhost:8009/server/oai

and tried to harvest it from a repository running version 6.3 and it worked! When I access the OAI-PMH web UI however, the formatting and styles were lost.
oai.JPG

The important thing to me is that harvesting using my old OAI endpoints still worked!

Thanks again!
euler
Reply all
Reply to author
Forward
0 new messages