URN Logo
UNIX Resources » Linux » China Linux Forum » Perl 编 程 » 5 » cgi难题
announcement 声明: 本页内容为中国Linux论坛的内容镜像,文章的版权以及其他所有的相关权利属于中国Linux论坛和相应文章的作者,如果转载,请注明文章来源及相关版权信息。
Resources
China Linux Forum(finished)
Linux Forum(finished)
FreeBSD China(finished)
linuxforum.net
  业界新闻与评论
  自由软件杂谈
  IT 人生
  Linux软件快递
  翻译作坊
  Linux图书与评论
  GNU Emacs/XEmacs
  Linux 中文环境和中文化
  Linux桌面与办公软件
  Linux 多媒体与娱乐版
  自由之窗Mozilla
  笔记本电脑上的Linux
  Gentoo
  Debian 一族
  网络管理技术
  Linux 安装与入门
  WEB服务器和FTP服务器
  域名服务器和邮件服务器
  Linux防火墙和代理服务器应用
  文件及打印服务器
  技术培训与认证
  Linux内核技术
  Linux 嵌入技术
  Linux设备驱动程序
  Linux 集群技术
  LINUX平台数据库
  系统和网络安全
  CPU 与 编译器
  系统计算研究所专栏
  Linux下的GUI软件开发
  C/C++编程版
  PHP 技 术
  Java&jsp技术
  Shell编程技术
  Perl 编 程
  Python 编 程
  XML/Web Service 技术
  永远的Unix
  FreeBSD世界
   
cgi难题
cgi难题 - tomduanj [2004-06-03 21:10 | 4,660 byte(s)]
 
 
Re: cgi难题 - Osment [2004-07-27 16:24 | 18 byte(s)]
 
Re: cgi难题 - redcandle [2004-06-03 23:23 | 239 byte(s)]
 
Re: cgi难题 - tomduanj [2004-06-04 10:43 | 25 byte(s)]
 
Re: cgi难题 - youzhiqingnian [2004-06-04 10:55 | 49 byte(s)]
 
Re: cgi难题 - redcandle [2004-06-04 12:29 | 114 byte(s)]
 
Re: cgi难题 - tomduanj [2004-06-04 22:51 | 107 byte(s)]
 
Re: cgi难题 - youzhiqingnian [2004-06-05 01:36 | 151 byte(s)]
 
Re: cgi难题 - redcandle [2004-06-05 10:11 | 34 byte(s)]
 
Re: cgi难题 - tomduanj [2004-06-05 23:10 | 48 byte(s)]
 
Re: cgi难题 - redcandle [2004-06-06 22:48 | 113 byte(s)]
 
Subject: cgi难题
Author: tomduanj    Posted: 2004-06-03 21:10    Length: 4,660 byte(s)
[Original] [Print] [Top]

这个问题已经困扰了我3天了,是这样的,一台REDHAT 服务器上已经运行LB5000论坛1年多时间了,一直运行比较稳定,现在我想在上面做个虚拟主机,再装个同样的论坛,下面是我的httpd.conf配置:

User apache
Group apache

DocumentRoot "/var/www/html"

<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>

<Directory "/var/www/6490/html">
options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>

<Directory "/var/www/6490/cgi-bin/">
AllowOverride All
Options ExecCGI
Order allow,deny
Allow from all
</Directory>

NameVirtualHost 202.96.104.18
<VirtualHost 202.96.104.18>
ServerAdmin duanjiang@zrcc.com
DocumentRoot /var/www/6490/html
ScriptAlias /cgi-bin/ /var/www/6490/cgi-bin/
AddHandler cgi-script .cgi .pl
ServerName mail.hisys.com.cn
ErrorLog logs/6490.hisys.com.cn-errorLog
CustomLog logs/6490.hisys.com.cn-access_log common
</VirtualHost>

<VirtualHost 202.96.104.18>
ServerAdmin tomduanj@hisys.com.cn
DocumentRoot /var/www/html
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
ServerName bbs.hisys.com.cn
ErrorLog logs/bbs.hisys.com.cn-errorLog
CustomLog logs/bbs.hisys.com.cn-access_log common
</VirtualHost>

但运行install.cgi总报错
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, ddg@test.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.


--------------------------------------------------------------------------------

Apache/2.0.46 (Red Hat) Server at mail.hisys.com.cn Port 80

access_log
202.96.104.18 - - [03/Jun/2004:20:08:22 +0800] "GET /cgi-bin/install.cgi HTTP/1.1" 500 624

error_log
[Thu Jun 03 20:08:22 2004] [error] [client 202.96.104.118] Premature end of script headers: install.cgi
[Thu Jun 03 20:08:22 2004] [error] [client 202.96.104.118] Can't modify constant item in substitution (s///) at /var/www/6490/cgi-bin/install.cgi line 171, near "s/[af e `~!@#$\%^&*()+=\{};':",./<>?[]]//isg;"
[Thu Jun 03 20:08:22 2004] [error] [client 202.96.104.118] Execution of /var/www/6490/cgi-bin/install.cgi aborted due to compilation errors.

