Bob Grimes skrev 18. feb. 2011 19:09: > On Thu, Feb 17, 2011 at 12:03 PM, Cooke, Mark <[email protected]> wrote: >> On Mon, Feb 14, 2011 at 12:30 AM, Bob <[email protected]> wrote: > Hi Mark, > > Thanks for the attempts, but they didn't seem to actually make any > difference. Right now, it is actually worse, in that I am getting a > server error 500 (IIRC). > > Anyone else have any pointers? I'll be revisiting this tonight, so if > anyone has any ideas, they would be much appreciated.
Hi, how did it work out? A couple of more ideas (the text below has been edited heavily): >>> I want to support multiple Trac projects, each with their own SVN >>> repos. Then, you’ll probably want to set up parent_dir, as Mark commented. Then trac takes care of listing environments for you, AFAIK. >>> Using trac-admin's deploy command, I have the following trac.wsgi >>> file: I wasn't aware of this command. The wsgi-script looks ok, but has a couple of “pillows” in case of missing environmentsettings, that probably is the reason for your “false positive” of getting a basic trac-page in place of a listing of environments (or simply an error). Basically the deploy-command generates a customized wsgi-script, that is prefilled with paths pointing to the environement on which you ran “deploy”. Have a look at the (shorter) script at: http://trac.edgewall.org/wiki/TracModWSGI, I think the following should suit your setup: import os # Change this to a folder that apache can write to: os.environ['PYTHON_EGG_CACHE'] = '/home/trac/tmp' import trac.web.main def application(environ, start_response): environ['trac.env_parent_dir'] = '/home/trac/projects' return trac.web.main.dispatch_request(environ, start_response) (…) >>> In my Apache2 configuration, I have the following snippit: >>> >>> WSGIScriptAlias /trac /home/trac/cgi-bin/trac.wsgi >>> >>> <Directory /home/trac/cgi-bin/trac.wsgi> >> >> I think this should be the directory, not the wsgi file: >> >> <Directory /home/trac/cgi-bin> # Yes, according to the documentation # You could also set env_parent_dir, egg_cache etc here, I think. >>> WSGIApplicationGroup %{GLOBAL} >>> Order deny,allow >>> Allow from all >>> </Directory> That *should* now work, as far as I can tell from the config. Test that first, then try to add a requirement for authentication. >>> <Location "/trac/ice"> >>> AuthType Basic >>> AuthName "Trac" >>> AuthUserFile /home/trac/projects/ice/conf/htpasswd >>> Require valid-user >>> </Location> >>> Other notes: >>> >>> 1. I do have a suitable password file, with correct permissions, >>> located as indicated. You've verified that, by eg adding?: <Directory /home/trac/test> Options +Indexes AuthType Basic AuthName "Trac" AuthUserFile /home/trac/projects/ice/conf/htpasswd Require valid-user </Directory> (And creating a trac/test folder). >>> >>> 2. mod_wsgi shows up in the Apache2 mods-enabled directory, so I >>> _think_ it is enabled, but I can't seem to test it - following these >>> directions: Try to run “apache2ctl -t -D DUMP_MODULES”. Alternatively, “a2enmod info”, restart apache (“invoke-rc.d apache restart”), and look at the “/server-info”-location. Testing with a simple wsgi-script is also a good idea, see also the mod_wsgi documentation: http://code.google.com/p/modwsgi/wiki/ConfigurationGuidelines As a side note, I’m setting up a complex configuration with multiple tracs using wsgi, and hopefully I’ll be able to help a bit with the t.e.o. mod_wsgi-page. There defintly should be a section on parent_env there, at the very least. Best regards, -- .---. Eirik Schwenke <[email protected]> ( NSD ) Harald Hårfagresgate 29 Rom 150 '---' N-5007 Bergen tlf: (555) 889 13 GPG-key at pgp.mit.edu Id 0x8AA3392C
signature.asc
Description: OpenPGP digital signature
