Project

General

Profile

lighttpd treats .cgi as static files when using single parameter

Added by sebas_led over 3 years ago

Hi:

I'm migrating a project from (Hardkernel Odroid C2):
Ubuntu 18.04.4 LTS (GNU/Linux 3.16.81-49 aarch64), lighttpd: 1.4.45-1ubuntu3.18.04

To (Hardkernel Odroid C4):
Ubuntu 20.04.1 LTS (GNU/Linux 4.9.236-39 aarch64), lighttpd: 1.4.55-1ubuntu1.

and I've noticed that the execution of cgi commands with single parameter fails and return the cgi's binary instead of executing the application and returning the output of the application.
For example, this worked in the previous system:
http://192.168.0.172/cgi-bin/getsysinfo.cgi?hardInfo
(I get the json as reply)
but in the new system instead download the getsysinfo.cgi file.

1 - I'm not sure if atomice/single parameters (without assigning a value) are valid. They worked in previous system

2 - These workaround works
http://192.168.0.172/cgi-bin/getsysinfo.cgi?hardInfox%x%
http://192.168.0.172/cgi-bin/getsysinfo.cgi?hardInfo=
http://192.168.0.172/cgi-bin/getsysinfo.cgi?hardInfo=xxxx
http://192.168.0.172/cgi-bin/getsysinfo.cgi?hardInfo&hardInfo

Thanks in advance,
Sebas


Replies (1)

RE: lighttpd treats .cgi as static files when using single parameter - Added by gstrauss over 3 years ago

Your configuration is likely broken.
Please read https://redmine.lighttpd.net/boards/2/topics/5
The look at the documentation for mod_cgi
And config options You almost certainly are missing static-file.exclude-extensions = (".cgi")

    (1-1/1)