2

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?

Alex.K.
  • 167
  • 2
  • 2
  • 8
Yagnesh Agola
  • 123
  • 1
  • 6

1 Answers1

5

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.

Andrew Schulman
  • 8,561
  • 21
  • 31
  • 47