Colin Mattoon

Subscribe to Colin Mattoon: eMailAlertsEmail Alerts
Get Colin Mattoon: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn


Related Topics: Apache Web Server Journal

Apache Web Server: Article

Finishing an installation of Debian over a network

Plus, creating a text-messaging gateway. Part 8 in our series 'How to create a Linux-based network of computers for peanuts'

(LinuxWorld) -- When we last left our heroic Debian installation, Debian Linux was hungrily grabbing essential files needed to metamorphose our crusty old Pentium 75 into a lightning quick Linux X terminal. All "free as in speech" and "free as in beer" -- and all courtesy of the volunteer Debian developers who work tirelessly to produce what some regard as the premium Linux distribution.

In Part 7 of this series, we worked our way through nine of the ten steps required to install Debian via the Internet and to configure the machine as an X terminal as part of our Linux network for peanuts. Debian's signature apt utility was performing one of the last stages of installation by retrieving essential XFree86 utilities via the Internet from Debian's server. As we sit down to the machine this morning, we are filled with expectations of a machine ready for us to complete the tenth and final step.

Debian Step 10! (Actually, Step 10A). Fixing XFree86

We strike a key to exit the screen saver and are confronted with "a problem." A problem and a humble apology on the screen the gist of which is, "...not even Debian is perfect!" Fortunately, Debian's installer comes closer to perfection than many, and the problem is quickly resolved. Sometime during the night, apt was unable to retrieve some files (in this instance, they were part of the Perl utilities) and it waited patiently for your return to apologize and ask if you want it to try again.

Absolutely! We tell it "yes" and within 3 minutes the wayward files are safely tucked away on our machine's hard drive. (See, I told you Debian is Cheap and Easy to install.)

As soon as the installation utility is satisfied that all the needed files are in place it begins to automatically install and configure the packages. It pauses and asks us to make some choices about mail handling. As this is to be an X terminal (for now) and will handle no mail (that's done by the application server, remember?), we take option No. 5 presented on the screen: No configuration. We ignore the warning that our mail system will remain broken until configured because we don't care. That's server-centric Linux computing for you. We don't have to care about most of these details.

With this out of the way, we tremble with anticipation and anxiously enter the magic command:

/usr/X11R6/bin/X -query 192.168.1.10

Sit back to watch the XDM login window of our application server (the machine you configured with an IP address of 192.168.1.10 way back in Part 3) magically appear.

Only it doesn't. Instead, in text mode, our powerhouse reports that there is no XF86Config to be found.

Well, we aren't too disappointed. We don't really expect everything to work perfectly every time, now do we? After all, Debian or not, we are dealing with a computer. Even though we accepted the installation utility's offer to pre-configure the xserver, (Part 7) something went wrong.

Not to worry. Our core XFree86 files include the most reliable method of configuring an xserver -- the xf86config utility. If we didn't already know the model of video adaptor in our machine, we could also use the SuperProbe utility to determine the model and amount of VRAM by typing it at the command line first:

SuperProbe

It's case-sensitive, so make sure the "S" and the "P" are capitalized. Write down everything SuperProbe finds so you can use it with xf86config.

xf86config works in character-cell mode, and in my experience, is the most reliable utility for creating a working XF86Config file that will permit you to run an X server. To enter the utility, just type:

xf86config

Press ENTER

The xf86config utility steps you through the choices to configure your keyboard, mouse, monitor, video adaptor, and screen resolution. The one reservation I have, and this is not Debian specific, is that when PS/2 mice are configured, the default choice of mouse port you are presented (/dev/mouse) often doesn't work. So instead, I enter /dev/psaux.

At the end of the xf86config routine we are asked if /etc/X11 is a good place for the XF86Config file and we agree.

NOW it works! We enter the command:

/usr/X11R6/bin/X -query 192.168.1.10

Presto! The XDM login window for our application server appears. Kill the X Window System by simultaneously pressing Ctrl + Alt + <-- and refer to Part 4 of our series to learn the Cheap and Easy way to configure this Debian box to automatically boot the machine as an X terminal.

Now, that wasn't so difficult, was it? Congratulations, you just installed and configured the distribution that many Linux gurus warn you is "too tough."

Debian Step 10b. Adding packages

If you have been biting your nails since you saw that I cheated and split Step 10 into an A and B section, just relax and stop worrying. I want to introduce you to the power and convenience of Debian's package management system for post installation system administration and upgrades.

apt isn't just used during the initial installation of Debian. It is the tool you use to add or remove thousands of Debian software packages, to keep your system updated to the latest release without ever re-installing Linux. apt is why you only install Debian once for the life of your machine.

As soon as you complete Step 10A above, you have a fully functional Debian GNU/Linux machine that can serve as an X terminal in the network we have been creating. It doesn't take much space on your hard drive, either, by running the following command:

df -h

You can confirm that you have used less than 100 megabytes of your / partition.

I usually add a few small packages before configuring the X terminal, however. I don't particularly like to edit files with the vi text editor. I'm addicted to less and don't like to pipe ls to more when I'm looking at large directories. Because my LAN operates behind a firewall and is a reasonably trusted environment, I use telnet for various tasks, dire warnings to use only ssh aside.

Easy Editor (ee) is a Cheap and Easy tool that I prefer over the default vi. Debian doesn't include less or telnetd (required to telnet into the X terminal from another machine). Let's look at how apt makes installing these packages trivially easy.

First, we will add Easy Editor:

apt-get install ee

apt connects to Debian's site and fetches the package in .deb format. It reports:

Reading Package Lists... Done
Building Dependency Tree... Done
The following NEW packages will be installed:
 ee 
0 packages upgraded, 1 newly installed, 0 to remove and xxx not upgrade
Need to get 42.7kB of archives. After unpacking 147kB will be used.

apt then reports that it is connecting to http://us.debian.org and provides an ongoing progress report of the download. It brags how quickly it got everything:

"Fetched 42.7kB in 45s (932B/s)"

Then it installs the downloaded package while you sit there with your mouth hanging open.

Selecting previously deselected package EE.
(Reading database ... xxxx files and directories currently installed.)
Unpacking ee (from .../ee_1%3a1.4.2-4.i386.deb) ...
Setting up ee (1.4.1-4) ...

You are returned to the command prompt without any work on your part after the initial command of apt-get install ee

If this is your first encounter with Debian, you may not believe your eyes -- so try it again:

apt-get install less

And a third time:

apt-get install telnetd

Now try removing one of these packages:

apt-get remove ee

Watch the process reverse itself. Just as quickly, re-install it with:

apt-get install ee

Now you see it, now you don't. Now it's back again. Sleight of hand? Watch closely: Which shell hides the pea?

You can read more about Debian apt in the man pages (man apt-get) of a Debian system and browse the Debian Web site for more in-depth information as well as an opportunity to look at the thousands of software packages available to you.

What's next? Enhancements!

So far, this series has dealt with the basic mechanics of creating a network of X terminals and a file/print/application server. Our time-sharing, server-centric, network for peanuts has been Cheap and Easy to setup and provides real-world benefits:

  • Extreme ease of use for ordinary users.
  • Homogenous login environment across an entire LAN of workstations.
  • Simplified, centralized, system administration.
  • Low initial hardware cost.
  • An end to the expensive hardware upgrade treadmill.
  • Low (or zero) initial operating system and software cost.
  • An end to the expensive OS and software upgrade treadmill.
  • De-facto immunity from viruses.
  • An over-all reduction in risk of data loss relative to the MS Windows 9.x environment this LAN most likely replaced.

For all of that, isn't this just another example of "Almost as good as Windows?" Aren't we simply providing the basic desktop functionality that we could have had for several thousand dollars more with Windows? Don't these supposed benefits pale in comparison to the things we gave up by not replacing our hardware and upgrading to the latest version of Windows?

Nope.

I want to speak to managers and employers now. Sure, you could buy more powerful hardware and spend a wheelbarrow full of cash for Windows 2000 server and XP. You could spend another wheelbarrow full to provide Microsoft Office. What would you have that you can't have with our network for peanuts? Hmmm?

Well, aside from the obvious cash-flow problem you will experience, and aside from the dubious benefits of getting to clean up after each new viral attack, you get to watch your productivity fall while staff wastes time searching for music on the Web, filling disks with gaming software and performing personal tasks on company time with company computers -- hogging bandwidth and begging for attack.

Think these things are "perks" that you can't live without? This is why you don't want to migrate to Linux?

Are you killing your employees with kindness? How about creating a task-oriented, focused environment that boosts productivity during normal working hours and lessens the need for unpaid over-time at home? How about helping your employees separate their work and personal lives by helping them get their jobs done at work? How about spending just a portion of the dough you would have spent on IT to shore up health care or retirement -- or even to help avoid lay-offs?

Don't think that Linux is a poor cousin to expensive proprietary operating systems on the desktop. Linux can provide productivity features that are at best, expensive and often unavailable in the Windows world.

Our focus is on Linux-server centrism, so obviously, server computers are how we provide features to the desktop users. We will take this little Pentium 75 we just set up with Debian and turn it into a server -- a specialized server that adds a valuable capability to the LAN of X terminals we have been working on since Part 1 of this series.

By the way, this little server might also be a good choice for your first production Linux deployment in many circumstances no matter what desktop OS you are running today.

Enough already! What are we going to build?

A text-messaging gateway

This will be a minimal intranet Web server that handles text communications from desktop machines to digital cell phones, PCS phones, and alphanumeric pagers. Unlike most expensive proprietary client/server solutions, our approach will be to provide the service via any Web browser, text or GUI, making it ideal for use in our network of X terminals as well as with other models of networking and other desktop operating systems. Nothing to install or upgrade on any desktop machine, ever.

Who needs it? Surprisingly enough, lots of people. Hospitals and clinics, manufacturing plants, police and fire departments, service industry operations, real estate brokerages, truck lines, drug cartels -- well, actually I don't know if drug cartels really need this capability or not -- but a lot of people do.

They need it because e-mail based text messaging is often too slow: The message, "Dr. Smith to the E.R., STAT!" is something that needs to arrive at the good doctor's pager or PCS phone quickly and not half an hour after it is sent.

They need it because many alpha-paging and digital phone service provider's Web-based gateways are notoriously unreliable. When they do work, typing errors often send the message to the wrong phone or pager.

They need it because, even today, it is not unusual to discover that the only paging service to provide coverage of a particular geographic area refuses to permit any connection to the Internet. Connect modem to modem or no text message for you, pal.

They need it because many public safety, health care, and manufacturing operations continue to run their own private-carrier radio paging systems and they want to provide alphanumeric capability to this in-house system.

How do organizations handle this today? Most either put up with slow and unreliable text message delivery or they interrupt meetings with cell phone calls. They try to get by with numeric display pagers that can't help prioritize messages or miss messages in high-noise environments by relying on voice messaging.

Some purchase dedicated text-entry stations and place them at reception desks and dispatch centers. This requires a phone call and transcription of the message by a person. Others buy proprietary client/server software solutions. However, these are expensive and require installation on every desktop. They also limit access to Windows users.

We will use Debian and free software to create a low-cost solution to these problems and to demonstrate a fundamental principal of Linux system administration. We use several, relatively small, specialized software packages in combination to build what we need. We won't write code (a Good Thing too, because I can't!), and will use what is already freely available.

