Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux基礎 >> Linux基礎知識

CentOS 5 上以 Apache 與 SVK 搭配網域帳號驗證

要讓 SVN 走 HTTPS 並直接用 Windows 網域帳號登入,需要把 httpd、mod_auth_pam 與 winbind 串起來。以下為 CentOS 5 的實作順序。

一、以 rpm 安裝所需套件

httpd
httpd-devel
pam-devel
subversion
subversion-perl

以上都裝好之後,執行 cpan SVK 即可完成 SVK 安裝。

二、為 http 啟用 SSL

# 1. 產生 key 與 request
openssl req -new > new.cert.csr

# 2. 移除 key 的 passphrase(選用)
openssl rsa -in privkey.pem -out new.cert.key

# 3. 將 request 轉為自簽憑證
openssl x509 -in new.cert.csr -out new.cert.cert -req -signkey new.cert.key -days 1825

# 4. 憑證與私鑰放到適當位置
cp new.cert.cert /etc/apache/ssl.crt/server.crt
cp new.cert.key /etc/apache/ssl.key/server.key

三、加入網域並編譯 mod_auth_pam

Linux 加入 Windows 網域的配置此處不多贅述。mod_auth_pam 沒有現成套件,需下載源碼自行編譯;只要前述套件齊備,通常不會遇到問題。

四、改用網域帳號驗證

我的系統直接以 winbind 與網域整合,因此編輯 /etc/pam.d/httpd:

auth required /lib/security/pam_winbind.so
account required pam_permit.so

如此一來,SVN 就能透過 HTTPS 以網域使用者身分完成驗證。

Copyright © Linux教程網 All Rights Reserved