Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running a standalone tracd for multiple projects:

 tracd -p 8080 --basic-auth="*,/path/to/projects/.htpasswd," -e /path/to/projects

The project environments are created under the /path/to/projects and the users are added to /path/to/projects/.htpasswd. This makes users to be shared across the projects, i.e. any user can access any project.

Is there any easy way to make per-project based user authentication using the standalone setup? I'm looking for a solution like this:

tracd -p 8080 --basic-auth="*,.htpasswd," -e /path/to/projects

where the path of .htpasswd is relative to project enviroment, i.e. each environment has its own .htpasswd and the users are not crossed across the projects.

share|improve this question
up vote 1 down vote accepted

I do not believe that you can use a different .htpasswd file per project to manage users in a single Trac install (when using Trac's internal web server). I know that it is something that is being considered by the Trac community (see Comprehensive Solution for Multiple Projects for more information).

That being said, you do have the option of running Trac through Apache with Python to host multiple projects which opens the door a bit. See Multiple Projects in Trac through Apache. The short version is that in Apache, you'll do the following:

ScriptAlias /project /path/to/trac.cgi

<Location "/project">
    SetEnv TRAC_ENV "/path/to/trac/project"

<Location "/project/login">
    AuthType basic
    AuthName "project - trac"
    AuthUserFile "/path/to/svn-auth-file"
    Require valid-user

If you need to keep Trac as its own webserver, you can definitely set different permissions for different projects even when all Trac projects share the same .htpasswd file. That way a user can be TRAC_ADMIN or WIKI_ADMIN of one Trac project while not having those permissions in a second Trac project. You can do this from the command line using the trac-admin tool. For example:

trac-admin /path/to/projenv permission add bob REPORT_DELETE

Or you can accomplish the same from the GUI (when logged in with a user with TRAC_ADMIN privileges to a specific project, go to Admin->Privileges).

For more on using the command line trac-admin tool for setting permissions (users and groups) see Trac Permissions. A more fine-tuned option for managing permissions using permission policies can be found at Trac Permission Policies.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.