0
votes

I'm under a Redhat 5.11 and try to use Smokeping (a Perl CGI) into apache.

Whatever the change I make, the source code of smokeping is displayed rather than executed :

  • I have already followed this documentation : http://httpd.apache.org/docs/2.2/fr/howto/cgi.html
  • mod_perl, mod_alias and mod_cgi seams installed (I can see perl_module (shared), alias_module (shared) and cgi_module (shared), when I run httpd -M)
  • I've made a toto.php, and it works, I can execute my page. So the other CGI should work, no ? I have placed this file in the exact same path as smokeping, in the path of my conf.d/smokeping.conf configuration (ScriptAlias /cgi-bin/ /var/www/html/smokeping/ )
  • I've made a toto.pl, but it doesn't works, the code is display rather than executed too.
  • I've added Options +ExecCGI in the Directory Field...
  • Perl 5.8.8 is already installed

Why smokeping doesn't works or why my very simple perl CGI aren't executed ? Have you an idea please ?

2
Displaying your file rather than running it means that apache is treating it as 'readable' rather than 'runnable'. I can't answer your question directly, but would suggest you double check you script aliases, and that you've done a config test (and I know it's daft, but you did restart apache right?)Sobrique
Are you trying to use a CGI script written in Perl or mod_perl? They are two different things and execute files differently. If using the first method, make sure the file is executable and follow instructions from herearco444
"I've made a toto.php, and it works, I can execute my page. So the other CGI should work, no ?" — PHP generally runs with mod_php, not CGI.Quentin
Questions about setting up a web server do not belong on StackOverflow. (They belong on serverfault.com/?)ikegami

2 Answers

0
votes

Have you set up the appropriate file association in your Apache config?

AddHandler cgi-script .cgi .pl 
0
votes

@arco444 I don't know if it was written for CGI or mod_perl, but it seams that with mod_perl it's working.

After many try, it's able to execute my code with this option (they were either .cgi nor .pl extension) :

<Directory /var/www/html/smokeping/ >
        SetHandler cgi-script
        Options ExecCGI
</Directory>