总论性的文章:http://woodyhuang.iteye.com/blog/1485754
具体操作:
1 安装gitweb
(1)安装Apache网络服务器
sudo apt-get install apache2
(2)安装Gitweb
$ sudo apt-get install gitweb
gitweb.cgi 脚本安装在 /usr/lib/cgi-bin/ 中,该目录为默认 ubuntu 上 apache2 的 cgi-bin 目录。所以,打开:http://127.0.0.1/cgi-bin/gitweb.cgi
默认没有 css 加载,把 gitweb 要用的静态文件连接到 DocumentRoot 下:
$ cd /var/www/
$ sudo ln -s /usr/share/gitweb/* .
注:现在在浏览器中输入http://127.0.0.1/cgi-bin/gitweb.cgi,应该就能看见了
(3)修改配置文件,添加git项目:
$ sudo vi /etc/gitweb.conf
编辑$projectroot = "/home/huajun/gitbase";
注:如有多个git项目需要通过gitweb管理,则需有多个$projectroot
作者注:我咋安装的时候根据很多的博客去做的,因为对于网路技术也是不太懂,所以……
/etc/apache2/conf.d/gitweb这个文件好像刚开始没有,所以我又重装了gitweb,各种搞后,不知到为什么就好了
(4)修改上面的文件:
sudo vi /etc/apache2/conf.d/gitweb
更改为:
Alias /gitweb /usr/share/gitweb
Redirect permanent /repos /gitweb
<Directory /usr/share/gitweb> http://write.blog.youkuaiyun.com/postedit?ref=toolbar&ticket=ST-115563-w6R0tqmm6MCkUjf0hxzA-passport.youkuaiyun.com
Options FollowSymLinks +ExecCGI
AddHandler cgi-script .cgi
#AuthType Basic
#AuthName "Restricted Files"
#AuthUserFile /opt/access/git.passwd
#Require valid-user
</Directory>
其中#号部分为权限问题,这个新手不要去做,其实我也不会
现在:在浏览器中输入:172.18.34.59/gitweb或 172.18.34.59/repos 就能看到自己的GITWEB的内容了。
现在还有个问题是大家看到每个项目的描述不是自己想要的,那么我们可以更改每个项目下的description文件进行修改
2 安装Smart Http提供代码下载、上传服务:
现在先不搞
安装过程中的错误,解决办法:
1.PHP安装提示:使用 /usr/bin/php5 来提供 /usr/bin/php (php),于 自动模式 中。
2.提示ubuntu缺少 mysqli 扩展。请检查 PHP 配置,
在/etc/php5/cgi/php.ini,添加extension_dir:/usr/lib/php5/20090626+lfs这目录
extension=/usr/lib/php5/20090626+lfs/mysql.so
extension=/usr/lib/php5/20090626+lfs/mysqli.so
3.配置gitweb时,为apache2增加响应是在
sudo vi /etc/apache2/conf.d/gitweb
修改为:
Alias /gitweb /usr/share/gitweb
Redirect permanent /repos /gitweb
<Directory /usr/share/gitweb>
Options FollowSymLinks +ExecCGI
AddHandler cgi-script .cgi
AuthType Basic
AuthName "Restricted Files"
AuthUserFile /opt/access/git.passwd
Require valid-user
</Directory>
-->通过访问:172.18.34.59/gitweb实现 或 172.18.34.59/repos实现