setup_gitweb
Setup Gitweb server
Install
git
gitweb
andhighlight
Enable apache CGI modules and restart web server
Update the Gitweb configs
/etc/gitweb.conf
Added Project root to scan repositories
$projectroot = "/home/git/projects";
Enable syntax highlighting
$feature{'highlight'}{'default'} = [1];
Set project root
$projectroot = "/home/git/projects/";
Set project list
$projects_list = "/home/git/projects.list";
Take a look here for project list and save it in home directory
Visit here for more config details
Run the below command in project source root directory to explore your repository instantly in web-browser without adding to the config files
git instaweb --httpd=apache2 --browser=firefox --local
If you want to run in multiple session, randomize the port number as belowgit instaweb --httpd=apache2 --browser=firefox --local --port $[ $RANDOM % 1000 + 9000 ]'
Explore your git repositories at http://localhost/gitweb
Troubleshooting:
Exec permission issue:
chmod +x /usr/share/gitweb/gitweb.cgi
Apache modules issues: Run
a2enmod cgi
anda2enmod perl
CGIT not linked properly
sudo ln -s /etc/apache2/mods-available/cgi.load /etc/apache2/mods-enabled/
Sometimes noted that
/usr/share/gitweb
directory is not created on reinstall
Last updated