Ticket #857 (closed defect: worksforme)

Opened 12 years ago

Last modified 12 years ago

[WG] Use of ndg browse/discovery behind mod proxy exposes absolute urls

Reported by: lawrence Owned by: lawrence
Priority: desirable Milestone: PROD Final
Component: community Version:
Keywords: Cc: mggr@…

Description

In a number of places, absolute local urls are constructed. These fail behind modproxy unless ProxyHTMLURLMap is used.

I'd prefer to avoid that, it'd be better to enforce relative urls.

Change History

comment:1 Changed 12 years ago by lawrence

Places where this happens:

previous/next etc on results pages ...

comment:2 Changed 12 years ago by siva

I got some mod_rewrites setup for Discovery and Browse which redirects from  http://grid.bodc.nerc.ac.uk to the machine ( http://livjade:8081/) inside firewall where I installed the NDG-Discovery and browse

RewriteRule? browse(.*)  http://livjade:8081/browse$1 [P] RewriteRule? retrieve(.*)  http://livjade:8081/retrieve$1 [P] RewriteRule? discovery(.*)  http://livjade:8081/discovery$1 [P] RewriteRule? view(.*)  http://livjade:8081/view$1 [P]

I changed the following in my ndgDiscovery.config file,

[DEFAULT] # # the following is the server on which this browse/discovery instance runs!

##server:  http://livjade:8081/ (before) server:  http://grid.bodc.nerc.ac.uk (now)

[NDG_B_SERVICE] ##grid.bodc.nerc.ac.uk:  http://livjade:8081/ (before) grid.bodc.nerc.ac.uk: grid.bodc.nerc.ac.uk (now)

In the Search results page( http://grid.bodc.nerc.ac.uk/discovery?searchString=BODC.......) the hyperlinks for the "Search","Results","Next 10","Refine Search" are still pointing to  http://livjade:8081/discovery which iam expecting it to be  http://grid.bodc.nerc.ac.uk/discovery.

comment:3 Changed 12 years ago by lawrence

Hi Siva

I think the new changeset has all those fixes ... I'll build a new egg shortly. More importantly, there are more than a dozen urls that you'll need to rewrite ... and more coming with the wcs and wms clients.

It may be easier to follow Mike's example and put everything behind grid.bodc.nerc.ac.uk/ndg and rewrite using a wildcard ... or use our approach which is currently a virtual host.

I can't help wondering whether there is some subtlety in the mod_rewrite that is causing the problems with repainting too ... I don't know how to reproduce the problem ...

Bryan

comment:4 Changed 12 years ago by siva

Bryan,

Updated my ows_server and ows_common EGGs and restarted the services, but still I can see

in the Search results page( http://grid.bodc.nerc.ac.uk/discovery?searchString=BODC.......) the hyperlinks for the "Search","Results","Next 10","Refine Search" are still pointing to  http://livjade:8081/discovery which iam expecting it to be  http://grid.bodc.nerc.ac.uk/discovery.

I am going to put everything behind grid.bodc.nerc.ac.uk/ndg soon.

Siva

comment:5 Changed 12 years ago by siva

Bryan,

I changed the BODC Discovery URL to  http://grid.bodc.nerc.ac.uk/ndg/discovery

Siva

comment:6 Changed 12 years ago by siva

  • Cc mggr@… added

Bryan,

After moving the my discovery under "ndg" directory (Mike's way of doing), I changed/moved the "layout" directory aswell to "ndg/layout",but didn't touch the "js" directory,

<script src="/javascripts/prototype.js" type="text/javascript"></script> <script src="/javascripts/scriptaculous.js" type="text/javascript"></script>

<script src="/js/toggleDiv.js" type="text/javascript"></script>

<script src="/js/OpenLayers.js"></script> <script src="/js/openlayers-x.js"></script> <script src="/js/OLMapBox.js"></script>

beacause of which in my discovery page  http://grid.bodc.nerc.ac.uk/discovery the above javascripts not working (as the above "*.js" file paths are expecting to be "/ndg/js/*.js"

Cheers Siva

comment:7 Changed 12 years ago by siva

sorry the Discovery URL is  http://grid.bodc.nerc.ac.uk/ndg/discovery

Siva

comment:8 Changed 12 years ago by mggr

I also had to change the following hard-coded paths to work with a sub-directory on the server (e.g. change /layout to /my/actual/web/url/layout).

.../site-packages/ows_server-0.0.0dev_r2832-py2.4.egg/ows_server:

./templates/ndgPage.kid:        <link media="all, screen" href="/layout/ndg2.css" type="text/css" rel="stylesheet"/>
./public/layout/ndg2.css: background-image:url(/layout/bodc_waves_reversed.png);background-position:right;background-repeat:repeat-x;}
./public/layout/ndg2.css:.key {background-image:url(/layout/key.gif);}
./public/layout/ndg.css:/* and the layout css follows */
./public/layout/style.css:@import(/layout/xml.css);

templates/ndgPage.kid:        <script type="text/javascript" src="/js/toggleDiv.js"/>
templates/ndgPage.kid:        <script py:if="ol==1" src="/js/OpenLayers.js"/>
templates/ndgPage.kid:        <script py:if="ol==1" src="/js/openlayers-x.js"/>
templates/ndgPage.kid:        <script py:if="ol==1" src="/js/OLMapBox.js"/>

comment:9 Changed 12 years ago by siva

I now have the BODC Discovery Working., at[  http://grid.bodc.nerc.ac.uk/ndg/discovery]

-Siva

comment:10 Changed 12 years ago by lawrence

  • Status changed from new to closed
  • Resolution set to worksforme

I don't believe there are any left except, maybe?, for css? Open a new ticket if you find some more ...

Note: See TracTickets for help on using tickets.