linux:在apache中运行cgi-bin模块时获取错误500,而不是从ssh运行

时间:2021-11-27 07:10:32

When I login in ssh and run my cgi : everything seems ok

当我在ssh中登录并运行我的cgi时:一切似乎都可以

./modulev2.cgi 
Content-type: text/html
Cache-Control: no-cache, no-store
Pragma: no-cache

When I try to call it through http: http://www.capuccino.fr/cgi-bin/modulev2.cgi I got a nasty:

当我试图通过http:http://www.capuccino.fr/cgi-bin/modulev2.cgi来调用它时,我感到很讨厌:

Internal Server Error

I tried to put chmod777 on cgi-bin, on home etc.. with no success

我试图将chmod777放在cgi-bin上,在家里等等。但没有成功

When looking at logs: cgi.log:

查看日志时:cgi.log:

[2013-07-22 11:21:12]: uid: (1000/capuccin) gid: (100/users) cmd: modulev2.cgi
[2013-07-22 11:21:12]: target uid/gid (1000/100) mismatch with directory (510/100) or program (0/0)

and error_log

和error_log

[Mon Jul 22 11:21:03 2013] [error] [client 91.7.112.187] suexec policy violation: see suexec log for more details
[Mon Jul 22 11:21:03 2013] [error] [client 91.7.112.187] Premature end of script headers: modulev2.cgi

I also tried to change chown and got this in cgi.log

我也试图改变chown并在cgi.log中得到它

[2013-07-22 11:56:36]: target uid/gid (1000/100) mismatch with directory (510/100) or program (1000/100)
[2013-07-22 11:56:39]: uid: (1000/capuccin) gid: (100/users) cmd: modulev2.cgi

Any idea on how to fix that ?

关于如何解决这个问题的任何想法?

1 个解决方案

#1


1  

Seems like wrong file/folder permissions.

似乎错误的文件/文件夹权限。

Try to set permission to 775 and ensure that the owner of the file and folder is correct. Set owner to the same your webserver (something like www-data or apache).

尝试将权限设置为775并确保文件和文件夹的所有者是正确的。将所有者设置为您的网络服务器(类似于www-data或apache)。

#1


1  

Seems like wrong file/folder permissions.

似乎错误的文件/文件夹权限。

Try to set permission to 775 and ensure that the owner of the file and folder is correct. Set owner to the same your webserver (something like www-data or apache).

尝试将权限设置为775并确保文件和文件夹的所有者是正确的。将所有者设置为您的网络服务器(类似于www-data或apache)。