I broke uhttp anb LuCi stopped working

LuCi was working fine but I was trying to implement a custom cgi-bin script and created a new dir under /www/cgi-bin

then I copied the bash script to mynewdir so it looked this
/www/cgi-bin/mynewdir/script.sh

I added a new line to the httpd config file and it looked like this:

option cgi_prefix '/cgi-bin'
list cgi_prefix '/cgi-bin/mynewdir'

then I made my script.sh executable and I restarted uhttpd

to see LuCi my I had to type http://192.168.1.1

for my new script I had to type http://192.168.1.1/cgi-bin/mynewdir/script.sh

However the script wasn't getting executed and the script.sh was getting downloaded by the browser.

then when I typed http://192.168.1.1, I realized that LuCi was now getting downloaded also, I would not see the LuCi UI but the html with the LuCI - Lua Configuration Interface would download the LuCI code.

I went ahead and gave up on the whole thing and restored the uhttpd config file and rebooted the hardware.

However the problem still persists and instead of showing LuCi uhttpd is downloading the code.

Has anyone experienced this before? can you please shed light on how I can restore LuCi?

Here is my original file

config uhttpd 'main'
        list listen_http '0.0.0.0:80'
        list listen_http '[::]:80'
        list listen_https '0.0.0.0:443'
        list listen_https '[::]:443'
        option redirect_https '0'
        option home '/www'
        option rfc1918_filter '1'
        option max_requests '3'
        option max_connections '100'
        option cert '/etc/uhttpd.crt'
        option key '/etc/uhttpd.key'
        option cgi_prefix '/cgi-bin'
        list lua_prefix '/cgi-bin/luci=/usr/lib/lua/luci/sgi/uhttpd.lua'
        option script_timeout '60'
        option network_timeout '30'
        option http_keepalive '20'
        option tcp_keepalive '1'
        option ubus_prefix '/ubus'

config cert 'defaults'
        option days '730'
        option key_type 'ec'
        option bits '2048'
        option ec_curve 'P-256'
        option country 'ZZ'
        option state 'Somewhere'
        option location 'Unknown'
        option commonname 'OpenWrt'

I did a test to call LuCi directly and it worked

http://192.168.1.1/cgi-bin/luci/

and now calling http://192.168.1.1 also works! it fixed itself when I called the full path.

I also put my script.sh directly under cgi-bin along side luci and calling http://192.168.1.1/cgi-bin/script.sh works

and to my surprise, now under the folder also works but with the original uhttpd config file!

This is strange!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.