Intsall the application
sudo apt-get install gitweb
Create a new folder in /var/www and change into that directory like:
sudo mkdir /var/www/gitweb
cd /var/www/gitweb
Create a softlink to the /var/www/gitweb folder from where the css and the pics of gitweb originally do reside:
sudo ln -s /usr/share/gitweb/* .
Now we have all things linked to the correct place.
Then we need to modify the apache.conf. This must happen only if we do not have already this line enabled in apache.conf:
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
So if this line isn’t in your apache.conf, then add this line and another one like:
sudo nano /etc/apache2/apache.conf
##add the following two lines:
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
Include /etc/gitweb/apache.conf
Then we need to create a folder in /etc namely “gitweb” and add the apache.conf for gitweb there.
sudo mkdir /etc/gitweb
Then we add a file namely apache.conf in it like:
sudo nano /etc/gitweb/apache.conf
And we add the following code in it:
Options Indexes FollowSymlinks ExecCGI
DirectoryIndex /cgi-bin/gitweb.cgi
AllowOverride All
Save the file. Then we need to configure the last file, namely gitweb.conf:
sudo nano /etc/gitweb.conf
There we have to enter the following code:
$# path to git projects (.git)
$projectroot = "/var/www/";
# directory to use for temp files
$git_temp = "/tmp";
# target of the home link on top of all pages
#$home_link = $my_uri || "/";
# html text to include at home page
$home_text = "indextext.html";
# file with project list; by default, simply scan the projectroot dir.
$projects_list = $projectroot;
# stylesheet to use
$stylesheet = "/gitweb/gitweb.css";
Finally: restart the server like:
sudo /etc/init.d/apache2 restart
No comments:
Post a Comment