Announcement

Collapse
No announcement yet.

CGI scripts not executing on server

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    CGI scripts not executing on server

    Hi there,

    I'm trying to get actinic v8 working on a redhat server, but everythings falling over when it comes to getting the CGI scripts to work.

    It looks like the scripts are being uploaded in DOS text mode - i.e, CR LF at the end of each line, and this is preventing the scripts from executing (I can get a hello world perl script to run myself, both from the command line and locally).

    Attempting to execute any of actinics scripts directly on the server , e.g
    ./ts000001.pl

    results in the output :

    : bad interpreter: No such file or directory

    And attempting to access the file via http results in an 'internal server error' page.
    The path to perl is exactly the same in my test script as the actinic scripts.

    Files created in the cgi-bin are executable with permissions set to -rwxr-xr-x

    Any suggestions?

    Cheers,

    Chris

    #2
    Hi Chris

    are your settings path to and from cg-bin in network all pukka?
    Affordable solutions for busy professionals.
    Website Maintenance | UK Web Hosting

    Comment


      #3
      im experiencing exactlly the same problem chris so ill watch this thread with great interest

      Comment


        #4
        Server is organised as:

        /var/www/cop-security-online/

        with sub-folders:

        www (web root)
        cgi-bin
        log (log files)


        Actinic user logs in to /var/www/cop-security-online/
        , and is locked to this directory.

        Actinic config dump, minus login details:

        HTTPPROXYMODE 0
        HTTPPROXYADDRESS
        HTTPPROXYPORT 80
        HTTPPROXYUSER
        HTTPPROXYPASSWORD
        FTPPROXYMODE 0
        FTPPROXYADDRESS
        FTPPROXYPORT 21
        FTPPROXYUSER
        FTPPROXYPASSWORD
        SCRIPTID 1
        SCRIPTEXT .pl
        SMTPHOST localhost
        WEBSITEURL http://www.cop-security-online.co.uk/
        IGNOREPASSIVEERRORS false
        USERELATIVECGIURLS false
        PATHTOPERL /usr/bin/perl
        USEENHANCEFTP false
        FTPCLIENTTIMEOUT 15000
        FTPRETRYDELAY 3000
        FTPSILENT false
        FTPMAXRETRIES 3
        FTPCONNECTTIMEOUT 25000
        SMTPAUTHREQUIRED false
        SMTPUSERNAME
        SMTPPASSWORD
        CATALOGURL http://www.cop-security-online.co.uk/acatalog/
        CGIBINURL http://www.cop-security-online.co.uk/cgi-bin/
        PATHFROMCGITOCATALOG ../www/acatalog/
        CODEBASE ./
        FTPHOST cop-security-online.co.uk
        FTPUSERNAME xxxx
        FTPPASSWORD xxxx
        PATHTOCGIBIN /cgi-bin/
        USEPASSIVEFTP true
        FTPPATHFROMCGITOCATALOG ../www/acatalog/
        Last edited by Bruce; 12-Feb-2007, 04:37 PM. Reason: Removed FTP Username and Password for Security reasons

        Comment


          #5
          Hi

          Try removing the www from your ftp and path to and leave it as ../acatalog (unless you were advised otherwise?)

          Have you had Actinic working previously btw?
          Affordable solutions for busy professionals.
          Website Maintenance | UK Web Hosting

          Comment


            #6
            ive got the answer, make sure that scripting is enabled on ur server first, then make sure acatalog permissons are 777 and cgi-bin is 755

            Ive just fixed mine this minute by making those changes

            Comment


              #7
              nope...

              Alas, Ive checked these settings, and it doesen't appear to be the cause of the problem.

              I have found than manually downloading the scripts in binary mode, and checking them in Notepad++ shows that they definately contain CRLF at the end of each line, and manually changing the file to unix format, and re-uploading, and setting permissions (to the same that actinic sets them to), allows me to execute the file (ts000001.pl) , with the output :

              2000011101157 Actinic Mail Test completed successfully
              server: passed
              connection: passed
              sockets: passed
              communications: passed
              authorisation: passed
              message: -

              My problem is almost cetainly an issue with files being uplloaded in DOS format, and I can't understand why this is happening... Possibly this is a server specific issue, I don't know...

              Comment


                #8
                did u read what i just put? that will solve ur problem as i am using Fasthosts Linux

                Comment


                  #9
                  Im using rackspace, not fasthosts.. CGI is enabled, I can execute my own scripts from the cgi-bin directly, the CGI bin is chmodded 755, acatalog is chmodded to 777,
                  I dont think this is the problem.... thanks anyway.

                  Comment


                    #10
                    OK for anyone else who suffers these symptoms on a DS, the problem was caused by the FTP daemon not having ASCII uploads enabled. Therefore, Actinic was attempting to upload in ASCII mode, while actually uploading its scripts in binary mode.

                    Scripts now test OK.

                    Thanks for comments!

                    --chris.

                    Comment


                      #11
                      Username and password need removing from those settings for security.

                      Comment


                        #12
                        Originally posted by chrish
                        OK for anyone else who suffers these symptoms on a DS, the problem was caused by the FTP daemon not having ASCII uploads enabled. Therefore, Actinic was attempting to upload in ASCII mode, while actually uploading its scripts in binary mode.
                        Excuse the noob question, but how do I enable ASCII uploads for the FTP daemon, please? Having a similar problem on a Fasthosts linux server, tried mikehextall's fix but that didn't solve it...
                        www.darrenturpin.co.uk
                        Freelance webguy and pro-blogger for hire

                        Comment


                          #13
                          You can only do this if you have a dedicated server (DS in the original posts) where you control all the installed software. How you do it depends on which Daemon you are running.

                          If you are on normal hosting, you would ask your host to check FTP configuration allows both binary and ASCII upload.
                          Bill
                          www.egyptianwonders.co.uk
                          Text directoryWorldwide Actinic(TM) shops
                          BC Ness Solutions Support services, custom software
                          Registered Microsoft™ Partner (ISV)
                          VoIP UK: 0131 208 0605
                          Located: Alexandria, EGYPT

                          Comment


                            #14
                            Cheers Bill, useful info. But actually, I did some more digging and seem to have solved the problem.

                            For anyone else struggling with Fasthosts linux hosting, the key things seem to be:

                            1) Make sure the CHMOD setting for the cgi-bin is 755

                            2) Make sure the CHMOD setting for the acatalog directory is 777

                            3) If you still have problems, use your reseller control panel (or ask your reseller to do it for you) to disable scripting on the domain, then wait a couple of minutes and re-enable it again.

                            This seemed to fix the previous 'scripts not installed properly' issue that I was suffering from.
                            www.darrenturpin.co.uk
                            Freelance webguy and pro-blogger for hire

                            Comment

                            Working...
                            X