ฉันพยายามเรียกใช้ทั้งเซิร์ฟเวอร์ Git ผ่าน http และฉันมี SVN ทำงานบน http แล้วเช่นกัน ฉันวิ่งได้ centos 6
ไฟล์ git.conf ของฉัน (อยู่ใน /etc/httpd/conf.d/) ดูเหมือนว่า
LoadModule authnz_ldap_module modules / mod_authnz_ldap_module.so
LoadModule ldap_module modules / mod_ldap.so
ชื่อเซิร์ฟเวอร์ blahblah / git / repos
DocumentRoot / var / www / git / repos
เปิด SSLE
SSLCertificateFile /etc/ssl/server.crt
SSLCertificateKeyFile /etc/ssl/server.key
SetEnvIf User-Agent ". * MSIE. *" nokeepalive ssl-cleanan-shutdown
ErrorLog /var/log/httpd/git-error.log
CustomLog /var/log/httpd/git-access.log รวมกัน
# เปิดใช้งานสคริปต์ cgi-bin
ตัวเลือก ExecCGI FollowSymLinks
AddHandler cgi-script cgi
# กำหนดค่าแบ็กเอนด์ Git HTTP
SetEnv GIT_PROJECT_ROOT / var / www / git
SetEnv GIT_HTTP_EXPORT_ALL
SetEnv GITWEB_CONFIG /etc/gitweb.conf
# หมายเหตุ: ให้บริการไฟล์คงที่โดยตรง
AliasMatch ^ / (. * / วัตถุ / [0-9a-f] {2} / [0-9a-f] {38}) $ / var / www / git / $ 1
AliasMatch ^ / (. * / object / pack / pack- [0-9a-f] {40}. (pack | idx)) $ / var / www / git / $ 1
# หมายเหตุ: ให้บริการวัตถุที่เก็บข้อมูลด้วยแบ็กเอนด์ Git HTTP
ScriptAliasMatch \
"(? x) ^ / (. * / (HEAD | \
ข้อมูล / refs | \
วัตถุ / ข้อมูล / [^ /] + | \
git- (อัปโหลด | รับ) -pack)) $ "\
/ usr / libexec / Git-core / Git-http แบ็กเอนด์ / $ 1
# หมายเหตุ: ให้บริการ HTML ด้วย Gitweb
ScriptAlias / gitweb / gitweb.cgi
# การเปิดการเขียน mod ใหม่
เขียนใหม่เปิด
# กำหนดให้หน้าแรกเป็น rewrite ภายในให้กับสคริปต์ gitweb
RewriteRule ^ / $ /gitweb/gitweb.cgi [L]
# สร้างทางลัดสำหรับการซื้อซ้ำดังนั้น URL จึงเป็นเช่นนั้น
# load repository ที่เหมาะสมใน Gitweb
เขียนซ้ำ ^ / (\ w + \. git) $ /? p = $ 1 [L, P]
# เส้นทาง Git-Http-Backend
ScriptAlias / / usr / lib / git-core / git-http-backend /
# ต้องการ Acces สำหรับทรัพยากรทั้งหมด
AuthLDAPURL "ldap: // blah: 3268 / dc = blah, dc = blah? sAMAccountName? sub" NONE
AuthzLDAP ปิดโดยอัตโนมัติ
AuthzGroupFileAuthoritative ปิด
AuthzUserAuthoritative off
AuthLDAPBindDN blah @ blah
AuthLDAPBindPassword "blah"
AuthType พื้นฐาน
AuthName "blah"
AuthBasicProvider ldap
# สำคัญมิฉะนั้น "(9) ตัวอธิบายไฟล์ไม่ถูกต้อง: ไม่สามารถเปิดไฟล์รหัสผ่าน: (null)"
AuthUserFile / dev / null
ต้องการผู้ใช้ที่ถูกต้อง
ไฟล์ subversion.conf ของฉันมีลักษณะเช่นนี้ (อยู่ใน /etc/httpd/conf.d/subversion.conf)
<Location /repos>
DAV svn
SVNPath /var/www/svn/repos
# search user (192.168.1.1 is the IP address of the Active Directory server)
AuthLDAPURL "ldap://blah:3268/dc=blah,dc=blah?sAMAccountName?sub" NONE
AuthzLDAPAuthoritative off
AuthzGroupFileAuthoritative off
AuthzUserAuthoritative off
AuthLDAPBindDN blah@blah
AuthLDAPBindPassword blah
AuthType Basic
AuthName "blah"
AuthBasicProvider ldap
# Important, otherwise "(9)Bad file descriptor: Could not open password file: (null)"
AuthUserFile /dev/null
Require valid-user
</Location>