I wanted to make my private POPFile running on Linux
accessible via https and mod_proxy, so that I don't
have to open POPFile's port on my router/firewall.
Unfortunately, POPFile always creates absolute URLs
(starting with /), which prevents proper redirection of
the second and follow-up requests. ViewCVS had the same
problem; basically the solution is to only generate
relative URLs, either taking the 'Referrer' header into
account or (when it is not available) using a
preconfigured 'base URL'.
It would be nice if future versions would allow this.
Logged In: YES
user_id=640073
Can you give an example of an absolute URL generated by
POPFile, and what it would be if it was 'relative' (with a
suitable base URL). Where are these URL's generated? In the
html UI, in messages?
Can you post a link to the mod_proxy documentation that
describes why absolute URL's are a problem?
Moved to RFE's. This is not a 'bug'.
Regards,
Sam
Logged In: YES
user_id=421644
Thanks for showing some interest in this :)
The links appear e.g. in the HTML UI. Simply visit the root
URL (main menu) and inspect the generated HTML source. It
shows links like: href="/shutdown" for the Shutdown link.
The leading / is the root of the problem.
The mod_proxy docs and the affected directive can be found
at
http://httpd.apache.org/docs-2.0/mod/mod_proxy.html#proxypassreverse
and explicitly mention that absolute URLs won't work.
It's important to understand that only the "reverse" proxy
direction is affected by this, since that's the direction
responsible for rewriting URLs that go out to a client.
Just like for ViewCVS's stand-alone mode it would be nice if
POPFile would allow for a configurable root URL that is
prepended to all generated URLs, so that the above link
would e.g. look like http://www.mysite.com/popfile/shutdown"
when I specify "http://www.mysite.com/popfile/" as
externally visible root URL.
I would dig into the source myself and help with this, but
perl is not among the ~10+ languages I know (by choice.
please don't hate me. ;)
Logged In: YES
user_id=640073
Hi,
If you replace every instance of "/ in the skins/default
directory with " that should remove the 'absolute' URL's. No
perl knowledge required. I will look at checking something
in for this.
Regards,
Sam
Logged In: YES
user_id=421644
Sam,
I just found some time to modify some of the templates as
you suggested (like common-middle for starters) and Behold!
mod_proxy automagically works :-)
I can now safely access the site from outside or play any
other Apache access control or URL rewriting tricks. Thanks!
Logged In: YES
user_id=640073
Cheers. After 0.22.2 goes out I will make the same changes
and then test for any regression. If there is no regression
I see no reason at all not to change all of the templates.
Regards,
Sam
Logged In: YES
user_id=663087
Sam, did you ever check this out. If not I will look into
this for 0.23.
Patch for relative URLs with 1.0.1
Logged In: YES
user_id=421644
Originator: YES
After a few years of running my ancient hacked version without any problems I just decided to upgrade to 1.0.1. Here is a patch that changes all absolute URLs in the skins/default directory; still works fine for me.
File Added: urls.patch