Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to resolve suexec policy violation causing error 500 using git-http-backend?

Tags:

git

suexec

I'm trying to get git-http-backend working on my remote vps with no luck. I've adjusted httpd.conf in a way similar to the on this question, but as soon as I add the ScriptAlias directive, the error occurs.

Apache error log:

 suexec policy violation: see suexec log for more details
 Premature end of script headers: git-http-backend

Suexec log

 error: target uid/gid (503/500) mismatch with directory (0/0) or program (0/0) or trusted user (0/10)

Can anyone comment on how one normally solves suexec problems?

EDIT

The main problem seemed to be that the web server is not allowed to run cgi scripts.

The documentation on configuring suexec is beyond me at the moment. I've chosen to disable it for now, which allows the web server to run these scripts. I can now successfully push to the repo. I found this article helpful.

like image 830
Luke Avatar asked Sep 08 '12 22:09

Luke


2 Answers

I had this error while setting up moinmoin. I suspect it's both lines you need to pay attention to (which in my case, were):

[2014-09-18 17:17:18]: uid: (1009/testsite) gid: (1006/testsite) cmd: moin.cgi
[2014-09-18 17:17:18]: target uid/gid (1009/1006) mismatch with directory (0/0) or program (0/0)

The first line is stating that a process - in this case owned by testsite:testsite - is attempting to execute a command (moin.cgi).

It then checks the calling process's user id/group id to see if it matches the command to be executed, which triggers the second output when it fails (0/0 indicates root/root).

Simply calling chown should fix it:

chown -R testsite:testsite </path/to/directory-or-binary>
like image 169
doweio Avatar answered Oct 20 '22 00:10

doweio


Alright well obviously you found your way...

I spent 7 hours straight today trying to solve this issue, contacted my hosts (godaddy) 3 times. All without prevail...

I ent up turning SUEXEC "off" then re-installed Apache (fresh install) on my server. Finally, when my day was coming to an end, I finally got it to work...

like image 30
Ilan Kleiman Avatar answered Oct 20 '22 00:10

Ilan Kleiman