This topic has been archived. It cannot be replied.
-
工作学习 / 专业技术讨论 / 请教:Redhat9上有个CGI程序总返回500 Internal Server Error,但在Solaris上同样的程序就不出错.apache在运行,却看不到日志查看httpd.conf发现配置正确,如下:
ServerRoot "/usr/local/myapp/apache"
..
ErrorLog logs/error_log
..
Listen 8000
User mike
Group mike
在/usr/local/myapp/apache/logs/没有日志文件error_log,整个文件系统中也找不到此文件.改过目录及文件属主为mike,照样出错,仍然没有日志文件输出.
那位能解答一下?
any suggestion will be appreciated!!
-mike20030405(mike);
2005-7-19
{340}
(#2406775@0)
-
ErrorLog用绝对路径试试
-henryan(Henry);
2005-7-19
(#2406799@0)
-
试过,也不成:(
-mike20030405(mike);
2005-7-19
(#2406814@0)
-
up
-mike20030405(mike);
2005-7-19
(#2407375@0)
-
1.试试改成 ErrorLog /usr/local/myapp/apache/logs/error_log
2.ps -elf | grep httpd 看看第一个httpd 是什么用户起的。一般是root 吧。
3.看看 httpd.conf有没有VirtualHost定义? 有的话看看那里的errorlog
-holdon(again);
2005-7-19
(#2407428@0)
-
另外ps -elf | grep httpd 看看是不是你的httpd. 经常机器里有几套httpd,不一定那个在运行。
-holdon(again);
2005-7-19
(#2407429@0)
-
1.绝对路经试过,不成;2.第一个httpd是root用户,其他的是mike,正常;3.VirtualHost日志也是error_log,而整个系统中都搜索不到此文件..另外,只有一套httpd.多谢!
-mike20030405(mike);
2005-7-19
(#2407469@0)
-
既然是在/usr/local/myapp/apache,那是你自己装的喽?不行就重装把。可以updatedb; locate error_log; locate httpd 查文件。
-holdon(again);
2005-7-19
(#2407611@0)
-
要不把你的httpd.conf贴出来看看
-henryan(Henry);
2005-7-20
(#2409088@0)
-
新建的apache可以运行了,我把相应cgi程序拷贝进来,而且可以看到error_log了. "Premature end of script headers" 代表什么意思?error_log中完整的日志信息是:
[Thu Jul 21 11:47:05 2005] [error] [client 192.168.201.175] Premature end of script headers: mydaemon.exe, referer: http://192.168.50.21:8000/cgi-bin/mydaemon.exe
-mike20030405(mike);
2005-7-21
{192}
(#2411034@0)
-
http://httpd.apache.org/docs/misc/FAQ-F.html#premature-script-headers make sure mydaemon.exe has exec permission first.
-holdon(again);
2005-7-21
(#2411192@0)
-
-rwsr-sr-x 1 root root 4037204 Jul 20 15:27 /usr/local/myapp/apache/cgi-bin/mydaemon.exe I think the permission is enough.
-mike20030405(mike);
2005-7-21
(#2411235@0)
-
what's the result when you directly run mydaemon? also do you really need setuid?
-holdon(again);
2005-7-21
(#2411301@0)
-
I don't think setuid is an issue. How to run the cgi program from the command line? just like: /usr/local/myapp/apache/cgi-bin/mydaemon.exe?cmd=SysDaemon_Start&uid=1&sid=0&name=HPD-SMTPD
-mike20030405(mike);
2005-7-21
(#2411379@0)
-
我将该cgi输出的内容重定向到tst.html.如果把tst.html放到apache/htdocs/下该页面可正常显示(http://192.168.50.21:8000/tst.html);如果放入apache/cgi-bin/下就返回错误(http://192.168.50.21:8000/cgi-bin/ttt.html)还是没有思路:-(
-mike20030405(mike);
2005-7-21
{15}
(#2411482@0)
-
修改CGI程序,在输出页面前改当前路经到/usr/local/myapp/apache/htdocs,还是不行!! 我已经基本晕菜了!
-mike20030405(mike);
2005-7-21
(#2411597@0)
-
It is the permission setup problem for you apache. I have run into this problem before. It is wired. So try to change another CGI directory and assign the related permission to it.
-bugfree(BugFree);
2005-7-22
(#2412598@0)
-
问题解决了,方法见连接, 感谢关注!
-mike20030405(mike);
2005-7-25
(#2417650@0)