Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

500 Internal server error

by sachinz2 (Acolyte)
on Feb 06, 2014 at 10:42 UTC ( [id://1073682]=perlquestion: print w/replies, xml ) Need Help??

sachinz2 has asked for the wisdom of the Perl Monks concerning the following question:

I am providing the user an http link so that he can download the file from my server

this link is link "http://my.server.name/cgi-bin/Output/Waybill/waybills01_29_14.csv"

If I give the Wrong filename ,I get an error "The requested URL /cgi-bin/Output/Waybill/waybills01_29_15.csv was not found on this server."

but then for the correct filename also, I get 500 Internal server error

"The server encountered an internal error or misconfiguration and was unable to complete your request."

I am clueless, and all the other work is pending,coz the user need's to process this file for further work

Do i need to change any thing in Apache settings??

Thanks

Replies are listed 'Best First'.
Re: 500 Internal server error
by Anonymous Monk on Feb 06, 2014 at 10:50 UTC
      Hi The error log says
      [Thu Feb 06 11:16:17 2014] [error] [client 198.38.94.79] (13)Permissio +n denied: exec of '/var/www/cgi-bin/Output/Waybill/waybills01_29_14.c +sv' failed [Thu Feb 06 11:16:17 2014] [error] [client 198.38.94.79] Premature end + of script headers: waybills01_29_14.csv
        Is that file a cgi script?
Re: 500 Internal server error
by robby_dobby (Hermit) on Feb 06, 2014 at 11:09 UTC

    Hello sachinz2,

    Please pay more attention next time :-). You're exposing "http://my.server.name/cgi-bin/Output/Waybill/waybills01_29_14.csv" but request "/cgi-bin/Output/Waybill/waybills01_29_15.csv". Remember this:

    • Server:- 404, you messed up
    • Server:- 500, I messed up.

Re: 500 Internal server error
by sundialsvc4 (Abbot) on Feb 06, 2014 at 21:38 UTC

    Here’s the skinny on this one:   Apache has been configured to believe that anything which is sent to <Location /cgi-bin/> corresponds to the name of a file that it should execute, in order to return to you the output from that file being executed.   (You have not specified a Handler ...)   Which is exactly what it is trying to do.   It found a file by that name at that location, but of course it is not executable.   So, Apache throws up its hands.

    What you need to do is to tell Apache, say, that <Location /cgi-bin/Output/Waybill/> should cause a particular Handler, not a file in this location, to be executed.   Upon recognizing this pattern, Apache will (maybe) launch the Handler, and pass the URL-string as input to it.   That script which will be responsible for extracting whatever parameters from it and carrying-out the request.

    An elementary Apache-configuration problem ... and not Perl-specific ... but, confusing nonetheless.

      in c++ the solution is:
      int main(){
      printf("Content-type: text/html\n\n");

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1073682]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (2)
As of 2024-04-19 22:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found