CentOS5.6下gitweb的安装搭建
2012-01-09 19:26
281 查看
这类资料网上有很多,但是因为系统或版本问题,不能完全适用,在这里记录下,希望我犯过的错误能给大家些提示;
这里我们将gitweb安装到 /var/www/cgi-bin/gitweb/,git已经安装,路径为 /usr/local/bin/git
git版本:git-1.7.8.2
repositories地址: /home/gitolite/repositories
1. 用root登录 首先执行
make GITWEB_PROJECTROOT="/home/gitolite/repositories" \
GITWEB_JS="gitweb/static/gitweb.js" \
GITWEB_CSS="gitweb/static/gitweb.css" \
GITWEB_LOGO="gitweb/static/git-logo.png" \
GITWEB_FAVICON="gitweb/static/git-favicon.png" \
bindir=/usr/local/bin \
gitweb
2. make gitwebdir=/var/www/cgi-bin/gitweb install-gitweb
3. 修改/etc/gitweb.conf,若该文件不存在,则新建之
加入如下内容:
$projectroot = "/home/gitolite/repositories";
$GIT = "/usr/local/bin/git" #这行一定要加,gitweb.cgi里默认的GIT路径是/root/bin/git,如果不显式地写出来,会找不到project
4. 修改apache配置文件
[root@gitserver ~]# vim /etc/httpd/conf/httpd.conf
加入以下内容:
<VirtualHost *:80>
ServerName gitserver
DocumentRoot /var/www/cgi-bin/gitweb
<Directory /var/www/cgi-bin/gitweb>
Options ExecCGI +FollowSymLinks +SymLinksIfOwnerMatch
AllowOverride All
order allow,deny
Allow from all
AddHandler cgi-script cgi
DirectoryIndex gitweb.cgi
</Directory>
</VirtualHost>
4.修改repositories及其上级目录的权限
chmod 775 /home/gitolite/repositories
chmod 775 /home/gitolite
若提示“404 project not found”,很大的可能是因为该步骤的权限设置的不正确
5.在浏览器中输入 http://localhost,repository中的所有project都显示出来了
![](http://space.scmlife.com/forum.php?mod=image&aid=25346&size=300x300&key=6be4rzHsnBwaqw%2FFOkWzEqvVwySUMpnKYuFp5nNltR2bTsDEF3jpwByj&nocache=yes&type=fixnone)
参考文档:参见git源代码包中的gitweb安装说明
/usr/local/src/git-1.7.8.2/gitweb/INSTALL
http://progit.org/book/ch4-6.html
这里我们将gitweb安装到 /var/www/cgi-bin/gitweb/,git已经安装,路径为 /usr/local/bin/git
git版本:git-1.7.8.2
repositories地址: /home/gitolite/repositories
1. 用root登录 首先执行
make GITWEB_PROJECTROOT="/home/gitolite/repositories" \
GITWEB_JS="gitweb/static/gitweb.js" \
GITWEB_CSS="gitweb/static/gitweb.css" \
GITWEB_LOGO="gitweb/static/git-logo.png" \
GITWEB_FAVICON="gitweb/static/git-favicon.png" \
bindir=/usr/local/bin \
gitweb
2. make gitwebdir=/var/www/cgi-bin/gitweb install-gitweb
3. 修改/etc/gitweb.conf,若该文件不存在,则新建之
加入如下内容:
$projectroot = "/home/gitolite/repositories";
$GIT = "/usr/local/bin/git" #这行一定要加,gitweb.cgi里默认的GIT路径是/root/bin/git,如果不显式地写出来,会找不到project
4. 修改apache配置文件
[root@gitserver ~]# vim /etc/httpd/conf/httpd.conf
加入以下内容:
<VirtualHost *:80>
ServerName gitserver
DocumentRoot /var/www/cgi-bin/gitweb
<Directory /var/www/cgi-bin/gitweb>
Options ExecCGI +FollowSymLinks +SymLinksIfOwnerMatch
AllowOverride All
order allow,deny
Allow from all
AddHandler cgi-script cgi
DirectoryIndex gitweb.cgi
</Directory>
</VirtualHost>
4.修改repositories及其上级目录的权限
chmod 775 /home/gitolite/repositories
chmod 775 /home/gitolite
若提示“404 project not found”,很大的可能是因为该步骤的权限设置的不正确
5.在浏览器中输入 http://localhost,repository中的所有project都显示出来了
参考文档:参见git源代码包中的gitweb安装说明
/usr/local/src/git-1.7.8.2/gitweb/INSTALL
http://progit.org/book/ch4-6.html
相关文章推荐
- CentOS 6.5下GIT服务器、gitweb搭建
- Linux (centos7) 安装Git搭建服务器以及客户端安装
- centos6.5搭建git服务器 win10 安装git客户端连接 和遇到的问题+解决方式
- CentOS下Git服务器搭建与客户端安装
- centos--git搭建之Gogs安装
- centos6.6安装web版GIT --gogs
- Centos下安装git的web服务器
- CentOS 6.5下GIT服务器、gitweb搭建
- CentOS 6.5下GIT服务器、gitweb搭建
- CentOS下Web服务器环境搭建LNMP一键安装包
- windows 下搭建web服务器安装centos系统
- centos 6.3 搭建git/gitosis/gitweb
- redhat/centos 6.3 搭建git/gitosis/gitweb详细过程(1)
- 2. CentOS远程搭建JavaWeb环境:安装Tomcat
- 搭建Web服务器之Step6:CentOS6.3安装JDK和环境配置
- redhat/centos 6.3 搭建git/gitosis/gitweb详细过程(2)
- CentOS6.8下Jenkins+maven+tomcat+git+shell自动构建、部署web应用环境的搭建
- Centos下安装git的web服务器
- CentOS 7下快速安装Gitlab,搭建个人或者公司内部使用的Git服务器