Serving Galaxy at a sub directory - symptoms without "filter-with = proxy-prefix"

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Serving Galaxy at a sub directory - symptoms without "filter-with = proxy-prefix"

Peter Cock
Hi all,

TL:DR abstract: Forgetting the "filter-with = proxy-prefix" gives
very confusing results. Hopefully this email will help someone
else who made the same configuration mistake.

--

As part of trying out the new (still in beta) Galaxy via git on GitHub
(rather than via hg on BitBucket), I am attempting to recreate my
development instance under http://localhost/galaxy-dev via port
8081 using an Apache Proxy:

https://wiki.galaxyproject.org/Admin/Config/ApacheProxy

Various things have changed, so rather than universe_wsgi.ini
we now use config/galaxy.ini and I wanted to try that here, and
so began by manually copying over settings I had changed.

Key settings include the prefix and cookie_path, here is what I
initially changed from the current defaults:

$ diff config/galaxy.ini config/galaxy.ini.sample
32d31
< port = 8081
64,65c63
< #prefix = /galaxy
< prefix = /galaxy-dev
---
> prefix = /galaxy
93d90
< cookie_path = /galaxy-dev
678d674
< library_import_dir = True
693d688
< allow_library_path_paste = True
773d767
< admin_users = [hidden email]
787d780
< allow_user_impersonation = True
793d785
< allow_user_dataset_purge = True
896,897d887
< expose_dataset_path = True
<

Here's my Apache configuration file,

$ more /etc/httpd/conf.d/galaxy-dev.conf
# mod_rewrite
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^/galaxy-dev$ /galaxy-dev/ [R]
RewriteRule ^/galaxy-dev/static/style/(.*)
/mnt/galaxy/repositories/galaxy/static/june_2007_style/blue/$1 [L]
RewriteRule ^/galaxy-dev/static/scripts/(.*)
/mnt/galaxy/repositories/galaxy/static/scripts/packed/$1 [L]
RewriteRule ^/galaxy-dev/static/(.*)
/mnt/galaxy/repositories/galaxy/static/$1 [L]
RewriteRule ^/galaxy-dev/favicon.ico
/mnt/galaxy/repositories/galaxy/static/favicon.ico [L]
RewriteRule ^/galaxy-dev/robots.txt
/mnt/galaxy/repositories/galaxy/static/robots.txt [L]
RewriteRule ^/galaxy-dev/(.*) http://localhost:8081/$1 [P]
</IfModule>


The Apache settings look fine, e.g. this URL works for the
welcome page:

http://localhost/galaxy-dev/static/welcome.html

I've confirmed this by editing the default welcome page at
/mnt/galaxy/repositories/galaxy/static/welcome.html

The observed problem is that http://localhost/galaxy-dev/ gives:

<quote>
None
Tools
History

Not Found
The requested URL /root/welcome was not found on this server.
________________________________
Apache/2.2.15 (CentOS) Server at xxxxxx Port 80
</quote>

From the page source, the wrong URLs are being used, e.g.:

<link href="/static/style/base.css?v=1424865275" media="screen"
rel="stylesheet" type="text/css" />

<script src="/static/scripts/libs/jquery/jquery.js?v=1424865275"
type="text/javascript"></script>

and:

    <div style="position: absolute; width: 100%; height: 100%">
        <iframe name="galaxy_main" id="galaxy_main" frameborder="0"
                style="position: absolute; width: 100%; height: 100%;"
src="/root/welcome"></iframe>
    </div>


For some reason the prefix specified was not being used for all the
static resources (they should be "/galaxy-dev/static/..." instead
of just "/static/...") and the iframe used "/root/welcome" rather then
what I expected, "/galaxy-dev/static/welcome".

I eventually realised on re-reading the wiki page that I was missing
the crucial setting "filter-with = proxy-prefix" which fixed this:

https://wiki.galaxyproject.org/Admin/Config/ApacheProxy

I'm mainly sending this email in the hope it might show up in
future Google searches and help someone else debugging
the same mistake one day.

Would it be helpful for Galaxy to notice if the configuration
file contained a [filter:proxy-prefix] section without actually
enabling it with "filter-with = proxy-prefix"?

Regards,

Peter
___________________________________________________________
Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:
  https://lists.galaxyproject.org/

To search Galaxy mailing lists use the unified search at:
  http://galaxyproject.org/search/mailinglists/
Reply | Threaded
Open this post in threaded view
|

Re: Serving Galaxy at a sub directory - symptoms without "filter-with = proxy-prefix"

Peter Cock
On Wed, Feb 25, 2015 at 12:26 PM, Peter Cock <[hidden email]> wrote:
> Hi all,
>
> TL:DR abstract: Forgetting the "filter-with = proxy-prefix" gives
> very confusing results. Hopefully this email will help someone
> else who made the same configuration mistake.
>

And as a follow up, having fixed this, I was unable to login to this
(or our main Galaxy instance on the same machine).

This was due to a cookie created while Galaxy was mis-configured
using the default path clobbering the folder-specific cookie; deleting
the browser cookie(s) fixed that.

Peter
___________________________________________________________
Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:
  https://lists.galaxyproject.org/

To search Galaxy mailing lists use the unified search at:
  http://galaxyproject.org/search/mailinglists/
Reply | Threaded
Open this post in threaded view
|

Re: Serving Galaxy at a sub directory - symptoms without "filter-with = proxy-prefix"

Eric Rasche-2
You might cross post to the CommunityLogBoard if you're just looking for visibility

2015-02-25 8:20 GMT-06:00 Peter Cock <[hidden email]>:
On Wed, Feb 25, 2015 at 12:26 PM, Peter Cock <[hidden email]> wrote:
> Hi all,
>
> TL:DR abstract: Forgetting the "filter-with = proxy-prefix" gives
> very confusing results. Hopefully this email will help someone
> else who made the same configuration mistake.
>

And as a follow up, having fixed this, I was unable to login to this
(or our main Galaxy instance on the same machine).

This was due to a cookie created while Galaxy was mis-configured
using the default path clobbering the folder-specific cookie; deleting
the browser cookie(s) fixed that.

Peter
___________________________________________________________
Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:
  https://lists.galaxyproject.org/

To search Galaxy mailing lists use the unified search at:
  http://galaxyproject.org/search/mailinglists/



--
Eric Rasche
Programmer II

Center for Phage Technology
Rm 312A, BioBio
Texas A&M University
College Station, TX 77843
404-692-2048


___________________________________________________________
Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:
  https://lists.galaxyproject.org/

To search Galaxy mailing lists use the unified search at:
  http://galaxyproject.org/search/mailinglists/