Fedora (Ubuntu) 搭建 Git 服务器方法 -- set Git sever on Fedora(Ubuntu)

本文提供了一步一步的指南,详细解释了如何在Fedora或Ubuntu系统上安装并配置SSH服务器、Git核心、Gitosis以及GitWeb,最终实现Git服务器的搭建。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Fedora (Ubuntu) 搭建 Git 服务器方法 -- set Git sever on Fedora(Ubuntu)

1. install openssh-server
cmd: yum install openssh-server (ubuntu: sudo apt-get install openssh-server)

2. install git-core
cmd: yum install git-core (ubuntu: sudo apt-get install git-core)

3. install gitosis
cmd:
cd ~/ gitosis_setup
git clone git://eagain.net/gitosis 
or git clone https://github.com/res0nat0r/gitosis.git
or download the gitosis files(from: https://github.com/res0nat0r/gitosis) and unexpressed to gitosis_setup/
(yum install python-setuptools)
python setup.py install

4. create git user
cmd:
useradd -m git (ubuntu: sudo useradd -m git)
passwd git (ubuntu: sudo password git)
   
5. initial the gitosis
//first copy ssh key id_rsa.pub(google for id_rsa.pub produce) to /tmp then:
cmd:
cd /tmp
chmod 777 id_rsa.pub (ubuntu: sudo chmod 777 id_rsa.pub)
sudo -H -u git gitosis-init < id_rsa.pub
//enable others can clone the gitosis-admin.git
sudo chmod 755 /home/git/repositories/gitosis-admin.git/hooks/post-update
 
6.insatll gitweb
cmd:
yum install gitweb (ubuntu: sudo sudo apt-get gitweb)
 
7.install apache
cmd:
yum install httpd (ubuntu: sudo sudo apt-get apache2)

8. just for Ubuntu:
cmd:
cd /var/ www/ 
sudo ln -s / usr/ share/ gitweb/* .  (do not lost the ".")

9. modify the gitweb.conf file
cmd:
$ echo "\$projectroot = '/srv/git/repositories';" > /etc/gitweb.conf 
(ubuntu: 
cmd:
sudo vim /etc/gitweb.conf
//then change the value of  $projectroot to "/home/git/repositories")
sudo chmod 777 -R /home/git (ubuntu: sudo chmod 777 -R /home/git/repositories)

10. visit the gitweb
http://(localhost or 127.0.0.1 or ip)/git/gitweb.cgi

11. apache config and gitosis admistration
To be continued...




Reference
1. http://blog.youkuaiyun.com/wirror800/article/details/5189564
2. http://blog.youkuaiyun.com/jincheng121/article/details/7487860
3. http://markmcb.com/2008/09/19/installing-gitweb-on-fedora-linux-and-apache/



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值