how to run encrypted scripts in apache?

Discussion in 'Apache' started by redss, Oct 12, 2007.

  1. #1
    I use a utility called shc (http://aplawrence.com/Linux/shc.html) to encrypt a perl script by creating an executable by putting a C wrapper around the script.

    The encrypted executable runs fine from the command line, however I am unable to get it to run through the apache server in cgi-bin (Internal Server Error).

    Is there a change I can make to my httpd.conf to make it work?
     
    redss, Oct 12, 2007 IP
  2. qualityhostings

    qualityhostings Well-Known Member

    Messages:
    1,764
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    105
    #2
    Its because of the file permission error.

    cgi files may not work in normal file permission which is 644 (for php)

    Change the file permission
     
    qualityhostings, Oct 12, 2007 IP
  3. redss

    redss Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I did a chmod 777 on the file, to no avail. More ideas?
     
    redss, Oct 12, 2007 IP
  4. qualityhostings

    qualityhostings Well-Known Member

    Messages:
    1,764
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    105
    #4
    I dont think cgi files needs 777 permission.
    I dont know exactly but I am sure, its other than 777. I did it before some months for a cgi ticketing system installation and it worked only after that permission change. I will update you if I find it.
     
    qualityhostings, Oct 12, 2007 IP
  5. Ladadadada

    Ladadadada Peon

    Messages:
    382
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    0
    #5
    The permission settings for cgi scripts should be 755. This will give you full permissions for the file and everyone else read and execute, but not write. Execute is the important one because that is how cgi scripts work.

    Does the un-encrypted perl file work in a browser ?

    Why are you trying to encrypt it anyway ? Do you not trust the people you share your server with ?
     
    Ladadadada, Oct 13, 2007 IP