简体   繁体   English

如何使用git-http-backend解决导致错误500的suexec策略违规?

[英]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. 我正试图让git-http-backend在我的远程vps上运行而没有运气。 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. 我以类似于这个问题的方式调整了httpd.conf,但是一旦我添加ScriptAlias指令,就会发生错误。

Apache error log: Apache错误日志:

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

Suexec log Suexec日志

 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? 任何人都可以评论一个人通常如何解决suexec问题?

EDIT 编辑

The main problem seemed to be that the web server is not allowed to run cgi scripts. 主要问题似乎是不允许Web服务器运行cgi脚本。

The documentation on configuring suexec is beyond me at the moment. 目前,关于配置suexec的文档已经超出了我的范围。 I've chosen to disable it for now, which allows the web server to run these scripts. 我现在选择禁用它,这允许Web服务器运行这些脚本。 I can now successfully push to the repo. 我现在可以成功地推销回购。 I found this article helpful. 我发现这篇文章很有帮助。

I had this error while setting up moinmoin. 设置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). 第一行是声明一个进程 - 在这种情况下由testsite:testsite拥有 - 正在尝试执行命令(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). 然后它检查调用进程的用户id /组id,看它是否与要执行的命令匹配,当它失败时触发第二个输出(0/0表示root / root)。

Simply calling chown should fix it: 简单地调用chown应该修复它:

chown -R testsite:testsite </path/to/directory-or-binary>

Alright well obviously you found your way... 好吧,显然你找到了自己的方式......

I spent 7 hours straight today trying to solve this issue, contacted my hosts (godaddy) 3 times. 我今天花了7个小时试图解决这个问题,联系我的主人(godaddy)3次。 All without prevail... 一切都没有占上风......

I ent up turning SUEXEC "off" then re-installed Apache (fresh install) on my server. 我将SUEXEC“关闭”,然后在我的服务器上重新安装Apache(全新安装)。 Finally, when my day was coming to an end, I finally got it to work... 最后,当我的日子即将结束时,我终于开始工作......

我在suexec指令中将/ var / www /目录命名为我的用户,它可以工作..!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM