Edgewall Software
Modify

Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#3381 closed defect (worksforme)

base_url value in trac.ini seems broken

Reported by: cies.breijs@… Owned by: Jonas Borgström
Priority: normal Milestone:
Component: web frontend/tracd Version: 0.10b1
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:

Description

maybe i'm wrong but the base_url value seems to be ignored after i've set it.

I want to have my trac wiki on https://someurl/trac/project/wiki

so i set the base_url to

https://someurl/trac/

i run my tracd with

/usr/bin/python /usr/bin/tracd -d --port 8000 -e /var/trac

and i have the following somewhere in my apache2 conf files:

ProxyPass /trac balancer://trac_cluster/

ProxyPassReverse /trac balancer://trac_cluster/

but non of the links get prefixed with this url…

i want apache to take care of the SSL and auth'ion stuff (apache doesn't seems to be the issue here)

Attachments (0)

Change History (5)

comment:1 by Matthew Good, 13 years ago

Resolution: worksforme
Status: newclosed

Where are you looking for base_url to appear? It's only used when Trac needs to generate absolute URLs, such as in the RSS feeds. Otherwise Trac uses server-relative links.

In order to use tracd through a proxy with a base URL other than "/" you'll need to upgrade to 0.10 (currently in the trunk) and use the --base-path option for tracd to properly parse the URLs coming from the proxy:

tracd -d -p 8000 --base-path=/trac -e /var/trac

comment:2 by anonymous, 13 years ago

Milestone: 0.10
Resolution: worksforme
Status: closedreopened
Version: 0.9.50.10b1

Why are the urls anyway absolute, why not use relative paths and try not to fix the problems caused by absolute paths with glue (base_url, base-path).

Anyway, the —base-path does not work either, if I enable it and try access the server I always get the project listing, even when not using trac trough proxy. I can see it requests /trac/project fine (even correct path) but it still returns project list …

in reply to:  2 comment:3 by Matthew Good, 13 years ago

Milestone: 0.10
Resolution: worksforme
Status: reopenedclosed

Replying to anonymous:

Why are the urls anyway absolute, why not use relative paths and try not to fix the problems caused by absolute paths with glue (base_url, base-path).

Relative URLs are used in the Trac HTML pages when possible, but RSS feeds and emails need to use absolute URLs.

Anyway, the —base-path does not work either, if I enable it and try access the server I always get the project listing, even when not using trac trough proxy. I can see it requests /trac/project fine (even correct path) but it still returns project list …

Please ask for help on the MailingList. Be sure to provide the tracd commandline and your configuration for the proxy.

comment:4 by eposthumus@…, 13 years ago

I have a similar problem, but have traced the issue to the way relative URLs are re-contructed in source:/trunk/trac/web/api.py@4254#271

In there self.scheme is used, which comes from the wsgi request, and not from the base_url. So if you have a different scheme in your request, which happens when you are proxying behind Apache, the re-direct will seem to fail.

My solution is to temporarily hack in a hard-coded scheme in the source of the installation that I am using, but a more correct solution is obviously the better route.

comment:5 by Christian Boos, 13 years ago

Please follow-up on #2553.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to as closed The owner will be changed from Jonas Borgström to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.