1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Tomato acts as a web server?

Discussion in 'Tomato Firmware' started by tamato, Mar 2, 2009.

  1. tamato

    tamato Addicted to LI Member

    I've been using Tomato 1.19 for long time and everything is just fine. Recently I ordered a NAS device to which USB hard drive or flash memory can be plugged.

    Just wonder how to setup the router with Tomato as the web server, using the NAS drive as the web root directory? It's mainly for personal use so even a strip down web server is good enough, just avoid keeping a PC on all the time.

    I know there is a way to set it up in DD-WRT, anyone knows how to do it in Tomato? Thanks in advance.
  2. Low-WRT

    Low-WRT LI Guru Member

  3. humba

    humba Network Guru Member

    I suspect httpd was compiled in a minmal version since the -h parameter is conspicuously absent. I also didn't manage to locate a httpd.conf (which might have given us another option at getting a second website that points to another path).
  4. fyellin

    fyellin LI Guru Member

    The httpd daemon is essentially hardwired into the Tomato code. It's extremely limited in its functionality--it pretty much can do precisely the functionality needed by Tomato, and not much more.

    The CGI is hard-wired in. The user names are hard-wired in. The paths are hard-wired in. And I frankly don't think it's been battle tested enough that I'd trust it against hostile hackers. Paranoid users like me don't allow http access to the router from outside the LAN.
  5. davipiero

    davipiero Addicted to LI Member

    What about a mini webpage where a client can type their username and password there first to use the internet?
  6. fyellin

    fyellin LI Guru Member

    You probably want to search this site for "captive portal." I haven't heard of anything for Tomato.
  7. tamato

    tamato Addicted to LI Member

    Thanks for all replies. Looks like the httpd in Tomato is tailed so much that it can't be used for anything else.

    Then my question is, is there any stand alone httpd or similiar app that I can use in this case? Such as, compiling the DD-WRT version httpd and install it?
  8. redcow

    redcow LI Guru Member

    You may try out lighttpd.
  9. fyellin

    fyellin LI Guru Member

    Is there a particular reason you want this setup? httpd is the hacker's main entry into your LAN, and I wouldn't trust anything that hasn't been thoroughly tested and vetted.

    You could save yourself an awful lot of hassle by running apache on a cheapo headless linux box. My home web server runs on a now-way-out-of-date Mac Mini running the latest version of apache. It's wired to the router. Inexpensive, and setting it up was trivial.
  10. humba

    humba Network Guru Member

    Or if you have a NAS they often come with Apache.. or a Linksys Slug (NSLU2).. which can be linux'ed and then you can install linux packages. Or another embedded Linux box like the pcengines alix.. small, don't use a lot of power, can be fed via PoE and they don't make any noise - the only drawback is a separate box, but then again you can run so much else on that box, too.

    dd-wrt runs on linux 2.6.x if I'm not mistaken, tomato is still 2.4.x so you have a lot of dependency mismatches. Your best shot would be to take the tomato sourcecode and recompile httpd with the options you need.
  11. tamato

    tamato Addicted to LI Member

    Well, I ordered this device, haven't received it yet


    Looks like a linux based toy, comes with BT client and ftp server, and web configuration....But probably its mod doesn't exist due to its small user base.
  12. tamato

    tamato Addicted to LI Member

    Ok, after some search, I found this one, in the openwrt archive:


    It's a thttpd web server. I renamed the file to .tar.gz and extracted the binary from it manually, and copied it to tomato /jffs directory (you can't use ipkg probably).

    Seems that I can run this executable manually, since if I gave a wrong option, it told me in the display message. But using "ps" command, I can't find it, trying to reach the test web page got nothing. The daemon can't start on Tomato.

    Is there anything wrong here? Missing a library in Tomato, or wrong kernel?
  13. rhester72

    rhester72 Network Guru Member

    It is trying to bind to port 80, where httpd is already listening. You'll need to have thttpd listen on a different port.

  14. tamato

    tamato Addicted to LI Member

    No, my option setting is like this:

    /jffs/sbin/thttpd -p 81 -u root -dd /tmp -l /tmp/log.txt

    Seems it started and quit, nothing in log file even.

    I didn't set the iptable though, just want to see if the server is running.
  15. tamato

    tamato Addicted to LI Member

    I turned the debug flag on and got this error message:

    *** Unresolved: sigset
    Segmentation fault

    Looks like missing some libraries in Tomato, anybody knows where this sigset is from?
  16. Gewehr98

    Gewehr98 LI Guru Member

    I'd like to know more about this, too.

    I've got 4 each Quantum Snap Servers on the home network, sharing MP3s, Adobe PDF, MS Word/Excel documents, and other files via the Linksys WRT-54G v1.0 and Tomato v1.19.

    I'd like to be able to tunnel in from my web connection at work, and pull files from the Snap Servers via the http or ftp services that those NAS devices offer. I don't really want to open a DMZ port to them, even though they are password protected on the SnapServer end.

    Do I need to go the Dynamic DNS route?
  17. mikester

    mikester Network Guru Member

    I'd suggest taking a closer look at your NAS - mine runs Debian allowing you to install apt packages like PHP, SQL, etc... you can do far more with the NAS than you can with the Tomato.
  18. Gewehr98

    Gewehr98 LI Guru Member

    No can do.

    SnapOS is proprietary, and the Snap Server hardware just won't accommodate anything else, unfortunately.

    Bummer. :frown:
  19. baldrickturnip

    baldrickturnip LI Guru Member

    tomato with the openVPN GUI is all I use - VPN to the router and have access to everything on my home network.
  20. gte024h

    gte024h Networkin' Nut Member

    I posted this in the wrong thread earlier, sorry.

    I have a linux box running 24/7 just to serve up a few simple webpages and files. It bugs me the amount of power that I waste. It would be great to be able to host a simple website and/or files straight from a thumb drive plugged into my Asus RT-N16.

    Anyone tried it or have any ideas on how to do it?
  21. rhester72

    rhester72 Network Guru Member

    It can certainly be done by either a) leveraging the existing HTTP server and using port forwarding, if they are _truly_ simple or b) running something like lighttpd on a dummy IP and port forwarding. There's no step-by-step cookbook for this but it's really no different than you'd do on any Linux-based machine.


Share This Page