How to use Coyote Linux 2.x as a Web Server

Overview

The standard distribution of CL2.x includes a minimal installation of thttpd, the free Tiny/Turbo/Throttling HTTP Daemon. This small-footprint web server is used to power Coyote's WebAdmin interface. Although thttpd is small and fast, the default hardware requirements of Coyote do not allow it to perform as well as a web server running on a "real" computer with lots of RAM and storage space. Logging is impractical, and advanced server-side scripting languages are unavailable. If you have another machine on your LAN which you could use instead, do so. The Coyote/thttpd combination is best suited for providing the users on your LAN with a shared "home" page, hosted on a machine that will always be on, or similar low-impact uses.

What do you need ?

How to configure:

There are two approaches you can take: 1) Use the already-active instance of thttpd that runs the WebAdmin interface (uses fewer system resources, fewer modifications), or 2) Run a separate instance of thttpd just for this use (allows simpler URLs to access the pages, keeps WebAdmin and your site separate).

Method 1:

  1. Boot the machine into Coyote, login as root, and Quit from the menu .
  2. Add your new web page(s) to /var/http/htdocs. There is already an index.htm file there for WedAdmin, so you need to use a different name, such as info.htm. You can code this file from scratch using Coyote's built-in editor (edit /var/http/htdocs/info.htm), or use the optional FTP client to retrieve HTML documents from another machine (in ASCII mode).
  3. Ensure that these pages are not flagged as "executable" by typing chmod ugo-x /var/http/htdocs/*.htm*.
  4. Type menu to return to the console menu, and select W to write your changes to the boot diskette.
  5. Use the URL http://192.168.0.1:8180/info.html to access this page. (Substitute the internal IP address of your Coyote machine if it's different, or an internally-resolved host name if your LAN configuration has one for your Coyote box.)

Method 2:

  1. Boot the machine into Coyote, login as root, and Quit from the menu.
  2. Create a new "document root" directory for this instance ot thttpd, preferably in the /var/http directory, where it will be backed up (to webadmin.tgz) when you perform a write-to-floppy command. mkdir /var/http/info/
  3. Add your new web page(s) to this directory. The main page should be called index.htm. You can code this file from scratch using Coyote's built-in editor (edit /var/http/info/index.htm), or use the optional FTP client to retrieve HTML documents from another machine (in ASCII mode).
  4. Ensure that these pages are not flagged as "executable" by typing chmod ugo-x /var/http/info/*.htm*.
  5. Type: edit /etc/rc.d/rc.local [Enter]
  6. Add this command to the file: /usr/sbin/thttpd -u root -d /var/http/info -h 192.168.0.1 -p 80 (Substitute the internal IP address of your Coyote machine, if it's different.)
  7. Save the file Ctrl-S and close the editor Ctrl-Q.
  8. Type menu to return to the console menu, select W to write your changes to the boot diskette, then Reboot.
  9. Use the URL http://192.168.0.1 to access this page. (Substitute the internal IP address of your Coyote machine if it's different, or an internally-resolved host name if your LAN configuration has one for your Coyote box.)
If this doesn't quite meet your needs, see the thttpd documentation and man page for more information about its options. Thttpd can use a configuration file, but for simple situations like this it's easier to specify the needed parameters on the command line.

Although thttpd is very secure, I don't recommend using your Coyote router/firewall as an internet-accessible web server, because this would introduce a new vector through which the router itself could be compromised. Coyote doesn't offer script-kiddies the same opportunities for mischief that a full distro does, and it's easy to restore to its uncracked state (assuming you write-protect the boot disk), but it also lacks any intrusion detection capabilities to warn you if it's been compromised. If you do chose to use it for this purpose, I would suggest not enabling CGI in the exposed instance of the server, to keep the security risk at a minimum. (Using the WebAdmin interface from an external location is a majorly bad idea, because it would involve transmitting your public address and root password across the internet in clear text.) To make external access work, you would need to modify the iptables commands in Coyote's rc.firewall script to accept (rather than reject or forward) requests for port 80. I can't provide specific instructions for how to do that, because I use my Coyote box to pass these requests on to my real web server, and figuring out and testing any such changes would interrupt my operations. If you want to shoot yourself in the foot you'll have to figure out how to do that yourself. {smile}

Credits, Licenses, Sources and Documentation

Coyote Linux - Vortech Consulting - http://www.coyotelinux.com
Coyote Linux FAQ - http://rzero.com/coyote/faq.html
thttpd - Acme Labs Software - http://www.acme.com/software/thttpd/

Written by Todd VerBeek.