Saya mencoba mengatur Trac untuk mengotorisasi pengguna melalui plugin LDAP pada server Debian (Lenny).
LDAP tampaknya berfungsi dengan benar, saya dapat melakukan kueri dengan sukses melalui:
ldapsearch -vLx -h 127.0.0.1 -b "dc=example, dc=com" "(sn=mysurname)"
Dan jika saya sengaja merusak pengaturan alamat LDAP Apache saya, saya bisa melihat kesalahan di /var/log/apache2/error.log
2010-08-27 17:19:38,909 Trac[api] WARNING: LDAP error: No such object (dc=examplefoo,dc=com)
Ketika saya mengunjungi http://example.com:8022/trac dan klik tombol masuk, jendela otentikasi muncul (mengonfirmasi lagi bahwa LDAP mulai muncul), namun , ketika saya memasukkan nama pengguna / kata sandi yang benar, saya hanya mendapatkan web Trac halaman dengan:
Trac Error
Authentication information not available. Please refer to the installation documentation.
TracGuide — The Trac User and Administration Guide
Log sama-sama tidak membantu (abaikan kesalahan svn, saya tahu itu):
2010-09-01 14:25:30,553 Trac[api] DEBUG: NEEDS UP?: sys:False, rep:False, stats:False, fields:False, man:False
2010-09-01 14:25:30,577 Trac[env] WARNING: base_url option not set in configuration, generated links may be incorrect
2010-09-01 14:25:30,577 Trac[main] DEBUG: Dispatching <Request "GET u'/login'">
2010-09-01 14:25:30,583 Trac[svn_fs] INFO: Failed to load Subversion bindings
Traceback (most recent call last):
File "/home/web/example/buildout-cache/eggs/Trac-0.11-py2.6.egg/trac/versioncontrol/svn_fs.py", line 251, in __init__
_import_svn()
File "/home/web/example/buildout-cache/eggs/Trac-0.11-py2.6.egg/trac/versioncontrol/svn_fs.py", line 69, in _import_svn
from svn import fs, repos, core, delta
ImportError: No module named svn
2010-09-01 14:25:30,584 Trac[chrome] DEBUG: Prepare chrome data for request
2010-09-01 14:25:30,586 Trac[api] DEBUG: action controllers for ticket workflow: ['ConfigurableTicketWorkflow']
2010-09-01 14:25:30,597 Trac[perm] DEBUG: No policy allowed anonymous performing TICKET_CREATE on None
2010-09-01 14:25:30,599 Trac[perm] DEBUG: No policy allowed anonymous performing TRAC_ADMIN on None
2010-09-01 14:25:30,599 Trac[perm] DEBUG: No policy allowed anonymous performing PERMISSION_GRANT on None
2010-09-01 14:25:30,599 Trac[perm] DEBUG: No policy allowed anonymous performing PERMISSION_REVOKE on None
2010-09-01 14:25:30,599 Trac[perm] DEBUG: No policy allowed anonymous performing TICKET_ADMIN on None
2010-09-01 14:25:30,601 Trac[main] WARNING: 500 Trac Error (Authentication information not available. Please refer to the <a href="https://serverfault.com/trac/wiki/TracInstall#ConfiguringAuthentication" title="Configuring Authentication">installation documentation</a>.)
2010-09-01 14:25:30,621 Trac[perm] DEBUG: No policy allowed anonymous performing EMAIL_VIEW on None
2010-09-01 14:25:30,621 Trac[session] DEBUG: Retrieving session for ID '20e2cfb643bff0f9121fe615'
2010-09-01 14:25:30,641 Trac[tande_filters] DEBUG: self.billing_reports= set([9, 10, 11, 12, 13, 14, 15, 16, 17])
2010-09-01 14:25:30,642 Trac[ticket_webui] DEBUG: TicketWebUiAddon executing
2010-09-01 14:25:30,774 Trac[main] DEBUG: 124 unreachable objects found.
Pengaturan apache saya adalah sebagai berikut.
<VirtualHost example.com:8022>
ServerName example.com
ServerAlias example.com
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPreserveHost On
RewriteEngine On
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule ^/(.*) http://127.0.0.1:8002/$1 [P]
</VirtualHost>
<Location /trac/login>
AuthType Basic
AuthName "Trac"
AuthBasicProvider ldap
Order Allow,Deny
Allow from All
AuthLDAPURL "ldap://127.0.0.1:389/dc=example,dc=com?uid"
#should be on if using groups
AuthzLDAPAuthoritative off
Require valid-user
#Require ldap-group cn=tracusers,dc=example,dc=com
</Location>
Server memiliki sejumlah layanan pengembangan lainnya yang sedang berjalan, karenanya nomor port ganjil.
Trac.ini saya adalah instalasi baru, dengan perubahan berikut:
[ldap]
basedn = dc=example,dc=com
bind_passwd = foo
bind_user = cn=admin,dc=example,dc=com
enable = true
group_rdn = ou=people
host = 127.0.0.1
port = 389
use_tls = false
user_rdn = ou=users
[components]
ldapplugin.* = enabled
Untuk pengujian saya baru saja memulai server Trac dengan:
bin/tracd --port 8202 parts/trac
Di mana saya salah? Rasanya konfigurasi Apache sebagai kesalahan, karena LDAP tampaknya berfungsi.
Apakah itu perintah yang benar untuk memulai server dengan (htpasswd misalnya memiliki opsi sendiri)?
Dalam jangka panjang apa cara terbaik untuk menjalankan server? WSGI?