Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux基礎 >> Linux技術

CentOS 搭建 Git 服務器:Gitosis、Gitweb 與權限管理

Git 是分散式版本控制系統。若要在 CentOS 上建立可多人使用的 Git 服務,可搭配 Gitosis 管理權限,再用 Gitweb 提供網頁檢視。

安裝 Git 與建立版本庫

先用 yum 安裝 Git,建立 git 使用者並設定 user.name 與 user.email。接著建立空版本庫,使用 git init --bare 初始化。

安裝 Gitosis

Gitosis 以 SSH 公鑰管理權限。安裝 python-setuptools 後,取得 gitosis 並安裝。再用 ssh-keygen 產生密鑰,以 gitosis-init 初始化管理權限。

客戶端設定與 Gitweb

客戶端下載 gitosis-admin,修改 gitosis.conf 加入群組與成員,上傳公鑰後提交。若需要網頁介面,可安裝 fcgiwrap、spawn-fcgi 與 Gitweb,並設定 nginx 轉發。

Copyright © Linux教程網 All Rights Reserved