linux下perl cgi编程apache如何配置?

发布于 2022-07-17 20:33:23 字数 614 浏览 5 评论 8

在redhat 9.0下进行perl cgi编程,apache都需要做哪些设置啊,还是默认的就行?
我运行时总是出现行
Server error!

The server encountered an internal error and was unable to complete your request.
Error message:
Premature end of script headers: web.cgi
If you think this is a server error, please contact the webmaster

Error 500

localhost
2006Äê05ÔÂ26ÈÕ ÐÇÆÚÎå 02ʱ04*Ö33Ãë
Apache/2.0.40 (Red Hat Linux)
什么原因呢,望大虾指教!Sample TextSample Text

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(8

花桑 2022-07-24 02:16:53

這位弟兄,你還有一堆我上面說的東西沒有測試與給回報結果。

==

苏大泽ㄣ 2022-07-24 02:16:26

我用的是red hat 9.0 内核:2.4.20-8
var/log/httpd中并没有suexec_log文档
我不是以http://hostname/~userid/运行的,我是直接用http://locahost运行的,我没设定virtual host的

Server error!

    The server encountered an internal error and was unable to complete your request.

    Error message:
    Premature end of script headers: htm.cgi

    If you think this is a server error, please contact the webmaster

Error 500

    localhost
    Sat May 27 12:39:04 2006
    Apache/2.0.40 (Red Hat Linux)
问题仍旧没有解决,期待ing

花辞树 2022-07-24 02:15:38

你提供的纪录档案似乎没有资讯...

1. 首先请您提供您的 linux 发行版本,比方你是使用 fedora or RHEL 哪个版本请说明一下.

2. cgi 程式有错误,就一般 rh-based 的版本,预设没有设定 virtual host 的话,纪录档案会是 /var/log/httpd/error_log 该档案内。

3. 若是您是使用 http://hostname/~userid/ 等个人网页来跑 cgi 程式的话,请注意大部分 linux distro 都会配置预设让 apache 以 suexec 方式执行该 cgi 程式,这是让该程式以该使用者身份执行,而不是以原本于 httpd.conf 内的 User/Group 参数指定的身份执行。而该情况纪录档案是在 /var/log/httpd/suexec_log 档案内。

4. 不清楚你的 perl cgi 程式功能为何,但是至少若是你登入主机后,手动于命令列执行该 cgi 程式档案时,不应该出现任何错误讯息。若是有的话你应该贴出来。

建议你直接都删除 /var/log/httpd/ 目录内所有档案,重新启动 apache 服务后,重新连结存取你的 cgi 程式,然后当时候 apache log 档案会比较有明确资讯。

==

内心旳酸楚 2022-07-24 02:04:27

kenduest你好,我看了error_log,内容如下:
[Fri May 26 01:02:42 2006] [notice] Digest: generating secret for digest authentication ...
[Fri May 26 01:02:42 2006] [notice] Digest: done
[Fri May 26 01:02:43 2006] [notice] Apache/2.0.40 (Red Hat Linux) configured -- resuming normal operations
[Fri May 26 01:52:42 2006] [error] [client 127.0.0.1] Directory index forbidden by rule: /var/www/html/
[Fri May 26 02:00:21 2006] [warn] child process 9354 still did not exit, sending a SIGTERM
[Fri May 26 02:00:21 2006] [warn] child process 9355 still did not exit, sending a SIGTERM
[Fri May 26 02:00:21 2006] [warn] child process 9356 still did not exit, sending a SIGTERM
[Fri May 26 02:00:21 2006] [warn] child process 9357 still did not exit, sending a SIGTERM
[Fri May 26 02:00:21 2006] [warn] child process 9358 still did not exit, sending a SIGTERM
[Fri May 26 02:00:21 2006] [warn] child process 9359 still did not exit, sending a SIGTERM
[Fri May 26 02:00:21 2006] [warn] child process 9360 still did not exit, sending a SIGTERM
[Fri May 26 02:00:21 2006] [warn] child process 9361 still did not exit, sending a SIGTERM
[Fri May 26 02:00:21 2006] [warn] child process 9354 still did not exit, sending a SIGTERM
[Fri May 26 02:00:21 2006] [warn] child process 9355 still did not exit, sending a SIGTERM
[Fri May 26 02:00:21 2006] [warn] child process 9356 still did not exit, sending a SIGTERM
[Fri May 26 02:00:21 2006] [warn] child process 9357 still did not exit, sending a SIGTERM
[Fri May 26 02:00:21 2006] [warn] child process 9358 still did not exit, sending a SIGTERM
[Fri May 26 02:00:21 2006] [warn] child process 9359 still did not exit, sending a SIGTERM
[Fri May 26 02:00:21 2006] [warn] child process 9360 still did not exit, sending a SIGTERM
[Fri May 26 02:00:21 2006] [warn] child process 9361 still did not exit, sending a SIGTERM
[Fri May 26 02:00:22 2006] [warn] child process 9354 still did not exit, sending a SIGTERM
[Fri May 26 02:00:22 2006] [warn] child process 9355 still did not exit, sending a SIGTERM
[Fri May 26 02:00:22 2006] [warn] child process 9356 still did not exit, sending a SIGTERM
[Fri May 26 02:00:22 2006] [warn] child process 9357 still did not exit, sending a SIGTERM
[Fri May 26 02:00:22 2006] [warn] child process 9358 still did not exit, sending a SIGTERM
[Fri May 26 02:00:22 2006] [warn] child process 9359 still did not exit, sending a SIGTERM
[Fri May 26 02:00:22 2006] [warn] child process 9360 still did not exit, sending a SIGTERM
[Fri May 26 02:00:22 2006] [warn] child process 9361 still did not exit, sending a SIGTERM
我不大懂啊,能加以解释吗?多谢!

歌入人心 2022-07-24 02:03:07

不是提示你應該要先去看 log 檔案,怎麼一直都不去看 ???????

/var/log/httpd/error_log 與 /var/log/httpd/suexec_log 這類。

==

抱着落日 2022-07-24 01:49:43

Server error!

    The server encountered an internal error and was unable to complete your request.

    Error message:
    Premature end of script headers: new.pl

    If you think this is a server error, please contact the webmaster

Error 500

    localhost
    2006年05月26日 星期五 16时29分50秒
    Apache/2.0.40 (Red Hat Linux)
看了apache配置文档,按上面的配置还是不性,总出现上面的提示,我该怎么办啊?

热风软妹 2022-07-24 01:18:10

我是装rh时从光盘上一块装的apache,mysql,perl,没做别的配置,编的cgi无法运行,总时提示Error 500,我该如何配置apache呢,请高手不吝赐教!小弟不胜感激!

゛时过境迁 2022-07-23 20:04:17

原帖由 alexru 于 2006-5-25 18:07 发表
在redhat 9.0下进行perl cgi编程,apache都需要做哪些设置啊,还是默认的就行?
我运行时总是出现行
Server error!

請先看 apache error_log 檔案查閱更完整的錯誤訊息描述。

==

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文