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

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

for my new script I had to type

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

then when I typed, 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 ''
        list listen_http '[::]:80'
        list listen_https ''
        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

and now calling 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 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.