有人说是cgi程序上传时要用AscII形式,我也尝试过,不行,结果也是如上面错误一样;
有人说是权限、属性不对,我使用了以下命令,仍旧不行
chown -R apacha.apache /var/www/6490
chmod -R 777 /var/www/6490

在console上直接运行/var/www/6490/cgi-bin/install.cgi,出现错误:
[root@hisys 6490]# /var/www/6490/cgi-bin/leoboard.cgi
: bad interpreter: No such file or directoryusr/bin/perl

但运行正在跑的这个论坛,却是好的
/var/www/cgi-bin/leoboard.cgi
[root@hisys 6490]# /var/www/cgi-bin/leoboard.cgi|more
Set-Cookie: onlineview=1; path=/; expires=Sat, 03-Jul-2004 12:31:05 GMT
Set-Cookie: union=1; path=/; expires=Sat, 03-Jul-2004 12:31:05 GMT
Set-Cookie: catlog=; path=/; expires=Sat, 03-Jul-2004 12:31:05 GMT
Expires: Wed, 02 Jun 2004 12:31:05 GMT
Date: Thu, 03 Jun 2004 12:31:05 GMT
Content-Type: text/html; charset=gb2312

<html>

到第什么地方错了?








[Original] [Print] [Top]
Subject: Re: cgi难题
Author: redcandle    Posted: 2004-06-03 23:23    Length: 239 byte(s)
[Original] [Print] [Top]
不太会弄apache

不过你的错误信息里有下面这一句:
: bad interpreter: No such file or directoryusr/bin/perl


请检查你的install.cgi

确认首行是
#! /usr/bin/perl
[Original] [Print] [Top]
Subject: Re: cgi难题
Author: tomduanj    Posted: 2004-06-04 10:43    Length: 25 byte(s)
[Original] [Print] [Top]
perl就是在/usr/bin/perl下
[Original] [Print] [Top]
Subject: Re: cgi难题
Author: youzhiqingnian    Posted: 2004-06-04 10:55    Length: 49 byte(s)
[Original] [Print] [Top]
程序第171行用正则表达式进行替换的那个变量是什么?
[Original] [Print] [Top]
Subject: Re: cgi难题
Author: redcandle    Posted: 2004-06-04 12:29    Length: 114 byte(s)
[Original] [Print] [Top]
把install.cgi的第一行改为
#! /usr/bin/perl

如果已经是这样那就算了,看起来是路径的问题.
[Original] [Print] [Top]
Subject: Re: cgi难题
Author: tomduanj    Posted: 2004-06-04 22:51    Length: 107 byte(s)
[Original] [Print] [Top]
本来就是
#!/usr/bin/perl啊
我感觉不是程序的问题,也不是属性不对的问题,应该是配置那里不对
[Original] [Print] [Top]
Subject: Re: cgi难题
Author: youzhiqingnian    Posted: 2004-06-05 01:36    Length: 151 byte(s)
[Original] [Print] [Top]
似乎你测试和运行的机器不是同一台,在测试的机器上找不到
PERL解释器,而在运行的机器上问题在程序本身,就是在第171
行对一个常量进行修改。
[Original] [Print] [Top]
Subject: Re: cgi难题
Author: redcandle    Posted: 2004-06-05 10:11    Length: 34 byte(s)
[Original] [Print] [Top]
恩. 不妨把第171行注释掉,再运行看看
[Original] [Print] [Top]
Subject: Re: cgi难题
Author: tomduanj    Posted: 2004-06-05 23:10    Length: 48 byte(s)
[Original] [Print] [Top]
问题很奇怪,难道不能在一台机器上跑2个LB5000论坛?
[Original] [Print] [Top]
Subject: Re: cgi难题
Author: redcandle    Posted: 2004-06-06 22:48    Length: 113 byte(s)
[Original] [Print] [Top]
如果路径设置不冲突我想是可以的.

简单的把原有论坛复制一份出来,然后在首页做个链接,应该就能访问.
[Original] [Print] [Top]
Subject: Re: cgi难题
Author: Osment    Posted: 2004-07-27 16:24    Length: 18 byte(s)
[Original] [Print] [Top]
使用 -w 参数看看。
[Original] [Print] [Top]
Subject: ScriptAlias /cgi-bin/ /var/www/6490/cgi-bin/上是否要双引
Author: isgod    Posted: 2004-08-04 10:45    Length: 0 byte(s)
[Original] [Print] [Top]
[Original] [Print] [Top]
« Previous thread
正在学cgi,同样的文件内容,foo.pl在iis下能运行,foo.cgi不行,why?
Perl 编 程
5
Next thread »
老友们还在吗?我回来了!
     

Copyright © 2007 UNIX Resources Network, All Rights Reserved.      About URN | Privacy & Legal | Help | Contact us
备案序号: 京ICP备05006143    webmaster: webmaster@unixresources.net
This page created on 2008-07-17 04:09:04, cost 0.082244157791138 ms.