Open
Bug 545410
Opened 16 years ago
Updated 11 years ago
Bugzilla cannot be used in different virtual hosts because urlbase is used to build static links
Categories
(Bugzilla :: Administration, task)
Bugzilla
Administration
Tracking
()
NEW
People
(Reporter: clem.oudot, Unassigned)
References
Details
User-Agent: Mozilla/5.0 (X11; U; Linux i686; fr-FR; rv:1.9.1.7) Gecko/20100106 Ubuntu/9.10 (karmic) Firefox/3.5.7
Build Identifier:
Hello,
I use Bugzilla with several virtual hosts. For example :
* bugzilla.dom1.com
* bugzilla.dom2.com
I must set one of these values in urlbase parameter and this fixes all links in pages, and form action too.
Reproducible: Always
Steps to Reproduce:
1. Configure 2 vhosts for Bugzilla (bugzilla.dom1.com & bugzilla.dom2.com)
2. Configure urlbase as bugzilla.dom1.com
3. Connect to bugzilla.dom2.com and authenticate
Actual Results:
User is redirected to bugzilla.dom1.com and not bugzilla.dom2.com
Expected Results:
We should still be in bugzilla.dom2.com
I corrected this problem by hacking Bugzilla/Config.pm in read_param_file() subroutine. After Bugzilla read the configuration, I override urlbase parameter.
<pre>
$params{urlbase} = "http://".$ENV{HTTP_HOST}."/" if (defined $ENV{HTTP_HOST} );
</pre>
Comment 1•16 years ago
|
||
Why cannot you use the PROJECT environment variable? See http://www.bugzilla.org/docs/tip/en/html/multiple-bz-dbs.html
If they all point to the same database, you can have as many different urlbase as you want, as each VM would have its own localconfig.foo and data/foo/params files.
Status: UNCONFIRMED → RESOLVED
Closed: 16 years ago
Resolution: --- → WORKSFORME
Comment 2•16 years ago
|
||
(In reply to comment #1)
> as you want, as each VM would have ...
I meant VH (virtual host), not VM. :)
See also bug 465887.
| Reporter | ||
Comment 3•16 years ago
|
||
Thanks for the answer.
This can be a workaround.
But definitively, I do not understand why urlbase must be set in configuration. Bugzilla should work without knowing its full adress call. In complex WEB environments (reverse proxies, high avaliability), this causes some problems.
Status: RESOLVED → UNCONFIRMED
Resolution: WORKSFORME → ---
Comment 4•16 years ago
|
||
(In reply to comment #3)
> This can be a workaround.
Why is that a workaround?
| Reporter | ||
Comment 5•16 years ago
|
||
For me the main problem is that urlbase is mandatory in Bugzilla, and this should not (all links can be relative and not fixed). But maybe I am missing something.
In fact, I find strange to have to manage 2 Bugzilla configurations just to be able to run Bugzilla under different virtualhost. Vhost should only be managed by Apache without impacting hosted application configuration.
Comment 6•16 years ago
|
||
I think this is a duplicate of the "don't use absolute URLs" bug.
Comment 7•16 years ago
|
||
Well, the bug you are talking about is bug 329638. I don't think we have another bug about this.
Comment 8•16 years ago
|
||
Wow, I really thought I already filed a bug about this. Yes, we should not be using absolute URLs, whenever it's possible to avoid them.
By the way, urlbase will always be mandatory, because it's used in emails to make links to Bugzilla.
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Linux → All
Hardware: x86 → All
Comment 9•16 years ago
|
||
Note that this won't work with ssl_redirect turned on, because if you access one virtual host using HTTP, Bugzilla will use sslbase to redirect your connection. It cannot just replace http:// by https://, as discussed in bug 399069.
| Reporter | ||
Comment 10•16 years ago
|
||
So urlbase should be a parameter dedicated to email sending. If in CGI mode, the urlbase should be $ENV{HTTP_HOST} or better, no absolute URLs should be use in HTML code.
Comment 11•15 years ago
|
||
Something that may be obvious: HTTP redirects will always need to use an absolute URI. So, if in a future version only relative URIs are used in the HTML, you'll still need to construct absolute URIs for redirects from $ENV{HTTP_HOST}.
I encountered this same problem when trying to set up access to a Bugzilla installation through SSH tunnels. If you try to log in from, say, http://localhost:1234/, Bugzilla will redirect to http://urlbase/ instead. I used the same workaround as Clement OUDOT.
You need to log in
before you can comment on or make changes to this bug.
Description
•