run cgi script after .jpg request

Discussion in 'Apache' started by geebers, Jan 8, 2010.

  1. #1
    Having trouble. I need my script "myscript.cgi" to run when a request for a .jpg file is requested. After a default install of xampp for linux, configured, tested, I edited httpd.conf and added these lines...

    
    <Directory /opt/lampp/htdocs/project>
    AllowOverride All
    </Directory>
    
    Code (markup):
    This allows a .htaccess file to override all default configurations for a given directory. Then I restarted xampp.

    Then in file /opt/lampp/htdocs/project/.htaccess i added these lines...
    
    Options ExecCGI
    Action image/jpg myscript.cgi
    
    Code (markup):
    This *should* run myscript.cgi when a request for a jpeg file is requested. Bit it doesn't seem to work.

    myscript.cgi looks like....
    
    #!/bin/sh
    echo "Success" > success.txt
    
    Code (markup):
    Very simple. But myscript.cgi will not write file "success.txt".
    All permissions are in order as well. Any help or suggestions would be appreciated. Thanks!
     
    geebers, Jan 8, 2010 IP