Debian Linux WebCam Server Configuration

The material on this page was prepared using Sarge or Etch
configured using our Installation and Packages pages.
If you did not use our pages to set up your system, what you
encounter on your system may be different than what is given here.


First and foremost, be prepared to have some patience when trying to get a USB cam to work under Linux. In trying to get mine to work, I searched many a newsgroup thread only to find there was only one message in the thread, the original question stating the problem. i.e. no one had an answer for the person who posted the question so you may be on your own trying to get your cam to work. Often times the same camera model will use different drivers for different sub-models (ex: not all QuickCam Express sub-models use the same driver). However, my trials and tribulations were a good learning experience and I'll share what I learned here to hopefully make your setup easier.

Investing the time necessary to get a cam to work may be worth it. If you set up a Linux firewall/NAT server to share your home broadband connection (we show you how on the Networking and Firewall pages), you can hook up a cam to it and keep an eye on your home from a work or vacation spot via the Internet using a Web browser. (You don't need a broadband connection in order to set up a Web cam server to play around with though). A co-worker used one to set up a "baby-cam" so he could see his new bundle of joy from the office. For businesses and organizations that wish to publish cam images on their Web site, using Linux and $20 for a cam off of eBay is an attractive alternative to spending $300 on a commercial cam unit. Modifying the firewall/NAT diagram from the Networking page, we'd have the following:

With a multiple cam setup, you'd have to specify a different file name for the image files coming from the different servers (which we cover in the configuration instructions below). You would then simply modify the sample HTML code given below for the webcam.htm page to include the different image files from all of the cams so they're all viewable on a single Web page.

Remember also that Debian doesn't need much in the way of horsepower so while the above may look like quite a hardware investment, you can use old Pentium or Pentium-II systems, even notebooks if you're feeling adventurous, provided they support your cam's connectivity requirements, i.e. USB or parallel ports. (If you considering picking up some old notebooks to use for cam systems, see the Resources page for a link to linux-laptop.net where you can see if there are any articles for installing Woody on the specific make/model of notebook you're considering buying.) While old Pentium systems may not have USB ports, you can still use the old parallel port style cams with them. Keep in mind that in the multi-cam configuration shown above, the systems with the cams attached are not acting as servers. They're simply capturing cam images and acting as FTP clients when they send the images to the firewall/Web server (and the FTP client software gets installed by default).

Because the cam software uses FTP to transfer the images when the cam is on a separate system from the Web server, you'll want to provide some FTP security on the firewall/Web server by putting some good IPTABLES rules in place (as covered on the Firewall page) or use the /etc/hosts.allow and /etc/hosts.deny files associated with tcp wrappers which is enabled for FTP by default. (We cover tcp wrappers on the Internet Servers page.)

You may recall back on the Installation page at one point we went through a "module" selection routine. (The role modules play in a Linux system is covered on the Compiling Software page.) What we were doing was chosing which modules we wanted to make available for the kernel when and if they were needed. However, this module selection can be done at any time. This leads me to a second very important point; when you make changes to the USB modules REBOOT THE SYSTEM. (I probably wasted a lot of time because I had to find this out on my own.)

We're going to set up a Web cam server using the popular IBM USB "PC Camera" (which is actually made by Xirlink) because Woody has a driver for it (and because I found a guy selling used ones on eBay for 12 bucks).

source : http://www.aboutdebian.com/webcam.htm