msysgit+apache安装说明 - gitweb服务器部分
2012-10-07 21:13
465 查看
安装好git服务器后,虽然你可通过git clone http://...命令来操作,但还不能用浏览器来查看库的信息,这就需要安装gitweb服务器。
安装gitweb服务器需要修改两个文件,一个仍然是apache的httpd.conf,另一个是msysgit的gitweb.cgi。
一、修改apache的conf\httpd.conf配置文件
对apache服务器的配置有两种方式,一种是直接在httpd.conf里写,另一种是通过Include间接写。这里我们选用Include方式。
1、修改httpd.conf文件
在httpd.conf文件的最后加上下面一行:
这表示我们将在httpd-git.conf里写关于gitweb的配置信息。
2、创建httpd-git.conf文件
我们首先在C:\Program Files\Git\目录下创建一个名为httpd-git.conf文件,然后输入下面的内容:
保存后重新启动Apache服务器,并检查是否成功启动。如果不能成功启动,请检查上面的目录是否与你的机器一致,并查看Apache的日志以获得更多的排错信息。
二、修改gitweb.cgi
msysgit自带的gitweb.cgi需要修改三处:
1、把第一行修改为:
2、把第70行修改为:
3、把第74行修改为:
注意,这里要用msysgit的语法来写,盘符后没有冒号。
同样请检查目录是否正确。
三、启动apache
再次重新启动apache服务器,成功后请在浏览器上输入:
http://localhost/gitweb
http://localhost/gitdocs
同样,如果你在httpd.conf里改变了默认端口号,请在上面localhost后加上端口号。
参考资料:
1、https://git.wiki.kernel.org/index.php/MSysGit:GitWeb
安装gitweb服务器需要修改两个文件,一个仍然是apache的httpd.conf,另一个是msysgit的gitweb.cgi。
一、修改apache的conf\httpd.conf配置文件
对apache服务器的配置有两种方式,一种是直接在httpd.conf里写,另一种是通过Include间接写。这里我们选用Include方式。
1、修改httpd.conf文件
在httpd.conf文件的最后加上下面一行:
Include "C:/Program Files/Git/httpd-git.conf"
这表示我们将在httpd-git.conf里写关于gitweb的配置信息。
2、创建httpd-git.conf文件
我们首先在C:\Program Files\Git\目录下创建一个名为httpd-git.conf文件,然后输入下面的内容:
# Config to make the gitweb CGI available through Apache. Alias /gitweb "C:/Program Files/Git/share/gitweb" <Directory "C:/Program Files/Git/share/gitweb"> AddHandler cgi-script .cgi <Files ~ "\.cgi$"> Options +ExecCGI </Files> AllowOverride None Order allow,deny Allow from all DirectoryIndex gitweb.cgi </Directory> # Config to make the Git html docu available through Apache. Alias /gitdocs "C:/Program Files/Git/doc/git/html" <Directory "C:/Program Files/Git/doc/git/html"> Options Includes Indexes MultiViews AllowOverride None Order allow,deny Allow from all </Directory>
保存后重新启动Apache服务器,并检查是否成功启动。如果不能成功启动,请检查上面的目录是否与你的机器一致,并查看Apache的日志以获得更多的排错信息。
二、修改gitweb.cgi
msysgit自带的gitweb.cgi需要修改三处:
1、把第一行修改为:
#!C:/Program Files/Git/bin/perl
2、把第70行修改为:
our $GIT = "C:/Program Files/Git/bin/git";
3、把第74行修改为:
our $projectroot = "/e/git-parent/";
注意,这里要用msysgit的语法来写,盘符后没有冒号。
同样请检查目录是否正确。
三、启动apache
再次重新启动apache服务器,成功后请在浏览器上输入:
http://localhost/gitweb
http://localhost/gitdocs
同样,如果你在httpd.conf里改变了默认端口号,请在上面localhost后加上端口号。
参考资料:
1、https://git.wiki.kernel.org/index.php/MSysGit:GitWeb
相关文章推荐
- msysgit+apache安装说明 - git服务器部分
- 在apache上安装gitweb实现浏览器访问git服务器
- 在apache上安装gitweb实现浏览器访问git服务器
- 如何安装Ubuntu Apache Web服务器
- 超级web服务器yum 安装apache+源码编译tomcat+awstat+phpmyadmin+mysql+php+AB压力测试
- PHP学习笔记【2】--web服务器和apache服务器的安装
- 步骤详解安装Apache web服务器
- Ubuntu 14.04 Web服务器,Apache的安装和配置
- linxu下apache解析php7——linux安装web服务器18
- php,apache文件说明,精简web服务器
- linux : gerrit搭建配置服务器+git简单操作+apache代理配置+部分遇到的错误及处理
- 韩顺平PHP学习视频笔记整理025web服务器介绍 apache服务器安装
- ubuntu apache服务器和gitweb服务器搭建
- centos7.1下yum安装并使用apache web服务器
- Ubuntu下Apache web服务器的安装、配置及相关操作
- UBUNTU下安装 APACHE+PHP+MYSQL WEB服务器配置
- Centos下安装git的web服务器
- Windows 下安装Apache web服务器
- ubuntu linux 下安装apache mysql php 创建web服务器
- apache web服务器的安装和运行