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