Search code examples
cgilighttpd

Executable cgi and image/javascript-files in lighty


I've add/commented out the following lines to my lighttpd.conf:

"mod_cgi"

and

cgi.assign = ( "" => "/var/www/myCgiScript" )

That works as expected... my executable mySite will be called on every request, but the problem is, that I can't open images. For instance, if I do the following:

http://localhost/myImage.png

This will call my executable cgi (mySite) - the same for js-files. Is Is there any chance to handle images as usual?

Thx in advance!


Solution

  • have a look at the documentation for cgi.assign: http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs:ModCGI#Options

    the first argument is a file extension, the second argument is the path to a CGI script to run when a file with that extension is requested. Right now, your config file is saying "for any, or no, extension, run '/var/www/myCgiScript'." You need to specify a set of file extensions for which you want the CGI script to run, and let lighty serve up all other files in the normal manner.