WebFaction
Community site: login faq

Hi,

I have a problem with trac authentication. I have installed trac here:

http://www.toolpart.hu/trac

my applications directory is under: ~/webapps/trac

I have added the trac using the webfaction panel. Then I wanted to set up trac to use multiple projects. So I have looked at the following documentation: http://wiki.webfaction.com/wiki/TracCgi

I have created a ~/trac/projects directory

added two projects using trac-admin.

I have set

os.environ['TRAC_ENV_PARENT_DIR'] = '~/trac/projects'

in the trac.cgi file so it uses multiple projects.

Then I checked the path: http://www.toolpart.hu/trac

It has recognized these projects. Cool.

Now I want to login and get the following error:

Trac Error Authentication information not available. Please refer to the installation documentation.

In the end of the documentation above I checked the LocationMatch section where I have the following line:

AuthUserFile /somewhere/trac.htpasswd

is this added to the main config file? Where should I put my .htpasswd file under which name in order to make this work? I didn't find a good documentation about this issue. Can you help me out?

Regards, Laszlo

asked 10 Dec '10, 06:23

Vékony László
111
accept rate: 0%


The problem is that when you add a Trac app to your site in our control panel, we generate the following web server config for your virtual host:

<Location /trac/login>
    AuthType Basic
    AuthName "Trac - you"
    AuthUserFile /home/you/webapps/your_trac/.htpasswd
    Require valid-user
</Location>

You can't override the Location directive in .htaccess, so you're stuck using that authentication setup.

As a workaround, you can serve your Trac app as a regular static/CGI/PHP app. Just create a new 'symbolic link to static/cgi/php application' in the control panel, using the path to your existing Trac app in the "extra info" field (eg /home/you/webapps/your_trac), then edit your site to serve the symlink app instead of the Trac app.

You'll also need to create a .htaccess file in the root of your Trac directory with the following contents:

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /cgi-bin/trac.cgi/$1 [L,QSA]
RewriteRule ^$ /cgi-bin/trac.cgi [L]

That way, our control panel will configure the app as a regular CGI app and will not generate any Trac-specific configuration, which means you're free to set up your authentication however you need it.

Hope that helps!

permanent link

answered 10 Dec '10, 10:51

seanf
12.2k41836
accept rate: 37%

edited 23 Apr '13, 14:08

It is working now, thanks.

permanent link

answered 11 Dec '10, 05:13

Vékony László
111
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×26

question asked: 10 Dec '10, 06:23

question was seen: 3,421 times

last updated: 23 Apr '13, 14:08

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM