Ubuntu10.04搭建Git服务器和GitWeb
来源:互联网 发布:linux 查看系统调用 编辑:程序博客网 时间:2024/05/15 11:03
安装Git服务器:
Ubuntu服务器端:
第一步: 安装必备软件模块
ivan@ubuntu:~$ sudo apt-get install git-core openssh-server openssl-client python-setuptools
第二步:添加git用户用于管理所有代码仓库和用户权限
ivan@ubuntu:~$ sudo useradd -m git
设置git用户密码:
ivan@ubuntu:~$ sudo passwd git
第三步: 安装gitosis
ivan@ubuntu:~$ git clone git://eagain.net/gitosis.git
ivan@ubuntu:~$ cd gitosis
ivan@ubuntu:~$python setup.py install
第四步: 切换到git用户并创建git仓库目录
ivan@ubuntu:~$ su git
Password:
$ cd ../git
$ ls
examples.desktop
$ pwd
/home/git
$ mkdir sample.git
$ cd sample.git
$ git --bare init
Initialized empty Git repository in /home/git/sample.git/
Git客服端,初始化sample.git仓库:
Administrator@ivan ~
$ mkdir sample
Administrator@ivan ~
$ cd sample
Administrator@ivan ~/sample
$ git init
Initialized empty Git repository in /home/Administrator/sample/.git/
Administrator@ivan ~/sample
$ touch readme
Administrator@ivan ~/sample
$ git add .
Administrator@ivan ~/sample
$ git commit -m "First Commit"
[master (root-commit) d5ba460] First Commit
Committer: Ivan.Chen <Administrator@ivan.(none)>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:
git config --global user.name "Your Name"
git config --global user.email you@example.com
If the identity used for this commit is wrong, you can fix it with:
git commit --amend --author='Your Name <you@example.com>'
0 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 readme
Administrator@ivan ~/sample
$ git remote add origin git@192.168.1.202:sample.git
Administrator@ivan ~/sample
$ git push origin master
The authenticity of host '192.168.1.202 (192.168.1.202)' can't be established.
RSA key fingerprint is 17:b8:f6:c0:15:b2:7e:6a:12:36:1f:5c:cc:a1:5e:04.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.1.202' (RSA) to the list of known hosts.
git@192.168.1.202's password:
Counting objects: 3, done.
Writing objects: 100% (3/3), 220 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
To git@192.168.1.202:sample.git
* [new branch] master -> master
安装GitWeb
第一步: 安装必备软件模块
ivan@ubuntu:~$ sudo apt-get install gitweb apache2
第二步:修改gitweb.conf文件中$projectroot值
ivan@ubuntu:~$ sudo vim /etc/gitweb.conf
# path to git projects (<project>.git)
$projectroot = "/home/git";
第三步:修改git仓库文件夹的权限
ivan@ubuntu:~$ sudo chmod 777 -R /home/git
到目前为止gitweb搭建完毕,即可通过浏览器访问http://192.168.1.202:8001/cgi-bin/gitweb.cgi。192.168.1.202是gitweb服务器的IP地址,端口是8001,这里一般默认是80端口,你可以通过修改一下文件
第一步:
ivan@ubuntu:~$ sudo vim /etc/apache2/sites-available/gitserver
<VirtualHost *:8001>
ServerName localhost
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory /usr/lib/cgi-bin/>
Options ExecCGI +FollowSymLinks +SymLinksIfOwnerMatch
AllowOverride All
order allow,deny
Allow from all
AddHandler cgi-script cgi .pl .py
DirectoryIndex gitweb.cgi
</Directory>
</VirtualHost>
第二步:修改apache配置文件
ivan@ubuntu:~$ sudo vim /etc/apache2/ports.conf
NameVirtualHost *:80
Listen 80
NameVirtualHost *:8001
Listen 8001
重启apache server
ivan@ubuntu:~$ sudo /etc/init.d/apache2 restart
* Restarting web server apache2
... waiting [ OK ]
- Ubuntu10.04搭建Git服务器和GitWeb
- Ubuntu10.04搭建Git服务器和GitWeb
- Ubuntu10.04搭建Git服务器和GitWeb
- Ubuntu搭建Git服务器和GitWeb
- UbuntuServer搭建Git服务器之gitdeamon和gitweb(四)
- 使用Smart HTTP和Gitweb搭建简易个人git服务器
- CentOS 6.5下GIT服务器、gitweb搭建
- CentOS 6.5下GIT服务器、gitweb搭建
- gitosis + apache2 + gitweb搭建git服务器
- ubuntu apache服务器和gitweb服务器搭建
- ubuntu10.04 Git服务器搭建之Gitosis
- ubuntu10.04 Git服务器搭建之Repo
- 利用apache2+gitolite+gitweb搭建git服务器的详细步骤
- ubuntu10.04 Git服务器搭建之无权限
- ubuntu10.04 Git服务器搭建之内部下载说明
- 【git】ubuntu12.04 搭建本地 git/gitweb环境
- Ubuntu Nginx 搭建 Gitweb服务器
- 在ubuntu10.04下搭建tftp服务器和nfs服务器
- 分布式事务——可回滚的文件操作
- Luckily, there are a number of options that are available that are worth
- 其实过劳死这一工作现象就发生在你周围
- 利用Spring 发送邮件
- 在 DataList 或Repeater 控件中对数据进行排序
- Ubuntu10.04搭建Git服务器和GitWeb
- JavaScript 删除确认实现方法
- 如何避免吧.svn文件编译到classes目录下
- 一个超牛妈妈对儿子说的话(一)
- service 单例的使用
- 一个超牛妈妈对儿子说的话(二)
- java的序列化
- 10 Famous Microsoft Interview Puzzles
- 一个超牛妈妈对儿子说的话(三)