I installed Gitosis and Viewgit on an Ubuntu Server. Git and Gitosis work just fine. Though when I try to open /viewgit interface in my browser I get an error:
viewgit/inc/functions.php:66 file_get_contents(/var/git/repositories/test.git/description): failed to open stream: Permission denied [2]
An ls -l gives me following:
root@***:/var/git/repositories# ls -l
drwxr-x--- 8 git git 4096 12. Okt 22:26 gitosis-admin.git
drwxr-x--- 7 git git 4096 12. Okt 22:36 test.git
cd test.git
root@***:/var/git/repositories/test.git# ls -l
drwxr-xr-x 2 git git 4096 12. Okt 22:36 branches
-rw-r--r-- 1 git git 66 12. Okt 22:36 config
-rw-r--r-- 1 git git 18 12. Okt 22:36 description
-rw-r--r-- 1 git git 23 12. Okt 22:36 HEAD
drwxr-xr-x 2 git git 4096 12. Okt 22:36 hooks
drwxr-xr-x 2 git git 4096 12. Okt 22:36 info
drwxr-xr-x 4 git git 4096 12. Okt 22:36 objects
drwxr-xr-x 4 git git 4096 12. Okt 22:36 refs
Users and Groups are always git:git. Any idea? Is it that I have to add the www-data user? I am not a very experienced Ubuntu user, but I keep trying.
EDIT: I made a chmod 777
onto description and now it works fine. Is that the way to go?
The web server has no rights to enter the repo directories. Giving the "others" the read and execute rights on test.git will also solve the problem, so:
should do the job. Setting 777 also gives write rights to everybody which is generally a bad idea on a web server, or any server for that matter.