# Getting a 403 when attempting to set up gitweb [Solved]

## Ma3oxuct

I would not be asking for help here if I did not exhaust the info availible on google.

1) I have my git repository that gitweb is supposed to connect to in "/home/andrey/thesis/.git"

2) I have a symlink to my project in "/var/www/localhost/htdocs/thesis" i.e. in such a way that anyone can see my work by going to: "http://afalko.homelinux.net/thesis/"

3) I edited the /var/www/localhost/htdocs/gitweb/gitweb.cgi file to have: my $projectroot = "/home/andrey/thesis/source" instead of my $projectroot ="/var/git"

4) I created a .htaccess file in /var/www/localhost/htdocs/gitweb/ with the following line: DirectoryIndex gitweb.cgi

5) I created an index folder (in the git dir above) with index.aux inside with the following line: ".git Andrey+Falko"

6) In the same folder I created an optional index.html file with just the text: "Welcome to Andrey Falko's git repository which tracks his development of Vestigium, a package manager,

in addition to the writing of the corresponding thesis project."

7) At this point the cgi script would not execute so I went into /etc/apache2/httpd.conf and uncommented AddHandler cgi-script .cgi and added the following:

```
<Directory /var/www/localhost/htdocs/gitweb>

Options ExecCGI

</Directory>

```

 :Cool:  After restarting Apache, I got a 403 error, saying: 

```
"Forbidden

You don't have permission to access /gitweb/ on this server.

Apache Server at afalko.homelinux.net Port 80"
```

I am still stuck on this error.

Here is what I have tried:

1) Permissions look good: 

```
Ma3oxuct gitweb # ls -la

total 112

drwxr-xr-x 3 root   root    4096 Jul 15 14:53 .

drwxr-xr-x 8 apache apache  4096 Jul 15 12:58 ..

-rw-r--r-- 1 root   root      26 Jul 15 14:53 .htaccess

-rw------- 1 root   root     302 Jul 15 12:58 .webapp

-rw------- 1 root   root     257 Jul 15 12:58 .webapp-gitweb-264

-rwxr-xr-x 2 root   root   82160 Jul 15 13:37 gitweb.cgi

drwxr-xr-x 2 root   root      48 Jul 15 13:34 index

Ma3oxuct gitweb # ls ../ -la

drwxr-xr-x  3 root   root   4096 Jul 15 14:53 gitweb

```

2) I tried commeting Addhandler, removing the .htaccess file and replacing the Directory options with:

```
<Directory /var/www/localhost/htdocs/gitweb>

     AllowOverride None

     Options ExecCGI

     AddHandler cgi-script cgi pl

     DirectoryIndex webgit.cgi

     Order allow,deny

     Allow from all

</Directory>
```

After restarting apache, I got the same error.

I suspect that I might be missing something obvious, and have spent hours trying to get this working. I'd appreciate any help.

Thanks in advance.Last edited by Ma3oxuct on Sat Jul 15, 2006 7:37 pm; edited 1 time in total

----------

## intgr

 *Ma3oxuct wrote:*   

> 
> 
> ```
> Ma3oxuct gitweb # ls -la
> 
> ...

 

I'm clueless about git, but sounds like gitweb.cgi and webgit.cgi would be different filenames.  :Smile: 

----------

## Ma3oxuct

^^^ Yeh that was a typo! Nice find.

I fixed the issue another way though....It weird though: Here is what is in my httpd.conf:

```
# For gitweb

Alias /gitweb /var/www/localhost/htdocs/gitweb/gitweb.cgi

<Directory /var/www/localhost/htdocs/gitweb>

#     AllowOverride None

     Options ExecCGI

     AddHandler cgi-script cgi

#     DirectoryIndex webgit.cgi

#     Order allow,deny

#     Allow from all

</Directory>
```

Notice the Alias line. That is what did it. See for yourselves: http://afalko.homelinux.net/gitweb/

Thanks for the help, intgr  :Smile: .

----------

