What's new

Included lighttpd full featured?

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Nerre

Senior Member
I have been struggling to get php-thttpd running for a small web page I have with my web bookmarks (to have them accessible from anywhere). But there seem to be some problem with POST and PHP.

The web page uses a simple form with a text field with the source for the web page, and the POST just overwrites the old html file. Has worked like a charm for years on my old web server that I'm going to retire.

While looking for what web server to try next I realised that there is a lighttpd included, is it crippled in some way or can it be used as a normal web server? If I understand right it is intended for Download manager and airCloid, but it seems as if it doesn't have any default config so I guess it would be easy to run it the way you want?

If that is the case the next step will be to see how easy it is to get it working with php (I though it was neat that php-thttpd had php included, but when it doesn't work for the task it isn't very useful).

Oh, right, it's a RT-AC66U.
 
Seems as if there is some hardcoded authorization in it, because even without setting up authorization i get 401 whatever I try... And when setting up authorization using my htpasswd I still get 401 without even being asked for a password. And nothing useful in the logs.

Guess I'll have to dig into the source... or try nginx instead, but from what I understand authorization support in nginx is not very flexible...
 
lighttpd uses a few proprietary modules for AiCloud, so I doubt you can add an additional site to it without running into trouble. I haven't looked in depth at the code but I suspect it also got customized by Asus.

There are quite a few alternatives on Optware. You might even be able to install a copy of Optware's lighttpd in parallel to the instance used by AiCloud, so long they don't collide on ports/lockfiles/etc...
 
Yes I know there are alternatives but since it's just a very small page with bookmarks I'm going to run it seems a bit overkill to install apache. Nginx has a bit bad support for authorization. And php-thttpd can't handle POST larger than 1013 bytes (tried it out today, 1013 bytes works, 1014 bytes "connection was reset"). I think this is a bug that makes the server fail when the POST can not fit within one packet, I found some posts about such a bug but they were old so I thought it had been fixed... But maybe the version in optware is old? Haven't looked deeper into it yet...

Maybe I should add some other repositories...? Haven't really grasped the alternatives yet, I'm kinda new to this wrt stuff, bought the router a week ago and have mostly been using Debian before.
 
The NSLU Optware repo Asuswrt uses is indeed hosting old and semi-obsolete packages. If you don't use Download Master, then it's worth reconfiguring your optware setup to use Entware instead, which is actively maintained.
 
Should I wipe out the old optware stuff and install Entware from scratch or can I just change my ipkg.conf?
 
Should I wipe out the old optware stuff and install Entware from scratch or can I just change my ipkg.conf?

I would recommend you start from scratch to avoid any conflict.
 
Ok, I'm gonna reformat the USB stick anyway because I named the partitions bad (long labels with mixed case and underscores, to hard remembering what I called them).

Entware works on TomatoUSB too, doesn't it? As long as it's a 2.6 kernel on Broadcomm?


How far into the future is your next release? I'm hoping for the new config .append feature to make customization a bit easier. Don't need to know exactly, but like if it's weeks or months?
 
Ok, I'm gonna reformat the USB stick anyway because I named the partitions bad (long labels with mixed case and underscores, to hard remembering what I called them).

Entware works on TomatoUSB too, doesn't it? As long as it's a 2.6 kernel on Broadcomm?


How far into the future is your next release? I'm hoping for the new config .append feature to make customization a bit easier. Don't need to know exactly, but like if it's weeks or months?

I expect Entware to work with any router that has a compatible CPU (meaning a MIPSel architecture). ryzhov_al would know more, he's involved in that project.

Next release is probably a dew days away, 2 weeks at the most. I got the new code merged in, I need to do some thorough tests, and possibly do a few additional changes as needed. It will also depend on my workload at work.
 
Great, then I can refrain from messing with user scripts to make additions to the config. I'm trying things out at the moment, the RT-AC66U is going to replace my old router (an old Pentium 166 MHz (I think) running M0n0wall from CD-ROM with config on floppy) when we get fiber connection, and the fiber installation will probably not be finished until the end of november so I have time to wait:)


So, to get back to topic, it seems as if the included lighttpd has some hardcoded stuff that makes it not possible to use for other things.
 
So, with the lighttpd from entware I managed to get authorization to work and it also seems to work with php-fcgi.

Now I'll just have to find out why the old php script isn't working as it should...

(I didn't write it, but it's VERY simple. The script loads a file info a text field in a form, upon submitting the form the contents of the text field is written back to the file. But the script doesn't seem to read the file, and doesn't write anything to the file. It just gets replaced with a 0 size file. So the script runs, but the reading and writing of the file doesn't work right.)
 
So, with the lighttpd from entware I managed to get authorization to work and it also seems to work with php-fcgi.

Now I'll just have to find out why the old php script isn't working as it should...

(I didn't write it, but it's VERY simple. The script loads a file info a text field in a form, upon submitting the form the contents of the text field is written back to the file. But the script doesn't seem to read the file, and doesn't write anything to the file. It just gets replaced with a 0 size file. So the script runs, but the reading and writing of the file doesn't work right.)

Could be a permission issue. Check the error log for any tips (enable debug logging if needs be).
 
If it was a permission issue I wouldn't expect the script to be able to overwrite the existing file! :)

I think it has something to do with it being written for an older version of php, I'm going to "rebuild" it bit by bit no when I know how it works. The "magic" in this bookmarks solution is not the php script (it just allows you to edit the bookmarks.html file), the "magic" is the CSS that reflows the boxes with bookmarks to use the full window width. All bookmark solutions I looked at had complex layout and wasted screen space (buttons and icons and long descriptions and who knows what), and a friend of mine wrote the CSS as an example and asked "Is this how you want it to work?". I said "Yes, but I want to edit it too." And then he wrote the php script.
 
I don't know what the problem was... when I started to hack the script up in pieces to test bit by bit everything worked... But there was a reboot between the failed attempts and the successful, so there must have been some glitch somewhere.
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top