redhat/centos 6.3 搭建git/gitosis/gitweb詳細過程(2)

來源:互聯網
上載者:User

1. gitweb安裝

    注意:redhat的iso源是沒有gitweb安裝包,但是centos的源中有,在上一篇文章中給出了如何讓redhat使用centos的源,那麼,只需採用如下命令即可安裝。


  1. # yum install gitweb

2. gitweb配置

  gitweb預設安裝到了/var/www/git下,其設定檔在/etc/gitweb.conf下,另外,httpd的設定檔/etc/httpd/conf.d/git.conf。(1)修改/etc/gitweb.conf
  1. $projectroot = "/var/www/git" //將projectroot修改為/var/www/git

(2)修改/etc/httpd/conf.d/git.conf


  1. Alias /git /var/www/git
  2. <Directory /var/www/git>
  3. Allow from all
  4. AllowOverride all
  5. Order allow,deny
  6. Options +ExecCGI
  7. AddHandler cgi-script .cgi
  8. DirectoryIndex gitweb.cgi
  9. SetEnv GITWEB_CONFIG /etc/gitweb.conf
  10. Dav On
  11. RewriteEngine Off
  12. </Directory>

(3)重啟httpd

  1. /etc/init.d/httpd restart

(4)將gitosis倉庫串連到/var/www/git下,完成web顯示

  1. ln -s /home/git/repositories/test_repo.git /var/www/git/
(5)通過瀏覽器瀏覽

http://xxxx/git/


注意:  如果git clone  http://xxx/git/test_repo.git時出現git update-server-info錯誤,則在test_repos.git目錄下執行 git update-server-info 命令即可(gitosis伺服器的相應倉庫下)。
3. 建立新的git repository在git server的/home/git/repository目錄下,執行如下命令:
  1. mkdir test.git
  2. cd test.git
  3. git init --bare
  4. //可以在這裡添加源檔案,也可以在client端clone之後添加

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.