cgi-bin files aren't found.

  • I just added a test script for perl. Perl is enabled on the domain.


    Apache conf file


    Alias /cgi-bin /var/www/virtual/mysite.com/cgi-bin


    <Directory /var/www/virtual/mysite.com/cgi-bin>
    DirectoryIndex index.cgi index.pl
    AllowOverride AuthConfig Indexes Limit Options=Indexes
    AddHandler cgi-script .cgi .pl
    Options +ExecCGI
    </Directory>


    # ls -l
    total 4
    -rwxr-xr-x 1 root root 37 Nov 7 10:41 test.pl


    # perl test.pl
    Hi there!

    • What is the URI that you called exactly?
    • What is the content of your script exactly?

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • http://brtechsupport.com/cgi-bin/test.pl


    Perl
    1. # cat test.pl
    2. #!/usr/bin/perl
    3. print "Hi there!\n";


    [Mon Nov 07 12:21:08.413590 2016] [cgid:error] [pid 20138:tid 140218267072256] [client 73.189.236.9:58166] AH01264: script not found or unable to stat: /var/www/virtual/brtechsupport.com/cgi-bin/test.pl



    I also have an old program I use called DBman by Gossamer Threads. That gives the sae problems.

  • I put the file in mysite.com/cgi-bin, not htdocs/cgi-bin and now i get


    [Mon Nov 07 14:53:07.823575 2016] [cgid:error] [pid 20138:tid 140218107610880] [client 73.189.236.9:60446] End of script output before headers: test.pl

  • [Mon Nov 07 14:53:07.823575 2016] [cgid:error] [pid 20138:tid 140218107610880] [client 73.189.236.9:60446] End of script output before headers: test.pl

    That is because you perl script is wrong ;) You cannot print in such way in perl CGI. The header is missing. See here: http://users.cs.cf.ac.uk/Dave.Marshall/PERL/node196.html

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206