Apache mod_actions

Discussion in 'Server Operation' started by dualxeon, Feb 17, 2008.

  1. dualxeon

    dualxeon New Member

    I have tried to setup apache with mod_actions so that when a page is requested e.g test.pl my cgi script is run and the results are returned to who ever requested the page.

    In my virtual host i have added the following settings:

    Action perlfiles /home/admin/test.cgi
    AddHandler perlfiles .pl
    the cgi contains the following:

    echo "HELLO THIS WORKS :)";
    I then made a file test.pl and when i go to that file in my browser i get very weirdly a 404 error:confused:

    Not Found
    The requested URL /home/admin/test.cgi /test.pl was not found on this server.
    If i remove this Action perlfiles /home/admin/test.cgi from the configuration then i do not get the 404 error, but my script does not run.

    Any ideas how i could fix this problem?
    I would really appreicate any help,
  2. Leszek

    Leszek New Member

    I don't know why the 404 but shouldn't the cgi script contain
    #!/bin/perl ?
    How about file permissions ?
  3. dualxeon

    dualxeon New Member

    The file is owned by the apache user and has execute permissions for all users

    shouldn't the cgi script contain
    #!/bin/perl ?
    i dont actually want to run the perl script at the moment, i just want all perl scripts to output HELLO THIS WORKS for now
  4. falko

    falko Super Moderator ISPConfig Developer

    Any errors in Apache's error log?
  5. dualxeon

    dualxeon New Member

    I just checked it, and when i request the page i get the following error:

    [Mon Feb 18 15:49:27 2008] [error] [client] script '/home/admin/sharedip/home' not found or unable to stat
    the errors are very weird:confused:
  6. falko

    falko Super Moderator ISPConfig Developer

    Can you post your vhost configuration?
  7. dualxeon

    dualxeon New Member

    <VirtualHost *:80>
    ServerName localhost
    DocumentRoot /home/admin/sharedip
    Options -Indexes IncludesNoExec
    php_admin_value open_basedir /home/admin/sharedip
    <Directory /home/admin/sharedip>
    allow from all
    # Perl Interpretter Settings
    Action perlfiles "/home/admin/test.cgi "
    AddHandler perlfiles .pl
  8. dualxeon

    dualxeon New Member

    Dont worry any more, problem solved, thanks for all your help
  9. falko

    falko Super Moderator ISPConfig Developer

    What was the problem?
  10. dualxeon

    dualxeon New Member

    You have to set up a script alias first

Share This Page