Apache and execute .cgi file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • blogman9
    Confirmed User
    • Dec 2005
    • 1261

    #1

    Apache and execute .cgi file

    i have apache 2.0 and I added to apache file this:

    Code:
    <Direcotry /var/www/mydomain>
    Options +ExecCgi
    AddHandler cgi-script .cgi
    </directory>
    But If i try execute cgi file then I have "Internal Server Error"

    Error.log:
    Code:
    Premature end of script headers cos.cgi, refferer: http://mydomain.com/
    No such file od directory: exec of '/var/www/mydomain/cos.cgi' failed
    Where is my mistake ?
    Adult industry news

  • s9ann0
    Confirmed User
    • Sep 2001
    • 4873

    #2
    its your script add:
    print "Content-type: text/html\n\n";

    at the top or where it starts printing output

    Comment

    • blogman9
      Confirmed User
      • Dec 2005
      • 1261

      #3
      Code:
      #!/usr/bin/perl
      
      print "Content-type: text/html\n\n";
      print "Hello, Im a CGI script and Im gonna print You some environment variables to make You belive that Im working fine smile.gif \n";
      print "<br><br>";
      
      foreach $key (keys %ENV) {
      print "$key --> $ENV{$key}<br>";
      }
      This is my cos.cgi
      Adult industry news

      Comment

      • blogman9
        Confirmed User
        • Dec 2005
        • 1261

        #4
        bump for me
        Adult industry news

        Comment

        • blogman9
          Confirmed User
          • Dec 2005
          • 1261

          #5
          bum bump
          Adult industry news

          Comment

          • blogman9
            Confirmed User
            • Dec 2005
            • 1261

            #6
            uuupppppp
            Adult industry news

            Comment

            • dziggy
              Registered User
              • Sep 2005
              • 68

              #7
              hit me on icq

              ICQ# 305827231

              Comment

              • blogman9
                Confirmed User
                • Dec 2005
                • 1261

                #8
                Ok i found error

                My cgi sample script:

                Adult industry news

                Comment

                • blogman9
                  Confirmed User
                  • Dec 2005
                  • 1261

                  #9
                  anyone ?
                  Adult industry news

                  Comment

                  Working...