lighttpd always shows 403 Forbidden
I've installed
lighttpd and termux-services.
I've got a basic HTML page at /data/data/com.termux/files/usr/var/www/index.html and have set server.document-root = "/data/data/com.termux/files/usr/var/www/" and server.port = 8080 in the lighttpd.conf
When I browse to http://localhost:8080 on the phone, or the phone's IP:8080 on LAN I get "403 Forbidden". That definitely comes from the lighttpd process, as when I sv stop lighttpd then I don't get any response.
The files have permissions 644 and all directories back to /data/data/ have permissions 755 with the same username that is running Termux.
I've tried using a directory on /storage/emulated/0/www and a directory off home, with the same result.
I'm using the Termux packages from F-Droid on an unmodified Google Pixel (so nothing like LineageOS or root or any additions to bypass SafetyNet or whatever, just the phone as Google made it).
Any ideas what the permission problem could be, or how to allow lighttpd to serve a basic static page?12 Replies
maybe try changing the port to something higher?
Good idea. Unfortunately the same thing happens on port 58080
It feels like lighttpd has no permission to read the files, but I don't know how to troubleshoot that without root, which I don't have
same here, but when i try using
lighttpd -D -f myconfig.conf it show an unknown error instead.if you're getting an http response at all, your problem is not your choice of port
you've successfully made a connection to a server that is actually listening on whichever port
ookay
and now i just got those error even without -D
yeah, that's a problem with your choice of port
ooh ok
lemme change it
Running in foreground with
lighttpd -D -f /data/data/com.termux/files/usr/etc/lighttpd/lighttpd.conf doesn't give any extra output for meSolution
seems like you need to also put /index.html to the address on your browser
so it'll be localhost:8080/index.html
omg you are right
thank you
I also just found nginx works
Much appreciated, this was driving me nuts!
Can also make that expected behaviour in lighttpd like:
Whew, what a trek