Branch links with serve-branches seem to be wrong when proxying

Asked by Andrew Watts on 2009-02-12

I installed loggerhead from the current lp revision (revno 269), and I'm running Debian testing with Paste 1.7.1, PasteDeploy 1.3.2, and Apache2 2.2.9-10+lenny2 with mod_proxy and mod_proxy_http. I'm using the loggerheadd init.d script to run serve-branches. After a bit of twiddling I have apache proxying to the loggerhead server. Sort of.

In loggerheadd I changed a couple of things for my local setup and preferences:
URL_PREFIX=/bzr
BZRROOT=/var/local/repos/bzr

And added this to my apache configuration:
ProxyRequests off
<Proxy http://127.0.0.1:8080>
    Order allow,deny
    Allow from all
</Proxy>

<Location /bzr>
    Order allow,deny
    Allow from all
    ProxyPass http://127.0.0.1:8080/bzr/
    ProxyPassReverse http://127.0.0.1:8080/bzr/
</Location>

The links to the branches are wrong though; they're relative to / instead of /bzr. When I go to http://myservername:8080 everything works fine, but when I go to http://myservername/bzr/ and click on a branch name I get a 404. If I do a "bzr branch http://myservername/bzr/branchname" or go to http://myservername/bzr/branchname it does the right thing. It's just that the template isn't using the URL_PREFIX, I think.

Any clue how to fix this or suggestions about what I'm doing wrong? Thanks.

Question information

Language:
English Edit question
Status:
Solved
For:
loggerhead Edit question
Assignee:
No assignee Edit question
Solved by:
Andrew Watts
Solved:
2009-02-12
Last query:
2009-02-12
Last reply:
2009-02-12

I think you should say:

ProxyPass http://127.0.0.1:8080/

(i.e. without the /bzr/ at the end).

Andrew Watts (andrew.watts) said : #2

If I don't put the /bzr at the end of the proxy pass line, then additionally the style sheets and images (anything under /static) don't load either.

Andrew Watts (andrew.watts) said : #3

Fascinatingly enough, it started working on its own with the setup I described above after I tried changing it to the suggested way (no go) and back. Something must not have taken until I restarted apache or loggerheadd the most recent time.

I was going to say, it works for me! Certainly, restarting apache a lot is part and parcel of debugging this sort of thing.

I hope loggerhead continues to work for you!