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

My Trac system has basic http authentication, configured like so:

AuthType Basic
AuthName "TRAC"
AuthUserFile /var/trac/trac-auth-file
Require valid-user

This works in that it prompts for a username and password and only allows the user to access Trac if their credentials are validated.

Failing to provide any credentials (i.e. pressing cancel on the prompt) gives a 401 Authorization Required error.

However, what I actually want to happen is instead of a 401, it just allows the user access as an anonymous user.

The Trac system itself supports an anonymous user - in the trac permissions settings, there are a whole heap of privileges that can be configured for anonymous users.

I just don't know how (or even if it is possible) to configure the htaccess so a htpasswd file is used, but have it fall back to anonymous access rather than error with a 401

share|improve this question
up vote 0 down vote accepted

You need two sections in your Apache config. Read this section from the Trac site; I think it will help you.

share|improve this answer
Thanks, it works – asgeo1 Jan 12 '10 at 2:30

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.