Install msysgit + Apache-gitweb Server

Source: Internet
Author: User

After the GIT server is installed, you can clone http: // Through git ://... but you cannot use a browser to view the library information. Therefore, you need to install the gitweb server.

To install the gitweb server, you need to modify two files: httpd. conf of Apache and gitweb. cgi of msysgit.

1. modify the configuration file conf \ httpd. conf of Apache
There are two ways to configure the Apache server: one is to write directly in httpd. conf, and the other is to write indirectly through include. Here we use the include method.

1. Modify the httpd. conf file
Add the following line at the end of the httpd. conf file:

 
Include"C:/program files/git/httpd-git.conf"

This means we will write configuration information about gitweb in the httpd-git.conf.

2. Create a httpd-git.conf File
First, create a httpd-git.conf file under the c: \ Program Files \ git \ directory, and then enter the following content:

 # 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>

Save and restart the Apache server and check whether the server is successfully started. If it cannot be started successfully, check whether the directory above is consistent with your machine and view Apache logs for more troubleshooting information.

2. Modify gitweb. cgi
The gitweb. cgi that comes with msysgit must be modified in three ways:

1. Modify the first line:

 
#! C:/program files/git/bin/perl

2. Modify row 70th:

 
Our $ git ="C:/program files/git/bin/git";

3. Modify row 74th:

 
Our $ projectroot ="/E/Git-parent/";

Note: The msysgit syntax is used here. The drive letter is not followed by a colon.

Check whether the directory is correct.

3. Start Apache
Restart the Apache server again. After successful restart, enter:

    • Http: // localhost/gitweb
    • Http: // localhost/gitdocs

Similarly, if you change the default port number in httpd. conf, add the port number after localhost.

References:
1. https://git.wiki.kernel.org/index.php/MSysGit:GitWeb

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.