404存在的文件错误?

脚本向我的URL发出GET请求,如下所示:

http://mydomain.com/cgi-bin/uu_ini_status_audios.pl?tmp_sid=b742be1d131c4d32237a9f1fcdca659e&rnd_id=0.2363453360320319

不过,我立刻得到了一个404回来:

The requested URL /cgi-bin/uu_ini_status_audios.pl was not found on this server.

但是这个脚本存在于我的服务器上,我可以看到这个文件! 它有正确的权限(我给了它777肯定)。 它也由我的apache用户和它在组apache中拥有。

我在想什么?

感谢您的帮助!

更新

我认为这将是一个htaccess(重写),但我不认为它已经是了。 我试图把一个index.php文件放在那里,并尝试通过我的URL访问它,但我甚至不能这样做! 我试过这个:

http://mydoamin.com/cgi-bin/index.php – 相同的404错误! 我在myerror日志中得到这个:

 [Tue Sep 14 14:42:49 2010] [error] [client xx.xxx.xx.xxx] script not found or unable to stat: /var/www/vhosts/mydomain.com/cgi-bin 

Access_log文件:

xx.xxx.xx.xxx – [14 / Sep / 2010:14:48:25 +0200]“GET /cgi-bin/index.php HTTP / 1.1”404 475“ – ”“Mozilla / 5.0 U; Windows NT 6.0; en-US; rv:1.9.2.9)Gecko / 20100824 Firefox / 3.6.9(.NET CLR 3.5.30729)“

更新2

我的htaccess文件:

 <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^blog/ - [L] RewriteCond %{HTTP_HOST} ^www\.mydomain\.com$ [NC] RewriteRule ^(.*)$ http://mydomain.com/$1 [R=301,L] RewriteRule ^search/(.*)/(.*)/(.*)/(.*) /search.php?searchfor=$1&sortby=$2&page=$3&searchterm=$4 RewriteRule ^confirmemail/(.*) /confirmemail.php?code=$1 RewriteRule ^resetpassword/(.*) /resetpassword.php?code=$1 RewriteRule ^resendconfirmation/(.*) /resendconfirmation.php?userid=$1 RewriteRule ^categories/ /categories.php RewriteRule ^([-_~*a-zA-Z0-9]+)(\/)?$ /memberprofile.php?username=$1 RewriteRule ^browse/audios/(.*)/(.*)/(.*)/(.*) /audios.php?sortby=$1&filter=$2&page=$3&title=$4 RewriteRule ^browse/categories/audios/(.*)/(.*)/(.*)/(.*) /categoryaudios.php?sortby=$1&filter=$2&page=$3&title=$4 RewriteRule ^audios/(.*)/(.*) /playaudio.php?audioid=$1&title=$2 RewriteRule ^download/audio/(.*)/(.*) /downloadaudio.php?AUDIOID=$1&title=$2 RewriteRule ^members/audios/(.*)/(.*) /memberaudios.php?pid=$1&username=$2 RewriteRule ^syndicate/audios/(.*)/(.*) /syndicateaudios.php?filter=$1&title=$2 </IfModule> 

更新3

 [root@smydomain ~]# ls -la /var/www/vhosts/mydoamin.com/httpdocs/cgi-bin/ total 60 drwxr-xr-x 3 apache root 4096 Sep 14 14:37 . drwxr-x--- 20 som psaserv 4096 Sep 14 14:40 .. drwxr-xr-x 2 apache root 4096 Sep 7 03:01 configs -rwxrwxrwx 1 apache root 4 Sep 14 14:37 index.php -rwxrwxrwx 1 apache apache 6520 Sep 7 03:01 uu_ini_status_audios.pl -rwxr-xr-x 1 apache root 3215 Sep 7 03:01 uu_lib_audios.pl -rwxr-xr-x 1 apache root 30249 Sep 7 03:01 uu_upload_audios.pl 

SuExec正在为我造成这个问题。

禁用这意味着我的脚本在cgi-bin中可以运行。 但是您必须确保目录和脚本具有相同的权限(即0755)。另外,目录和脚本必须由同一个人拥有。

这些是让我的脚本工作的要求! 我希望这可以帮助别人。

在你的文章中,你说它找不到/var/www/vhosts/mydomain.com/cgi-bin ; 当你运行ls -la /var/www/vhosts/mydomain.com/cgi-bin时会发生什么?

另外,我注意到它说它不能统计cgi-bin 文件夹 ; 是您的mod_rewrite规则将/var/www/vhosts/mydomain.com/cgi-bin/index.php所有请求错误地转发给/var/www/vhosts/mydomain.com/cgi-bin

更新你的问题,如果你发现更多。

编辑 :通过设置以下来启用mod_write日志 :

 RewriteLog /path/to/where/logs/live RewriteLogLevel 5 

这应该给你足够的数据,看看mod_rewrite是否影响你的请求。

我也看到了一个URL报告为404到Firefox的错误。 将相同的URL传递给wget返回500内部服务器错误,并在日志文件中显示错误。 对于有这个问题的其他人来说,值得一试wget

在我的情况下,这是试图从一个不存在的目录中的PHP脚本中包含一个文件的结果。