I can access my index.cgi script which is working flawlessly at ip/cgi-bin/index.cgi
when I access only by ip without providing full path its loading only luci web ui.
I tried few hours with different combinations and still cant make it work I renamed index.html in www/ to something else, then redirected to my own index.cgi didnt work.
Went thru the guide before opening this thread. Listing permissions wont help as i said i can access the script if i will provide direct link i.e. 192.168.0.2/cgi-bin/index.cgi
If there was a problem with permissions it would just download the file instead of executing.
As per my understanding index_page should try to find index.cgi first then search for defaults. I tried changing port to 8080 and creating separate config cgi_wan and limiting main to its defaults. Didnt work out either.
plutus@plutus-inspiron3180:~$ wget --debug -O - --max-redirect=5 http://192.168.0.2
Setting --output-document (outputdocument) to -
Setting --max-redirect (maxredirect) to 5
DEBUG output created by Wget 1.21.4 on linux-gnu.
Reading HSTS entries from /home/plutus/.wget-hsts
URI encoding = ‘UTF-8’
--2024-12-14 17:48:40-- http://192.168.0.2/
Connecting to 192.168.0.2:80... connected.
Created socket 3.
Releasing 0x00005fafbaf8a560 (new refcount 0).
Deleting unused 0x00005fafbaf8a560.
---request begin---
GET / HTTP/1.1
Host: 192.168.0.2
User-Agent: Wget/1.21.4
Accept: */*
Accept-Encoding: identity
Connection: Keep-Alive
---request end---
HTTP request sent, awaiting response...
---response begin---
HTTP/1.1 200 OK
Connection: Keep-Alive
Keep-Alive: timeout=20
ETag: "e77-2a0-675e08ea"
Last-Modified: Sat, 14 Dec 2024 22:38:34 GMT
Date: Sat, 14 Dec 2024 22:48:40 GMT
Content-Type: text/html
Content-Length: 672
---response end---
200 OK
Registered socket 3 for persistent reuse.
Length: 672 [text/html]
Saving to: ‘STDOUT’
- 0%[ ] 0 --.-KB/s <!DOCTYPE html>
<html>
<head>
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<meta http-equiv="Expires" content="Thu, 01 Jan 1970 00:00:00 GMT" />
<meta http-equiv="refresh" content="0; URL=cgi-bin/index.cgi" />
<style>
body { background: white; font-family: arial, helvetica, sans-serif; }
a { color: black; }
@media (prefers-color-scheme: dark) {
body { background: black; }
a { color: white; }
}
</style>
</head>
<body>
<a href="cgi-bin/index.cgi">LuCI - Lua Configuration Interface</a>
</body>
</html>
- 100%[=================================================>] 672 --.-KB/s in 0s
2024-12-14 17:48:40 (35.5 MB/s) - written to stdout [672/672]
its seems whatever I do with redirect it just doesnt care Have no idea from where its pulling luci if there is no explicit way to get it via this html which suppose to redirect.
didnt help. I`m running snapshot release but i doubt problem is in that because whole uhttpd is working except it just doesnt want to start my script when pointed to home directory i.e. www/ with cgi-bin/index.cgi its more than happy to work. My main web server is running on thttpd without any issues serving different cgi scripts. Decide to move to router small portion of scripts and ran into this issue. I was planning to separate access from WAN to index.cgi and from lan to luci as default but didnt even get that close.
may be something is missing or has a typo in my uhttpf config ? I went thru couple times couldnt find any typo but am not sure if I am missing something there which is conflicting .
Found a problem which corrected my cgi script running issues it was the line in config:
list interpreter '.sh=/bin/bash'
Because file is .cgi line should start with .cgi not .sh.
Now second problem is i cant make 2 configs for lan users and wan users it seems uhttpd wants to work only with 1 config in config file.
config uhttpd ‘main’
list listen_http '192.168.0.1:8080'
option home '/www'
………
config uhttpd ‘other’
list listen_http '0.0.0.0:80'
option home '/www/other'
I.e. want users from wan to access and be in www/other jail and users from lan access luci when pointing to 8080 port and be in www/ jail.
I even limit access to luci via my main router where all firewall and port forwarding rules are taking place and allowed only 80 port to be forwarded and still didnt help.
Is it possible to do? As per tiny tutorial on openwrt its possible but cant make it work so far.