Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Getting a 403 when attempting to set up gitweb [Solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Ma3oxuct
Guru
Guru


Joined: 18 Apr 2003
Posts: 523

PostPosted: Sat Jul 15, 2006 7:03 pm    Post subject: Getting a 403 when attempting to set up gitweb [Solved] Reply with quote

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:
Code:
<Directory /var/www/localhost/htdocs/gitweb>
Options ExecCGI
</Directory>

8) After restarting Apache, I got a 403 error, saying:
Code:
"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:
Code:
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:
Code:
<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
Back to top
View user's profile Send private message
intgr
Apprentice
Apprentice


Joined: 23 Jun 2004
Posts: 225
Location: Earth, Sol, Milky Way

PostPosted: Sat Jul 15, 2006 7:24 pm    Post subject: Re: Getting a 403 when attempting to set up gitweb Reply with quote

Ma3oxuct wrote:
Code:
Ma3oxuct gitweb # ls -la
[...]
-rwxr-xr-x 2 root   root   82160 Jul 15 13:37 gitweb.cgi

Code:
<Directory /var/www/localhost/htdocs/gitweb>
[...]
     DirectoryIndex webgit.cgi
[...]
</Directory>

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


I'm clueless about git, but sounds like gitweb.cgi and webgit.cgi would be different filenames. :)
Back to top
View user's profile Send private message
Ma3oxuct
Guru
Guru


Joined: 18 Apr 2003
Posts: 523

PostPosted: Sat Jul 15, 2006 7:36 pm    Post subject: Reply with quote

^^^ 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:

Code:
# 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 :).
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum