Embedded Web Servers

Another approach to network programming is to embedded a web server in your device. This makes it accessible, in principle, from a web browser anywhere on the Internet. This is not the place to delve into web programming but it's worth taking a look at, because BlueCat includes a demo called showcase that incorporates an Apache web server.

The BlueCat documentation says this demo should run in 8 MB of RAM. But I couldn't get it to run on my 8 MB target and various attempts to lower the memory requirement, such as loading library modules from the NFS

mount, ultimately proved unsuccessful. So I temporarily "borrowed" a 64 MB box to run this demo.

Once you have a target with sufficient memory—16 MB should suffice—boot the osloader diskette we made back in Chapter 4. Remember that BLOSH (the BlueCat Loader Shell) expects to boot a kernel image and root filesystem from /opt/BlueCat/demo/boot on the workstation. So you'll need to copy showcase.kernel and showcase.rfs from the showcase/ directory under demo/ to the boot/ directory.

Also remember that BLOSH expects to load a kernel image named shell.kernel and a root filesystem named shell.rfs. You have three choices here:

1. You can rename the files in boot/ from showcase.* to shell.*, overwriting what was previously there.

2. You can change the BLOSH environment variables on the target after osloader has booted.

3. You can edit the blosh.rc file in osloader/local/ and rebuild the root filesystem for osloader.

Showcase requires one more magic incantation. It requires more than the default ram disk space. This is handled with another command line argument to the kernel:


This is in addition to the existing "console=" argument. So the full CMD environment variable should read:

console=ttyS0 ramdisk_size=8192

If showcase boots successfully, the last console output you see before the bash prompt is:

Starting Apache server ...

This indicates that an http server has been started in the background and is waiting to accept http connection requests.

On your host, fire up the Netscape browser and open:

You should see a marketing pitch for BlueCat Linux.

Was this article helpful?

0 0

Post a comment