Home > Linux, Versioning, Web server, apache, git > Installing git for webdav access the kernel.org way

Installing git for webdav access the kernel.org way

February 17th, 2009 Leave a comment Go to comments

This how to is strongly based on the official kernel.org howto. It has been applied to a Ubuntu server 8.10 installation.

First we install apache 2.2:

apt-get install apache2 git-core

We create our repository and the needed data structure:

cd /var/www
mkdir my-new-repo.git
cd my-new-repo.git
git --bare init
chown -R www-data.www-data .

We enable the dav module for apache:

a2enmod dav_fs

Now we configure apache:

vim /etc/apache2/conf.d/git.conf

We can add now the following configuration:

<Location /my-new-repo.git>
        DAV on
        AuthType Basic
        AuthName "Git"
        AuthUserFile /etc/apache2/passwd.git
        Require valid-user
</Location>

Now we can add a user to our git repository:

htpasswd -c /etc/apache2/passwd.git <user>

Now we can restart the apache web server in order to apply our changes:

/etc/init.d/apache2 restart