cgi-bin 下不能显示.html, .jpg, CGI程序却没问题

charliey 2003-09-24 01:49:28
我的server一切正常,可以host .jsp,serverlet,php,cgi,mod-perl,但是我发现一般的.html,.jpg却不能显示。报500 Error -- premature end of script header ...

谢了先!!!

Configuration:
Apache+Tomcat
Apache/2.0.45 (Unix) mod_perl/1.99_09 Perl/v5.8.0 PHP/4.3.1 mod_jk/1.2.1 Server at Port 80
...全文
138 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
charliey 2003-10-06
  • 打赏
  • 举报
回复
Thanks very much, saucer. I think that's exactly what I need!!
sdcrab 2003-10-06
  • 打赏
  • 举报
回复
在APACHE的CGI-BIN目录下,一切文件都被当做程序文件来执行,而不考虑文件的扩展名,其他文件不要放在CGI-BIN目录下。
charliey 2003-10-05
  • 打赏
  • 举报
回复
saucer(思归),

Appreciate your response very much!! This question was left untouched in CSDN-Apache for quite a few days, which made me disppointed.

Could you please add more specific information about the AddHandler syntax, an example would be great.

A little more Background:
I do need to handle *.html under cgi-bin. I am trying to install Bugzilla(it works for CGI part), while some *.js, *.jpg, *.html are linked by the perl CGI. While I would like to minimize the effort to config it, also I have another webServer works fine to display .html under cgi-bin. But could not identify what's wrong in my bugzilla case.


Thanks!!
saucer 2003-10-05
  • 打赏
  • 举报
回复
see
在apache里有两种配置执行CGI程序的方法
http://uh1.gz.163.com/cgi/readelite?i=273375
saucer 2003-10-05
  • 打赏
  • 举报
回复
apparently, the web server is trying to execute those files instead of sending them to the browser. cgi-bin is supposed to store code files only, so you shouldn't put html/image files there

look into the configuration file "http.conf", try to find a line with "ScriptAlias"

if you insist on serving html/images from cgi-bin directory, consider to use AddHandler instead
charliey 2003-09-24
  • 打赏
  • 举报
回复
又:文件权限应该没问题:文件 755, 目录 755,

2,203

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 CGI
社区管理员
  • CGI社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