Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Help, .pl file no longer works after edit

by CosmoNo1 (Initiate)
on Aug 24, 2012 at 11:38 UTC ( #989492=perlquestion: print w/ replies, xml ) Need Help??
CosmoNo1 has asked for the wisdom of the Perl Monks concerning the following question:

First of all, I have never dealt with perl before. (That probably explains a lot to start with).
I am editing my friend's website and have edited a .pl file, changing the main image file to have a link attached to it.
I opened the file in dreamweaver and saved it as 'filename'.pl then uploaded it to the server.
I then refreshed the page and got a 500 Internal Server Error

Obviously at this stage I panic. I have broken the damn thing. I upload the original file to replace it but it still shows the 500 error.

These are the details I am now getting:

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

Please contact the server administrator, webmaster@merryhillvancentre.co.uk 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.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/0.9.8e-fips-rhel5 DAV/2 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 mod_qos/9.68 Server at www.merryhillvancentre.co.uk Port 80


If you could advise me what I have done wrong (apart from touching it in the first place!!) I will promise to not touch the damn thing again, or learn more so I don't break it.!!

I am at your mercy (as is that particular website page...)

Dave

Comment on Help, .pl file no longer works after edit
Re: Help, .pl file no longer works after edit
by Corion (Pope) on Aug 24, 2012 at 11:42 UTC

    Inform yourself about whether that web host does regular backups. Maybe you can simply restore from backup.

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

    Have you looked in the error log? Most likely there is information about what went wrong there.

    If you have shell access to the machine, you can also try out your Perl script from the command line, and see some error messages directly:

    > # Check for compilation > perl -c that-script.pl > # Check for running the script > perl that-script.pl > # Check for running the script with CGI parameter foo set to bar > perl that-script.pl foo=bar
Re: Help, .pl file no longer works after edit
by moritz (Cardinal) on Aug 24, 2012 at 11:42 UTC
    More information about this error may be available in the server error log.

    That's the crucial part. You need to find the error log, because it contains the information you need to actually fix problem.

    The location of the error log file is configured in the apache (and often in the virtual host) configuration file. On a Debian system it's typically /var/log/apache2/error.log or /var/log/apache2/yourdomain.tld/error.log

Re: Help, .pl file no longer works after edit
by flexvault (Parson) on Aug 24, 2012 at 11:47 UTC

    CosmoNo1,

    This is probably not a Perl problem. Apache2 probably can't find the file because of a change in owner or group. Send an email to the admin and copy your message, it will give them a laugh and hopefully they will fix it for you. They have access to the Apache2 logs.

    Good Luck!

    "Well done is better than well said." - Benjamin Franklin

      I figured it would give them a laugh (as it probably has for you all - I can hear it now... "damn amateurs should just leave the stuff alone...")
      I will send a begging email as well as search for the log myself..
      Fingers crossed I can get it sorted and 'leave the hell alone' in the future...

      Thanks

        Welcome CosmoNo1,

        Another way to look at this...

          Everyone makes mistakes, but it's learning from those mistakes that matters!

        I suspect that if you had used 'vi' or 'vim' to edit the file you would have been okay. I mentioned the 'laugh' to get it fixed quickly, not for you to stop learning.

        Most system admins deal with angry users all day, so if you make them laugh and admit that you're learning, then they will probably help. Maybe start a new thread and post the code that is a problem and what you changed. Since your not under pressure, make sure you post the code within

        <code>

        </code>

        You may be pleased to find PM a resource for the future!

        Good Luck and keep Learning about Perl!

        "Well done is better than well said." - Benjamin Franklin

Re: Help, .pl file no longer works after edit
by Anonymous Monk on Aug 24, 2012 at 12:03 UTC

      Thank you all, I have realised what I did wrong.
      I did not set the file to be executable (I would be dangerous if I had a brain...)
      I have now set it and it works fine...

      The CGI Help Guide nailed it as I remember seeing 644 when I uploaded the file...

      Thank you Anonymous Monk and everyone else for your suggestions

      Dave

Re: Help, .pl file no longer works after edit
by aitap (Deacon) on Aug 24, 2012 at 12:28 UTC

    I am editing my friend's website and have edited a .pl file, changing the main image file to have a link attached to it. I opened the file in dreamweaver and saved it as 'filename'.pl then uploaded it to the server.
    DreamWeawer is an HTML editor, not Perl IDE. Perhaps it have broken your file somehow.

    More information about this error may be available in the server error log.
    Do you have access to the server logs? Shell access? Any backups?

    Sorry if my advice was wrong.
Re: Help, .pl file no longer works after edit
by linuxkid (Sexton) on Aug 24, 2012 at 15:25 UTC

    Check permissions, and then make sure that the server allows cgi scripts anywhere, some only allow them in the cgi-bin directory.

    --linuxkid


    imrunningoutofideas.co.cc

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (13)
As of 2014-09-17 20:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (98 votes), past polls