gitweb

相關資料準備

  • Gitweb 網址: http://gitweb.example.com
  • Git Server Repository 路徑: /var/cache/git # 依照上述兩篇, 預設路徑就是這個.
  • 若有要限制只能某些帳號存取, 帳號、密碼檔位置: /etc/apache2/dav_git.passwd

Gitweb 建置步驟

  1. apt-get install gitweb
  2. vim /etc/gitweb.conf # 修改設定, 若 Repository 位置不在 /var/cache/git, 可由此指定修改.
    $projectroot = "/var/cache/git";
  3. vim /etc/apache2/sites-available/gitweb.conf

    <VirtualHost *:80>

    ServerName 127.0.0.1

    ScriptAlias /gitweb/ /usr/lib/cgi-bin/

    DirectoryIndex /gitweb/gitweb.cgi

    DocumentRoot /home/clean/gitweb

    ErrorLog /var/log/apache2/git.pcware.cn-error.log

    CustomLog "/var/log/apache2/git.pcware.cn-access.log" combined

    </VirtualHost>

  4. ln -s /etc/apache2/sites-available/gitweb.conf /etc/apache2/sites-enabled/gitweb.conf
  5. /etc/init.d/apache2 restart
  6. 瀏覽 http://127.0.0.1/gitweb/ 即可.
  7. 用户认证登录:

你可能感兴趣的:(server)