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

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.

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>

Need Your Help

How does the browser know if a script is finished loading?

javascript

How does the web browser know if the script inside &lt;script&gt; tag has finished loading?

How do I tell a C program to create n arrays, reading n by scanf?

c arrays function sum

I'd like to create a small program that adds, subtracts, multiplies and does a cross product for vectors.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.