본문 바로가기
Research/Linux

trac에 Authentication 추가

by sunnyan 2009. 7. 28.
728x90

trac은 자체 id/password 인증이 없다. 따라서, apache의 login모듈을 사용한다.
사용자 id/password를 넣으려면 아래와 같이 수행하면 된다.


Adding Authentication

The simplest way to enable authentication with Apache is to create a password file. Use the htpasswd program to create the password file:

$ htpasswd -c /somewhere/trac.htpasswd admin
New password: <type password>
Re-type new password: <type password again>
Adding password for user admin

After the first user, you dont need the "-c" option anymore:

$ htpasswd /somewhere/trac.htpasswd john
New password: <type password>
Re-type new password: <type password again>
Adding password for user john

See the man page for htpasswd for full documentation.

After you've created the users, you can set their permissions using TracPermissions.

Now, you'll need to enable authentication against the password file in the Apache configuration:

<Location "/trac/login">
AuthType Basic
AuthName "Trac"
AuthUserFile /somewhere/trac.htpasswd
Require valid-user
</Location>

If you're hosting multiple projects you can use the same password file for all of them:

<LocationMatch "/trac/[^/]+/login">
AuthType Basic
AuthName "Trac"
AuthUserFile /somewhere/trac.htpasswd
Require valid-user
</LocationMatch>

For better security, it is recommended that you either enable SSL or at least use the “digest” authentication scheme instead of “Basic”. Please read the  Apache HTTPD documentation to find out more. For example, on a Debian 4.0r1 (etch) system the relevant section in apache configuration can look like this:

<Location "/trac/login">
LoadModule auth_digest_module /usr/lib/apache2/modules/mod_auth_digest.so
AuthType Digest
AuthName "trac"
AuthDigestDomain /trac
AuthUserFile /somewhere/trac.htpasswd
Require valid-user
</Location>

and you'll have to create your .htpasswd file with htdigest instead of htpasswd as follows:

# htdigest /somewhere/trac.htpasswd trac admin

where the "trac" parameter above is the same as AuthName above ("Realm" in apache-docs).

728x90

'Research > Linux' 카테고리의 다른 글

TRAC: easy_install 설치  (1) 2009.07.30
TRAC : Setting up Plugin Cache  (0) 2009.07.29
udev가 장치명을 변경할때  (0) 2009.07.17
svnserve 를 xinetd에 등록하기  (0) 2009.07.10
mysql설치 후 제일먼저 해야 할일  (0) 2009.07.09