大网数据广告活动
服务器运维问答

(8)Exec format error: exec of ' /usr/local/download/abc.zip' when access file through apache

· 52CE 我爱测

I had configure mod-auth-token in Apache install on Linux server. I had configure it to enable security in access file while download from server.( As per given on its website here ). Apache configuration : ScriptAlias /downloads…

问题原文

原帖链接 · Yagnesh Agola · CC BY-SA 4.0

I had configure mod-auth-token in Apache install on Linux server.
I had configure it to enable security in access file while download from server.( As per given on its website here).

Apache configuration :

ScriptAlias /downloads/ /usr/local/download/
<Location /downloads/>
  AuthTokenSecret       "SECURESTR"
  AuthTokenPrefix       /downloads/
  AuthTokenTimeout      86400
</Location>

I had generate URL for downloading file from server by simple java program ( which is same as example given here ).
I have below URL to access file
http://download.mysite.com/downloads/9fa653c32af806ba6f43d1a1fb73bfd0/5370c3b3/abc.zip

file abc.zip is located at /usr/local/download/ folder.

When I tried to access / download this file I got the below exception that

[Tue May 13 02:07:28 2014] [error] (8)Exec format error: exec of '/usr/local/download/abc.zip' failed
[Tue May 13 02:07:28 2014] [error] Premature end of script headers: abc.zip  

I don't know what is problem. Is anybody know how to solve this problem?

已采纳解答

原帖链接 · Andrew Schulman · CC BY-SA 3.0

You have ScriptAlias /downloads/ /usr/local/download/, which tells Apache to run all of the files in /usr/local/download as CGI scripts, instead of just serving them up. That's why it says exec of '/usr/local/download/abc.zip' failed. See ScriptAlias.

The solution is to replace ScriptAlias by Alias.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2014-05-12)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0 / CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。