Re: [fossil-users] $baseurl question (reverse proxy issue)
On Thu, Dec 16, 2010 at 8:20 AM, Richard Hipp wrote: > > > On Thu, Dec 16, 2010 at 8:17 AM, Trou Macacq wrote: > >> 2) Should we consider using relative URLs instead of absolute? >> > > That sounds like it is the right solution. But it is a big change. It > will likely take a week or two to appear. > It turns out that switch to using relative rather than absolute URLs was a simple search-and-replace. I checked in the change there: http://www.fossil-scm.org/fossil/info/daeb10f65f - please give it a try and let me know if it works better for you. Please not that the absolute URL is still used for RSS feeds. (I don't know how to fix that.) If you have a customized header or footer, you'll want to change the $baseurl variable to $home. If you are using the default header and footer, this change will occur automatically. > > > -- > D. Richard Hipp > d...@sqlite.org > -- D. Richard Hipp d...@sqlite.org ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Re: [fossil-users] $baseurl question (reverse proxy issue)
On Thu, Dec 16, 2010 at 04:22:42PM +0200, Trou Macacq wrote: > About fossil server... on production (not ad hoc) this means using > inetd daemon. And I might say something stupid, but I'm almost sure it > not installed on my Ubuntu server 10.10 by default. And I trying to > keep everything as standard as possible. Is this itetd setup really > better than CGI. Where I can find a list of advantages and > disadvantages of this approach? No, it doesn't mean inetd. You might want to use daemon for this purpose though. The primary different to using httpd+CGI is that this only requires a fork per request, not an exec. Joerg ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Re: [fossil-users] $baseurl question (reverse proxy issue)
On Thu, Dec 16, 2010 at 8:22 AM, Trou Macacq wrote: > connected with HTTP_HOST env variable... And this env variable cannot > be changed either in CGI script using bash, or by using SetEnv > mod_rewreite directive. You'll want to do one of two things here: (1) You'll want to investigate how I'm passing requests back to Fossil in my configuration and take good note of the relevant line in /etc/hosts combined with the host I use in my mod_proxy directives, along with how I'm binding Fossil to a particular loopback address. (2) You'll want to investigate how to use proxy_set_header to set the Host header in nginx. Using SetEnv with mod_rewrite, if memory serves, requires the use of the passthrough flag on that particular rule. I wouldn't advise doing this since it just muddles up your configuration with mod_rewrite rules, which can become cumbersome and hard to deal with very quickly. > About fossil server... on production (not ad hoc) this means using > inetd daemon. And I might say something stupid, but I'm almost sure it > not installed on my Ubuntu server 10.10 by default. And I trying to > keep everything as standard as possible. Is this itetd setup really > better than CGI. Where I can find a list of advantages and > disadvantages of this approach? I was hinting more at the analogue between my configuration and yours. If you want to mimic it, that's fine, but you're already on a good path here. My setup was more an illustration how I solved the same problem in my environment. > Many thanks in advance! Hope this helps, -- Nathaniel R. Reindl ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Re: [fossil-users] $baseurl question (reverse proxy issue)
Hi I've tried to solve my issue by using Apache mod_env and mod_rewrite... I'm might be wrong but zBaseURL variable somehow connected with HTTP_HOST env variable... And this env variable cannot be changed either in CGI script using bash, or by using SetEnv mod_rewreite directive. About fossil server... on production (not ad hoc) this means using inetd daemon. And I might say something stupid, but I'm almost sure it not installed on my Ubuntu server 10.10 by default. And I trying to keep everything as standard as possible. Is this itetd setup really better than CGI. Where I can find a list of advantages and disadvantages of this approach? Many thanks in advance! -- @macacq On Thu, Dec 16, 2010 at 3:26 PM, Joerg Sonnenberger wrote: > On Thu, Dec 16, 2010 at 08:20:02AM -0500, Richard Hipp wrote: >> On Thu, Dec 16, 2010 at 8:17 AM, Trou Macacq wrote: >> >> > 2) Should we consider using relative URLs instead of absolute? >> > >> >> That sounds like it is the right solution. But it is a big change. It will >> likely take a week or two to appear. > > It also doesn't work if you want to redirect. I haven't checked, but > does fossil honour PATH_INFO? That's the correct approach for this and > the rest is a question of Apache configuration. > > BTW, I would suggest to not use CGI, but run the reverse proxy directly > on "fossil server". > > Joerg > ___ > fossil-users mailing list > fossil-users@lists.fossil-scm.org > http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users > ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Re: [fossil-users] $baseurl question (reverse proxy issue)
On Thu, Dec 16, 2010 at 7:17 AM, Trou Macacq wrote: > My setup look like this: > > ngnix reverse proxy, port 80 <-> apache daemon running fossil via CGI, port > 8080 > > And since fossil sets absolute URL to all resources embedded... the > people outside have seem my repositories wiki, tickets, and other > filled with links to localhost:8080 I have the feeling that my setup details might be useful to you. Currently, I have this: ** [...@bast-imret ~]$ cat /etc/hosts 127.0.0.1 localhost 127.0.0.101 fossil-corvidae.bast-imret.corvidae.org fossil.corvidae.org [...@bast-imret ~]$ cat /etc/httpd/vhosts.d/fossil.corvidae.org.conf ServerAdmin webmas...@corvidae.org DocumentRoot /var/www/domains/corvidae.org/fossil/htdocs RewriteEngine On RewriteRule ^/$ /index.html [T=text/html] # # Possible values for the Options directive are "None", "All", # or any combination of: # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews # # Note that "MultiViews" must be named *explicitly* --- "Options All" # doesn't give it to you. # # The Options directive is both complicated and important. Please see # http://httpd.apache.org/docs/2.2/mod/core.html#options # for more information. # Options Indexes FollowSymLinks # # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # Options FileInfo AuthConfig Limit # AllowOverride None # # Controls who can get stuff from this server. # Order allow,deny Allow from all # # ScriptAlias: This controls which directories contain server scripts. # ScriptAliases are essentially the same as Aliases, except that # documents in the realname directory are treated as applications and # run by the server when requested rather than as documents sent to the client. # The same rules about trailing "/" apply to ScriptAlias directives as to # Alias. # ScriptAlias /cgi-bin/ "/var/www/domains/corvidae.org/fossil/cgi-bin/" # # "/var/www/cgi-bin" should be changed to whatever your ScriptAliased # CGI directory exists, if you have that configured. # AllowOverride None Options None Order allow,deny Allow from all ServerName fossil.corvidae.org ErrorLog "|/usr/sbin/cronolog -l /var/www/domains/corvidae.org/fossil/logs/error_log /var/www/domains/corvidae.org/fossil/logs/%Y-%m/error_log-%Y-%m-%d" CustomLog "|/usr/sbin/cronolog -l /var/www/domains/corvidae.org/fossil/logs/access_log /var/www/domains/corvidae.org/fossil/logs/%Y-%m/access_log-%Y-%m-%d" combined ProxyPass /cgi-bin ! ProxyPass / http://fossil.corvidae.org/ ProxyPassReverse /cgi-bin ! ProxyPassReverse / http://fossil.corvidae.org/ [...@bast-imret ~]$ cat /etc/xinetd.d/fossil-corvidae service fossil-corvidae { socket_type = stream type = UNLISTED wait = no disable = no user = root server = /opt/fossil/bin/fossil server_args = http /opt/fossil/repositories/corvidae.org/fossil --notfound http://fossil.corvidae.org/cgi-bin/fossil-list-repositories.cgi bind = fossil-corvidae.bast-imret.corvidae.org port = 80 } ** Let me know if this gives you an idea as to how to accomplish what you want. Granted, I'm not running Fossil as CGI, but it's kind of the same arrangement as what you have now with nginx reverse proxying back to Apache/mod_cgi. Hope this helps, -- Nathaniel R. Reindl ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Re: [fossil-users] $baseurl question (reverse proxy issue)
On Thu, Dec 16, 2010 at 08:20:02AM -0500, Richard Hipp wrote: > On Thu, Dec 16, 2010 at 8:17 AM, Trou Macacq wrote: > > > 2) Should we consider using relative URLs instead of absolute? > > > > That sounds like it is the right solution. But it is a big change. It will > likely take a week or two to appear. It also doesn't work if you want to redirect. I haven't checked, but does fossil honour PATH_INFO? That's the correct approach for this and the rest is a question of Apache configuration. BTW, I would suggest to not use CGI, but run the reverse proxy directly on "fossil server". Joerg ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Re: [fossil-users] $baseurl question (reverse proxy issue)
On Thu, Dec 16, 2010 at 8:17 AM, Trou Macacq wrote: > 2) Should we consider using relative URLs instead of absolute? > That sounds like it is the right solution. But it is a big change. It will likely take a week or two to appear. -- D. Richard Hipp d...@sqlite.org ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
[fossil-users] $baseurl question (reverse proxy issue)
Hi all! Thank you all for such a great tool as fossil! I've become big fan of the fossil SCM some time ago and past few days I spent finally moving fossil repositories to the production server (I need some sort of centralized hosting for all my stuff) and funny thing happened -- fossil let me down for the first time :) My setup look like this: ngnix reverse proxy, port 80 <-> apache daemon running fossil via CGI, port 8080 And since fossil sets absolute URL to all resources embedded... the people outside have seem my repositories wiki, tickets, and other filled with links to localhost:8080 I've looked in source code and found that it's a designed behavior of the fossil, and to make everything work for me I got to apply dirty hack cutting hostname and port number (as well protocol) from g.zBaseURL variable (and consequently from $baseurl variable used in html templates). The questions are: 1) Is there any other way around the setting up fossil behind reverse proxy without recompiling? 2) Should we consider using relative URLs instead of absolute? Isn't it a easier way of setting up fossil on the production environments? Many thanks in advance for your answers and for creating really useful tool! -- @macacq ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users