Why this as a first productivity enhancement to our Network for Peanuts? I have all my hair, but I'm nearly as gap-toothed as Letterman, so here's my "Top 10" list of reasons we are going to build a Linux text messaging gateway...

  1. It is a bit out of the ordinary. Most IT people overlook this need.
  2. It is useful.
  3. I haven't found the information in one place anywhere else on the Web.
  4. It's Cheap and Easy! (I ought to trademark that!)
  5. It replaces an expensive Windows solution with a free Linux solution.
  6. The project is ideally suited to minimal hardware.
  7. It demonstrates the power of Debian's apt.
  8. It provides an office productivity app to X terminals (and all other browser equipped workstations) without installation of additional client software.
  9. The server can be deployed as part of our network of X terminals or as a stand-alone Linux server.
  10. Since the DOJ let Microsoft off the hook, I decided to retaliate with my own Internet initiative.

Before we begin, we need to have at hand the following:

  • A basic PC with a NIC and a small hard drive. I tested this for a month with a 486SX and put a P120 in as my production server last July. The 486 worked okay, but I was suspicious of the hardware.
  • A basic modem. The 486SX was equipped with an ISA 9600 bps modem, the P120 got an external Sportster 33.6 from the junk bin. 4800 bps is the maximum speed used by any of the paging or PCS phone services that I am aware of.
  • Temporary use of a monitor.
  • A keyboard (Temporary if the machine will boot without it after it is configured.)
  • An unused (preferably unlisted) phone line.

Basics of text-messaging software

I deliberately left out the links to the software packages below. It will do you some good to surf over to http://www.debian.org and browse the list of packages for the stable release! Our Cheap and Easy text-messaging gateway will serve an index of pager and PCS/digital cell phone users as static html to our desktop users. We can use either Apache or Boa as the web server.

Each entry in this index is a hyperlink to a cgi-bin e-mail form created the Cheap and Easy way with (what else?) a cool little application called Cgi-email. Our users don't have to type any address to send their message. They simply type the message and click on a button labeled SEND.

Cgi-email hands the message to sendmail, which is configured for local delivery only. sendmail places a copy of each message in the mail spool (a Cheap and Easy log of messages) and hands another copy to the paging program.

QuickPage is the paging software application. Its configuration file contains a list of available paging and PCS/digital phone provider's TAP/IXO modem phone numbers and users. Upon arrival of a text message from sendmail, QuickPage dials the appropriate carrier for that user, establishes a connection, and hands off the message to the paging or phone carrier's switch.

A piece of cake, not a POS. 100 percent of the necessary packages are available via apt from Debian's site and the configuration details are trivially easy. Join us in Part 9 as we tear into the nuts and bolts of configuring our Cheap and Easy text-messaging gateway for our Linux Network for Peanuts.

More Stories By Colin Mattoon

When not buried under his real job in commercial two-way radio system design and sales, Colin Mattoon is a part-time Linux system administrator at Northwest Communications in Lewiston, ID.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.