1. gitweb Installation
Note: The RedHat ISO source does not have the gitweb installation package, but the centos source exists. Article To get RedHat to use the centos source, you only need to use the following command to install it.
- # Yum install gitweb
2. gitweb Configuration
Gitweb is installed under/var/www/git by default, and its configuration file is in/etc/gitweb. conf. In addition, the httpd configuration file/etc/httpd/CONF. d/git. conf. (1) Modify/etc/gitweb. conf
- $ Projectroot = "/var/www/git" // change projectroot to/var/www/git
(2) Modify/etc/httpd/CONF. d/git. conf
-
- Alias/git/var/www/git
- <Directory/var/www/git>
-
- Allow from all
-
- AllowOverride all
- Order allow, deny
-
- Options + execcgi
-
- Addhandler CGI-script. cgi
- Directoryindex gitweb. cgi
-
- Setenv gitweb_config/etc/gitweb. conf
-
- Dav on
- Rewriteengine off
-
- </Directory>
(3) Restart httpd
- /Etc/init. d/httpd restart
(4) connect the gitosis repository to/var/www/git to complete Web display.
- Ln-S/home/git/repositories/test_repo.git/var/www/git/
(5) browser browsing
Http: // xxxx/git/
Note: If the GIT clone http: // xxx/git/test_repo.git error occurs, run the GIT Update-server-Info command in the test_repos.git directory (under the corresponding repository of the gitosis server ).
3. Create a New git Repository Run the following command in the/home/git/Repository directory of the GIT Server:
-
- Mkdir test. Git
-
- CD test. Git
-
- Git init -- bare
- // You can add the source file here or after the client side is cloned.