Troubleshooting Professional Magazine
Volume 2, Issue 10, November 1998
Linux Issue
|
Copyright (C) 1998 by Steve Litt. All rights reserved.
Materials from guest authors copyrighted by them and licensed for perpetual
use to Troubleshooting Professional Magazine. All rights reserved to the
copyright holder, except for items specifically marked otherwise (certain
free software sourcecode, GNU/GPL, etc). All naterial herein provided
"As-Is". User assumes all risk and responsibility for any outcome.
[ Troubleshooters.Com
| Linux Library | Back
Issues ]
Contents
|
Part 1: About Linux
Regular Features
|
Part 2: Linux Tutorial
|
Part 1: About Linux
Editors Desk
By Steve Litt
The Troubleshooting Crisis is more than lack of Troubleshooting Process.
A big contributor is non-modular systems, with a popular operating system
leading the way. Can we constantly change our Troubleshooting to keep pace
with ever more complex, non-modular and obfuscated systems? Do we want
to?
Enter Linux, a well built, well documented, modular operating system
which can remain "up" for weeks. It may not be the best choice for word
processing (or maybe it is -- read on), but many see it as an "ISP in a
box", a "network in a box", an "engineering workstation in a box", or possibly
the most intriguing, a "supercomputer in a box".
And it's getting more corporationally correct. Recently DBMS Superpower
Sybase made their Adaptive Server Enterprise technology available on the
Linux platform. Guest author Michael Peppler has created a Perl interface
to Sybase, and writes about it in this magazine. Oracle Corporation, another
heavyweight in the DBMS industry, recently announced it would be creating
a Linux compatible Oracle.
In increasing numbers, businesses large and small are installing Linux
based webservers, networks, and supercomputers. Some do it because they
feel Linux is the best, some do it to avoid the high costs of the other
brand, and some do it to hedge their bets.
Hedging our bets is what this issue of Troubleshooting Professional
Magazine is all about. It's possible that Microsoft based operating systems
will prevail throughout our careers. But I wouldn't want to bet against
Linux. It's modular, repairable, reasonably priced, and robust. A corporation,
business, or department can use it to install a webserver or supercomputer
with petty cash. And Linux has many dedicated and vocal friends in it for
more than just the money.
If you're a Troubleshooter who wants to hedge your bets by learning
more about Linux, this issue of Troubleshooting Professional Magazine is
for you. After a series of guest authors discuss the benefits of Linux,
we'll use Red Hat Linux as an example, and walk you through stages of increasing
familiarity with the operating system, up to and including using it as
a webserver. If Microsoft rules forever, you've lost a little time and
a few bucks, but gained a new insight into Networking and TCP/IP. On the
other hand, if Linux prevails, you can ride the Linux wave for all it's
worth.
So kick back and relax as you read this issue. And remember, if you're
a Troubleshooter, this is your magazine. Enjoy!
Special Thanks To...
It takes a lot of help to get out a huge magazine like this. Thanks very
much to our guest authors, Richard Manly (rmanly@applix.com),
Marc-Henri Poget (mpoget@hospvd.ch)
and Michael Peppler mpeppler@mbay.net.
And then there are those whose shoulders I stood on. Jeff Moe's (jeff@verinet.com)
DNS website gave me the info I needed to set up DNS. Jeff also graciously
answered many of my "newbie" questions. Alligator Descartes (descarte@arcana.co.uk)
definitive DBI::DBD website proved to be the only source I could find (and
the only source I needed) on DBI::DBD, online or on paper. Note that Alligator's
book on the subject will be in bookstores shortly.
Thanks to Red Hat for the nice, clean installation, and for their friendly,
helpful intallation tech support team (thanks Eric), and for the help of
their media liason, Melissa.
Thanks also to Chris Hudson for providing hardware help at the start
of the project.
Vote for Your Favorite Troubleshooting Professional
By Steve Litt
Please vote for your favorite Troubleshooting Professional issue (by year
and month) and/or article (by year, month and title). Submit your entry
to Steve Litt's email address.
The results will be announced in our second anniversery issue, which comes
out in January.
A Change We Can All Welcome
By Steve Litt
Microsoft once ruled the world. Then the tough times came.
They fixed the Netscape problem by rallying the troops to produce a
competing browser. They swept the Department of Justice under the rug.
They sorta kinda kept the Java problem at bay. But what's Microsoft going
to do about Linux?
Once you've completed the Tutorial part of this Troubleshooting Professional,
YOU will have quickly created the kind of powerful and robust intranet
web server once thought to be the exclusive domain of Windows NT. And if
you want to use Linux and still retain your corporational correctness,
guest author Michael Peppler tells you how to interface with (free on Linux)
Sybase, from Perl, using the free DBD::Sybase or sybperl interfaces he
created.
But the enterprise is a relatively new Microsoft conquest. Microsoft's
origin, home turf and economic reservoir is the desktop of John Q. Public.
Now even that is being invaded by Linux.
In the next article, Richard Manly describes the Applixware for Linux
suite. It sports a quality GUI word processor, spreadsheet, HTML authoring
program, graphics program, database front end, email, a programming API,
and, for those of you tired of VBA, it has a highly touted scripting language
called ELF. $99. So you won't need to give up your desktop convenience
to take advantage of the power of Linux.
Microsoft finally has a tiny bit of competition. A change we can all
welcome!
Applixware for Linux
By Richard Manly. Published with permission of the author.
One of the factors that is holding back users from a wholesale migration
from their Microsoft operating environments is the perceived lack of personal
productivity tools. Applix Inc. of Westborough, MA offer Applixware
for Linux (http://linux.applixware.com). The suite of applications
includes Words, a graphical compound document wordprocessor, Graphics,
a vector and pixel drawing tool with clip art, Spreadsheets, a graphical
spreadsheet with a very rich set of both built-in and add-in functions
that can be expanded using C or C++ remote procedure calls or shared libraries,
Presents a fully featured presentation tool which can incorporate objects
from all of the other Applixware applications or third party data, Data,
a graphical point and click database browsing and updating tool that interfaces
with any RDBMS that has an ODBC driver and can save it's results for inclusion
into the other Applixware applications, HTML Author, a module that allows
users to easily publish their Applixware documents and Mail, a graphical
email inbox and sending tool that allows users to "profile" recipients
and automatically export Applixware documents into their preferred format,
Mail is tightly integrated into the Applixware applications and allows
users to send any Applixware document as an attachment directly from the
applications toolbar.
Applixware is the world's number 1 UNIX productivity suite and Applix
are almost unique in that the applications were designed and programmed
for the UNIX operating system. This means that users buying the product
for Linux can take full advantage of the capabilities of the underlying
operating environment.
Applix like to position their suite as personal productivity with a
technical twist. Underneath the covers of the suite lies an extremely
powerful scripting language called ELF. This allows the user to customize
and extend the capabilities of the Applixware package using an easy scripting
language similar to BASIC and C. A fully integrated development environment
called Builder takes ELF one step further and provides a visual, object-oriented
programming tool that incorporates pre-built classes for each of the Applixware
applications. ELF and Builder can be used to gather (and update)
information from many different data sources including remote procedure
calls, shared libraries, sockets and pipes, ASCII files, RDBMS and http.
This provides the power user with a capability to turn their personal productivity
tool into a powerhouse for gathering and publishing data. Almost
every capability of the package has an associated ELF function or object
method!
That is not to say that Applixware is aimed purely at the technical
user. A familiar graphical user interface allows people that are
savvy with Microsoft's Office applications to work in a similar manner.
Recognizing that a peaceful co-habitation with co-workers and friends that
continue to use the Microsoft application is a cornerstone of Applix' latest
release (Applixware for Linux 4.4.1). Applix have concentrated on
the production of import and export filters for Office 97 documents, Word,
Excel and Powerpoint and a new filter framework with plug-in, field upgradable
filters has been provided.
Applixware is competitively priced too, the full suite of applications
including ELF and Builder is offered for $99. Applix customers can
also take advantage of optional support packages for both the applications
and development tool, fuller details can be gathered from the Applixware
for Linux website (http://linux.applixware.com).
Richard Manly is the Director, Product Management, Applixware & Anyware,
Applix Inc. He can be reached at rmanly@applix.com.
Sybase: You Asked For It, You Got It!
By Michael Peppler. Published with permission of the author.
In this issue of Troubleshooting Professional Magazine, Steve Litt has
explained how to interface CGI to PostgreSQL. For many applications, that
could meet your needs. But if you need the power or familiarity of a Sybase
database (which, by the way, is now available for free on linux - see http://www.sybase.com/adaptiveserver/linux
for details), you can use either the sybperl or the DBI/DBD::Sybase
modules. The modules are available from http://www.mbay.net/~mpeppler,
or from http://www.perl.com/CPAN/authors/Michael_Peppler.
To get sybperl and/or DBD::Sybase to work you need Sybase's OpenClient
package - again this is available for free on linux, and for other
platforms you need to contact Sybase for availability and price.
Installing either of the modules is usually a case of unpacking the
tar file, editing the CONFIG file (mainly to set the location of the Sybase
installation, and to specify which additional libraries are needed on your
platform), editing PWD to specify the username, password and server that
the test scripts should use, typing perl
Makefile.PL, make and make test.
There is one specific compatibility problem between Berkeley DB (-ldb)
and Sybase's DBlibrary which shows up if you use sybperl's Sybase::DBlib
module. Both Berkeley DB and DBlibrary define a function called dbopen().
As perl is linked with -ldb by default if the library is present (which
is usually the case on linux, and also on DEC Unix 4.0C and later) the
Sybase::DBlib module fails to work, unless you rebuild perl and specifically
exclude -ldb from the libraries that are linked with the perl binary. You
can check which libraries are linked in with perl by running "perl -V:libs".
Documentation on using these modules is included in the distributions,
but you should also check my web page (http://www.mbay.net/~mpeppler) and
you should definitely become at least somewhat familiar with Sybase's OpenClient
API - the documentation is available on the web at http://sybooks.sybase.com:80/dynaweb/group3/@Generic__CollectionView.
Check out the Open Client/Server 11.1.x and Open Client 11.1.x Platforms
links (the latter describes platform specific issues such as additional
system libraries that are needed for linking.)
Michael Peppler is the author of the sybperl and DBD::Sybase Perl interfaces
to Sybase. He can be reached at mpeppler@mbay.net.
Generating Web Decision
Graphs using Perl
By Marc-Henri Poget. Published with permission of the author.
The Web is a good way to provide troubleshooting support information. Hyperlinks
can be used to build decision graphs that help the user to narrow the problem
down to its root cause and propose some repairing actions (Universal Troubleshooting
Process, steps 6 and 7). A Web decision graph is composed of HTML
pages, each containing a question. Answers to the questions are links to
other HTML pages containing either other questions or solutions to the
problem. The figure below show the structure of a decision graph for troubleshooting
an Internet faxing system. If one tries to maintain such HTML pages using
an HTML editor, it rapidly becomes tedious to maintain the links and to
make sure that all the pages have the same look and feel.
To make the maintenance of such decision graphs easier, I wrote a Perl
script to automatically generate the HTML files from a small graph description
language. This tool has been tested on MS-DOS, DG-Unix, SCO-Unix. It should
run without any problem on Linux and on any system having a Perl environment.
The generated HTML files have been tested on "Oracle Web Server" and "Apache",
the most popular Web server on the Internet (and of course on Linux). An
example of the definition language can be seen in the file "demo.dia",
the result at the following address "demo000.htm" (link in URL's section).
The free-software "webdiag.pl" Perl script is shown HERE.
This simple tool provides a powerful way to bring Web based users support
using Linux, Apache and Perl. Complex decision graphs with links to existing
pages of documentation can be created and maintained easily.
Similar tools already exist, one that I discovered months after having
developed mine, is described at http://www.myplace.org/~spatula/dgml.html.
Marc-Henri Poget is a Swiss software engineer, working now in Taiwan until
the end of 1998 in the area of fax services over the Internet. His main
interests are: network and Web applications, network management, and troubleshooting.
He can be reached at mpoget@hospvd.ch.
Part 2: Linux Tutorial
Tutorial Materials List
By Steve Litt
To complete this tutorial, here's what you'll need:
-
Windows 98 computer
-
Linux Computer
-
PC Compatible computer with at least 16 meg ram (32 preferable), 1.6 Gig
or more hard drive with Motherboard/bios to support it, 386 (486 or Pentium
preferable). Must not be microchannel. Ideally a real Intel chip, although
many have gotten Linux to work with other Cyrex, AMD, etc.
-
Linux compatible 100mbit network card (see Red Hat Linux Hardware Compatibility
List)
-
Linux compatible CD. If the CD is IDE and plugs into your motherboard's
IDE0 or IDE1, it's probably compatible.
-
1.44 3 1/2 inch Floppy drive.
-
Linux compatible Video card. Note that if you don't need to use X, most
modern cards are compatible. Most of the exercises in this tutorial don't
require X.
-
Red Hat Linux Installation CD (or a CD from another vendor, with suitable
modifications in the tutorial).
-
Network
-
2 Cat 5 RJ45 cables
-
1 hub
-
I've heard a single "flipped" RJ45 cat 5 will work without requiring a
hub, but will limit you to two machines.
-
Documentation
-
This document (November 1998 Troubleshooting Professional Magazine)
-
Red Hat Linux Installation Guide, or equivalent from another vendor.
-
Documentation on your installation/distribution CD's
Conventions Used in
All Examples in This Issue
By Steve Litt
To make it easy for you to duplicate the activities in each article of
this magazine, I've used some specific conventions.
About Domain Names in These Examples
All Domains Names End In .CXM
First and formost, all first level domain names are .cxm instead of .com.
That gives the benefit of being able to use this system while connected
to the Internet, without conflict. For instance, the domain for this machine
is mydomain.cxm. On the Internet, mydomain.com is a domain name registry
site. Because mine ends in .cxm, there's no conflict, even when you're
on the net. Likewise, the most of the other .cxm example domains have their
counterparts in the real world:
-
mydomain.com: A website devoted to registering and moving domain names.
-
troubleshooters.com: Steve Litt's site devoted to troubleshooting.
-
problemsolving.com: Steve Litt's site devoted to the broader issue of solving
problems.
-
stevelitt.com: Steve Litt's personal website.
-
nag.com: Website for The Numerical Algorithms Group, Inc.
-
netadminguide.com: Not taken -- It's available to the first person giving
Internic $35.00.
By using .cxm instead of .com first level domain names in my examples,
you can do these exercises while connected to the web, with no ambiguity.
System Diagram
rj45cat5 rj45cat5
Win98 machine<------------>hub<--------------->Linux machine
192.168.100.1 100mbit 100mbit 192.168.100.3
Win98-Only Machine
-
IP Address: 192.168.100.1
-
Subnet mask: 255.255.255.0
-
Login name: myuid
-
Password: Make your own
-
Machine name: P2300
Dual Boot Machine in Win98 Mode
-
IP Address: 192.168.100.2
-
Subnet mask: 255.255.255.0
-
Login name: myuid
-
Password: Make your own
-
Machine name: P2300
Dual Boot Machine in Linux Mode (also referred to as "the Linux machine")
-
IP Address: 192.168.100.3
-
Subnet mask: 255.255.255.0
-
Login Name: myuid
-
Password: Make your own
-
Machine Name: linuxhost.mydomain.cxm
-
Domain: mydomain.cxm
Virtual Hosts
Virtual hosts on the Linux machine refer to additional IP addresses which
it responds to due to inclusion in the linuxconf configuration utility,
and which are mapped to their own home directories via <VirtualHost>
blocks in /etc/httpd/conf/httpd.conf.
IP address
(Maps to the Home Directory by a <VirtualDomain> block in /etc/httpd/conf/httpd.conf),
and enabled by an entry in linuxconf's config->
Networking->
server tasks->
IP aliases->
eth0
|
Home directory
(Maps to a web page by the content of this directory)
|
Web Page
|
192.168.100.3
(Note: this is the actual IP address of the machine.) |
/home/httpd/html |
Apache's "Test Page for Red Hat Linux's Apache Installation" |
192.168.100.113 |
/web/sites/troubleshooters.cxm |
A small sample page created by you, to test the system. |
192.168.100.148 |
/usr/doc/LDP/nag |
The Network Administrator's Guide documentation that comes with Red
Hat Linux. |
Virtual Domains and Alias Domains
Alias Domains
(Map to a Virtual Domain by a IN CNAME statement in /var/named/named.mydomain.cxm
and enabled by a primary entry in /etc/named.boot.)
|
Virtual Domain
(Maps to the IP address by an IN A statement in /var/named/named.mydomain.cxm
file.)
|
IP address
(Maps to the Home Directory by a <VirtualDomain> block in /etc/httpd/conf/httpd.conf),
and enabled by an entry in linuxconf's config->
Networking->
server tasks->
IP aliases->
eth0
|
www.mydomain.cxm |
linuxhost.mydomain.cxm |
192.168.100.3
(Note: this is the actual IP address of the machine.) |
www.troubleshooters.cxm
troubleshooters.cxm
www.problemsolving.cxm
problemsolving.cxm
www.stevelitt.cxm
stevelitt.cxm |
troubleshooters.mydomain.cxm |
192.168.100.113 |
www.nag.cxm
nag.cxm
www.netadminguide.cxm
netadminguide.cxm |
nag.mydomain.cxm |
192.168.100.148 |
Free Isn't Cheap
By Steve Litt
Linux is free software, meaning it, and its derivatives, can be given away
or sold. But either way, the source code must be included at no extra price.
And either way, the recipient or buyer must be given the same rights to
the software as the seller. In fact anyone can download Linux off the 'net
at no cost.
But that's the most expensive way to do it. For anyone but a Linux guru,
doing it that way would add days or maybe weeks to the process. For anyone
making even minimum wage, it's better to pay $49.00 to get the operating
system on a CD with a clean installation program.
Nor is the $49.00 the only expense. In the following articles I'm going
to strongly advise you to install the ENTIRE Red Hat system. That's 900Meg
before data. And before the 300 meg Windows 98 dual boot I'll be suggesting
you co-install. That's probably more than the entire hard disk on that
486 in your attic. In such a case I advise buying a new hard disk. A 1.6Gig
will do the trick. An 8.2Gig disk costs $245.00. Fiddling around for days
trying to make a partial installation (and only gurus know which parts
are necessary) work is much more costly.
Speaking of the 486 in the attic, it needs to be Linux compatible, and
needs to be in good repair. No microchannel need apply. Cyrex/AMD are iffy
in Linux -- I'd recommend Intel. Off brand components may or may not work.
If they don't, you may or may not be able to trace the problem to them.
And with off brands, you'll find very little expertise to help you. Use
name brands, even if you need to buy them.
On the other hand, don't use anything too state of the art. Since Linux
programmers don't have Bill Gates's budget, it takes them about a year
to become compatible with popular new hardware. I used a Pentium 150 with
a name SuperMicro motherboard with Linux 5.1, and it installed without
a hitch.
And of course, that attic machine must be dedicated to the Linux project.
You must be able to fdisk, re-fdisk, reformat and re-install both Linux
and Win98 on it multiple times, having absolutely no concern about ruining
any data or needed special configurations.
Linux isn't cheap with time either. I probably did 20 installations
at between 20 and 40 minutes a piece. Re-installations are often the best
use of time, because the installation program is smart. After an installation,
a study of configuration files often reveals past mistakes. Obviously,
I was doing other work while the installation was cranking, but that's
still a lot of time. Time well spent, though. I can walk into any shop
and feel confident installing Red Hat now.
Free software isn't cheap. I had to add a a $49.00 Red Hat distribution,
$62.00 compatible network card, an $85.00 hub, a couple cables, and dedicate
my old Pentium 150 and a couple old hard disks.
But now I have an ultra-high performance intranet web server on my desk.
And I have a week's hands-on training in server and networking technology.
Price all that in the Microsoft world.
Steve Litt is president of American Troublebusters and Troubleshooters.Com,
and editor of Troubleshooting Professional Magazine. He teaches the Universal
Troubleshooting Process, and is also an application developer and technical
writer. He can be reached at Steve Litt's email address.
Why Red Hat
By Steve Litt
I chose Red Hat because I'd heard great things about it. Quite a bit of
the special effects on the Titanic were done with Red Hat Linux, and the
Stone Soupercomputer used Red Hat Linux. I suspect Slackware, Caldera and
other commercial versions, as well as Debian, are every bit as good, but
I had to choose one so I chose Red Hat for their great reputation.
You can't get fired for buying Red Hat :-)
It was a good choice. It installed without a hitch. After installing,
I went thru some of the configuration files and programs and saw all their
installation program had done for me. It would have taken me weeks (well,
weeks if I didn't know what I know now) to do what their installation program
did in 40 minutes (20 if you don't check drives for bad blocks).
I can highly recommend Red Hat Linux. It's solid, and a further benefit
is you can use this issue of Troubleshooting Professional, unmodified,
to guide you in your installation/configuration.
If you get it from Red Hat themselves, you're guaranteed the latest
version and a month of support.
If you don't get Red Hat, please get a modern, reputable distribution
on a CD. Your time (and that of those you ask for help) is worth too much
to do otherwise.
Steve Litt is president of American Troublebusters and Troubleshooters.Com,
and editor of Troubleshooting Professional Magazine. He is the author of
Troubleshooting Techniques of
the Successful Technologist, and is also
an application developer and technical writer. He can be reached at Steve Litt's email address.
Check Your Components
For Compatibility
By Steve Litt
It must be nice to be Bill Gates. You announce a new operating system,
and the hardware vendors jump through hoops making their hardware compatible
with the new specification. With Linux it's the other way around. Hardware
vendors change their products, and Linux programmers hustle to write drivers
for them.
I think hardware vendors will soon issue Linux drivers with their products.
Witness Oracle's announcement that they're targeting the Linux platform.
But right now, we Linux people are on our own.
If you're not a Linux programmer capable of writing drivers for your
hardware, and if you want a nice, easy life with Linux, the best thing
to do is make sure you're using Linux compatible hardware before you install.
That saves wondering whether the problem's in the thousands of configuration
options, or whether you just have incompatible hardware.
Fortunately, Red Hat has a compatibility chart. Its URL is listed at
the bottom of this issue. Use it!
Build a Command-Line Linux
By Steve Litt
Make Your Boot Disk
I have a nightmare. My DOS distribution floppies finally go bad, and I
can no longer bootstrap myself into my Windows 2014 upgrade. With Linux,
that will never be a problem.
You can go to any CD-ROM equipped machine, Linux, Dos, Windows, or many
Unix machines, and create a bootable installation floppy for Linux. It's
free software, so copy protection isn't an issue.
Making Your Boot Disk from Dos (or Windows)
This is Red Hat specific, but it should be pretty much the same with any
distribution.
-
Get to \dosutils on your cdrom
-
Run rawrite.exe
-
When asked for the source image, put ..\images\boot.img
-
When asked for the target diskette drive, put a:
-
Place a blank, formatted 1.44 floppy in your A: drive, then hit Enter
That's it. After a suitable time cranking away, you'll have yourself a
boot installation diskette.
Making Your Boot Disk from Linux or Many Unixes
-
Make sure you have permission to write /dev/fd0.
-
Place a blank, formatted 1.44 floppy in your /dev/fd0 (would be a: in dos)
drive.
-
Mount the Red Hat Linux CD
-
Get into the CD's /images directory.
-
Run this command: dd if=boot.img of=/dev/fd0 bs=1440k.
That's it. After a suitable time cranking away, you'll have yourself a
boot installation diskette.
Using the Boot Disk Packaged With Your Red Hat Distribution
There's a boot disk in the box that works just fine. The previous instructions
were just to give you the confidence that if your boot disk becomes corrupt,
you can easily make a new one.
Booting from CD
Modern computers can be BIOS configured to try a CD boot before hitting
the hard drive. The Red Hat Installation CD is bootable. You can do this
to avoid boot diskettes entirely.
Partition Your Drive for Dual Boot
NOTE!! These procedures will almost certainly corrupt or erase existing
data on the drive. Use a drive with no valuable data.
-
Boot from your Linux Boot Diskette
-
Take the defaults on the prompts (unless you'd like your prompts in a language
other than English or your keyboard is non-standard).
-
When you get to the screen asking "Which tool would you like to use" and
giving you the choice of Disk Druid or Fdisk, choose Fdisk because you'll
be doing some specialized partitioning. You'll be brought to a screen titled
"Partitioning Disks" listing your installed physical hard disks, and sporting
a Done, an Edit, and a Back button. Careful, this screen is Very tricky.
-
Use the arrow keys to highlight the first hard disk (hda).
-
Use the tab key to move to the Edit button, then hit Enter. You'll be brought
to the Fdisk program, on the hda hard disk.
-
Note that you can get a list of commands by hitting m, and a list
of all partitions by hitting p.
-
Use the p and d commands to delete existing partitions. Use the p command
to verify they're gone.
-
Use the n command to create partition 1 (10Meg). Make it a primary partition.
For first cylinder, put the first available according to the prompt (should
be 1). For the last cylinder put +10M(be sure to remember the plus sign
and upper case M), to tell Fdisk the size without having to calculate cylinders
yourself.
-
Use the p command to make sure you have one and only 1 partition, and it's
the one you just created. DO NOT attempt to create the Win98 partition
from Linux. You can do it, but it will cause corruption later because
parts of Windows won't recognize its size, and will write data right off
the end and into the next partition.
-
Use the w command to write the changes. You'll be brought back to the "Partition
Disks" screen.
-
Hit Ctrl-Alt-Delete to bail out of the Linux Installation program, which
you used just to make the 10 meg Linux partition.
Set Up a Dual Boot Windows 98
-
Use Dos or Win9x Fdisk (small disk version on Win98) to create a 300 meg
partition. Set it active. DO NOT use a partition created with Linux formatting
tools.
-
Boot to a DOS or Win9x startup diskette. A Win98 is the best, because it
has built-in CD drivers.
-
Format C: /S
-
Confirm that you're formatting roughly 300 meg (give or take 60). In particular,
there's a problem if the format program seems to think you're formatting
the amount of space remaining on the physical drive. If that occurs, use
DOS/WIN fdisk to delete the partition and add it back. Do not delete the
10Meg Linux partition.
-
Once C: is formatted, insert a Win98 Install CD and run setup, taking all
the defaults. When it asks for evidence of a previous system, insert your
Win95 diskette.
-
Once Setup has gotten past looking for previous operating system, remove
the startup diskette.
-
Finish the installation, taking all the defaults.
-
Once Win98 is installed, reboot to the hard drive to make sure it's OK.
-
Then continue on to the Linux part of the installation.
Run the Linux Installation Program.
It's easy. Just boot to a boot installation floppy or to the installation
CD, and answer the prompts. For the most part, you'll pick the defaults.
When asked what packages to install, install them all. It's a lot easier
than trying to decide which ones, then troubleshooting the resulting problems.
When asked which services to run at boot time, accept the defaults -- they're
pretty good. Make sure the httpd, named, and PostgreSQL services are enabled
on bootup. After the first couple (re) installations to a given hard disk,
you can forgo testing for bad blocks and cut the install time in half.
I'd recommend you run these installs while doing your other work, because
you might have to do quite a few of them.
Start it Off
Place your Linux Boot Diskette in Drive A, and place your Red Hat Linux
CD in the CD. Then reboot your computer.
Language |
Your Choice |
Keyboard |
Your Choice |
Installation Method |
Local CDROM |
Installation Path (Install or Upgrade) |
Install |
Do You have SCSI adapters |
Answer truthfully, and if you have SCSI configure it |
Disk Setup (Disk Druid or fdisk) |
Disk Druid |
Continue on to the next section of this document (partitioning)
|
Take all the defaults
Partitioning
Note: If, upon going into Disk Druid, the program tells
you something about a "bad signal received", then hangs telling you "you
can safely reboot the system now", check the master-slave jumpers on your
hard disks, and check your hard disk configuration in CMOS. In order to
prevent later intermittents, Linux rejects incorrect disk configurations
that other operating systems accept.
Here are the partitions we're going to need. Partition 1 was created on
our initial, aborted Linux install, whose purpose was simply to create
that 10Meg partition. Partition 2 was created during Win98 installation.
Partitions 3 and 4 will be created during the Linux installation, using
Disk Druid.
Partition # |
Op-sys |
Purpose |
Size |
1 |
Linux |
/boot |
10 meg |
2 |
Win98 |
C: |
300 meg |
3 |
Linux |
Swap partition |
127 meg |
4 |
Linux |
/ |
at least 1 gig |
Note: If you already have these partitions from a previous installation,
simply use Disk Druid to put in the mount points.
Instructions:
-
Highlight the Linux native 10Meg partition tab to the Edit button, and
press Enter. You'll be brought to the Edit Partition screen.
-
Input the mount point as /boot, tab to OK, and hit Enter. You'll be brought
back to the "Current Disk Partitions" screen.
-
Tab to the Add button and hit Enter. You'll be brought to the Edit New
Partition screen. Make it no mount point, 127 Meg size, Linux Swap type,
not growable, and allowable only on hda. Move to the OK button and hit
Enter to save your changes and return to the "Current Disk Partitions"
screen.
-
Tab to the Add button and hit Enter. You'll be brought to the Edit New
Partition screen. Make it mount point /, size 1000Meg, type Linux Native,
Growable no, allowable on hda only. Move to the OK button and hit Enter
to save your changes and return to the "Current Disk Partitions" screen.
-
Tab to the OK button and hit Enter. When asked whether to save changes
to the partition table, tab to the Yes button and hit enter to save your
changes.
-
You'll move on to the rest of the installation. You're done partitioning.
Why You Did This
Your boot code must be in the first 1024 tracks of your first hard disk.
On small hard disks that isn't a problem, but on large ones it can be.
That's why the /boot partition must be the first partition on the first
drive. If you don't do that and as a result the boot code is partially
or entirely above 1023, the machine will hang early in the boot. If that
happens, re-install Linux.
About the Linux Directory System
As a former DOS guy, the Linux directory system at first seemed a strange
beast. No drive letters. All directories are under directory /. Floppy
and CD drives are simply directories under the root, although they must
be "mounted" to be used. Subdirectories can and do run out of room. Perhaps
strangest of all, directory /var/log can be on a completely different physical
hard disk than directory /var. Specific directories can, but don't have
to be, associated with specific partitions. If they are, the directory
is called the partition's "mount point".
For the purposes of learning, the best thing to do is have one big partition
with a mount point of /, and a small (10meg) one with a mount point of
/boot (for clean booting on large disks), and a swap partition.
Formatting
-
On the "Active Swap Space" screen, take the defaults, which are to choose
the swap partition you just made, and to check for bad blocks during format.
-
On the "Partitions To Format" screen, make sure you format the / and /boot
partitions by placing stars in their checkboxes with the spacebar. If this
is your first time using this set of partitions, be sure you also put a
star in the "Check for bad blocks during format" checkbox. However, if
this is a repeat installation with these same partitions, you can knock
about 20 minutes off your install by leaving the "Check for bad blocks
during format" box unchecked.
Components to Install
On the "Components to Install" screen, leave the "Select individual packages"
button unchecked, scroll to the bottom of the scrollable list, and check
the "Everything" checkbox. This will install all the components. It's important
all components are installed to minimize problems and troubleshooting time.
With disk space now costing $50.00 per gig, it doesn't make sense to waste
lots of time saving a couple hundred meg. That's why we made the / partition
a full gig.
When asked for the services you want started at bootup, leave the defaults
except make absolutely sure httpd, named, and PostgreSQL are enabled for
start at boot.
Video
During the installation, Linux will probe your video card, ask you for
your monitor type, and give you several video modes with one default. Choose
the default at first. You may need to make other choices, or possibly custom
configure the monitor, if the standard method doesn't produce a pleasing
result. Note that you can easily use Xconfigurator to re-configure your
video in Linux without re-installation.
Network
You'll be asked this question:
| Network Configuration |
Do you want to configure LAN (not dialup) networking for your installed
system?
|
Select Yes. It will auto-detect your card (hopefully), inform you what
card you have, then when you hit OK it will present you with the boot protocol
screen, giving you the choice of Static IP address, BOOTP or DHCP. Choose
Static IP address.
You'll now be brought to the "Configure TCP/IP screen, which asks for
IP address, Netmask, Default gateway (IP), and Primary nameserver. In the
IP address field, put in 192.168.100.3, then hit enter. As you keep hitting
Enter, the rest of the fields will default as follows:
| Configure TCP/IP |
Please enter the IP configuration for this machine. Each item should
be entered as an IP address in dotted-decimal notation (for example, 1.2.3.4.
IP address:
192.168.100.3
Netmask:
255.255.255.0
Default Gateway (IP): 192.168.100.254
Primary nameserver: 192.168.100.1
|
Accept the defaults. Note that on your setup it's possible the default
gateway and primary nameserver could be different than shown. That's OK.
And yes, I know that primary nameserver is wrong, 192.168.100.1 is your
Windows PC. For now accept the defaults. We'll patch it up later. If, upon
rebooting your machine it hangs, you'll probably need bust in with a boot
and rescue disk to rename file /etc/resolv.conf, which contains the bad
primary nameserver number. If so, here are the
instructions.
You'll next be brought to the "Configure Network" screen. Don't forget
to use the first level domain name cxm instead of the usual com. This will
prevent confusion with real internet web sites. Fill this screen out as
shown below, leaving secondary and tertiary nameservers blank.
| Configure Network |
Please enter your domain name, host name, and the IP addresses of
any additional nameservers. Your host name should be a fully qualified
host name, such as mybox.mylab.myco.com. If you don't have any additional
nameservers, leave the nameserver entries blank.
Domain name:
mydomain.cxm
Host name:
linuxhost.mydomain.cxm
Secondary nameserver (IP):
Tertiary nameserver (IP):
|
The IP address is 192.168.100.3, mask 255.255.255.0, and any other info
asked for. Take its default value for Network and Broadcast. The machine's
name is linuxhost, and the domain is mydomain.cxm.
Timezones
Fill in your timezone. Do not hardware clock set to gmt if the machine
is a dual boot.
Services
Pretty much accept the defaults. However, MAKE SURE these three services
are enabled (have an asterisk):
-
httpd (already defaulted to enabled)
-
named (already defaulted to enabled)
-
postgresql (defaulted to disabled, change it)
Printer
I didn't configure a printer, so I can't advise you on how to do it.
Root Password
Use of this screen is obvious. Just type it in twice, the same way. Case
counts, so be sure you know whether your caplocks are on.
BootDisk
Choose to make a bootdisk. Use a high quality, clean floppy (although I've
had no trouble with high quality floppies with stuff already on them --
Linux seems to erase the floppies old contents.
LILO Installation Screen
Toward the end of the program you'll be asked to configure LILO (the LInux
LOader) to boot from the MBR (master boot record on the first physical
drive), or else from the the Linux partition. If you're making a
dual boot on a machine already loaded with Win95/98, choose the latter.
Contrary to the Red Hat documentation, I was not able to boot off the hard
disk when configuring LILO to work with the Linux partion, but instead
had to use a floppy.
In single boot systems, or in dual boot systems where you've had the
opportunity to install a 10 meg /boot partition as the first partition
on the first drive (before the partition that will become C: in Windows),
the Master Boot Record is the way to go. Please note that dual boots stand
a high risk of wipeout in the best of circumstances. DO NOT install a dual
boot on a system containing valuable data.
The last step it asks for special LILO configuration options. There's
a "Use linear mode (needed for some SCSI drives)" checkbox. If your drive
is configured as LBA in your bios setup, check this checkbox, using the
spacebar.
On the next screen it gives you a chance to edit the operating system
boots, and to tell which one is default. Leave Linux as default, but you
might want, at this point, to change the one labeled dos so it has a more
realistic label (i.e. win).
There's an article on dual booting later in this issue.
Fiddle around with the result.
Find and try out editors. Reboot several times. Create users and change
their passwords. Note that they are given directories under the /home directory.
Use both man and info for documentation, and note that info is much better.
Look up the mount command, and use it to mount and dismount your CD. Discover
the difference between /dev/cdrom and /mnt/cdrom. Use linuxconf. If you
accidentally wipe out Linux with linuxconf, just reinstall Linux.
info
In the old days of Unix, you used the man command to get help
on commands. I always thought man was ugly and inconvenient, and
used it only as a last resort. With Linux, the preferred method is the
info
command.
To get information on a specific command, type
info <commandname>
To see all help, just type
info
Info is organized with hyperlinks. And get this. It runs in non-gui mode,
requiring no mouse. It can run in the most rudimentary Linux setup.
git
Learn how to use the git file-browsing utility. It runs in a command
line environment, and even in a telnet session. It makes navigation a cinch.
Powerful and full-featured, its mastery could fill a semester college course.
Below is the minimum knowledge you'll need to use git.
Functionality |
Keystroke |
Exit back to command line |
^X ^C or ^X c |
Up one file |
Up |
Down one file |
Down |
Browse highlighted directory |
Enter |
View highlighted file |
^X v |
Run Linux command |
Type it on git's command line |
Get help on git |
On command line, type
info git
Note: Voluminous information |
Note that most functionalities can be invoked by several different keystroke
combinations. I've listed the ones that work equally well at the console
and from a Windows telnet session.
A git ninja can do almost all system administration with git (and without
needing to go graphical or use a mouse). It works at a console, a dumb
terminal, or a telnet session. Its power makes Win98 Windows Explorer look
like a toy. Unfortunately, it's not nearly as intuitive as Windows Explorer,
so you might want to make a "cheat sheet" of your favorite git commands.
locate command
There's a command called locate that allows you to find any filename containing
a string you type in. VERY handy for snooping around Unix. Locate is database
driven (it's not a recursive directory search, so it's lightning fast).
To initially load the database, do the following command, which will take
a couple minutes or so to run:
/etc/cron.daily/updatedb.cron
Multitasking
Do you like Windows Multitasking? If so, you still have it. You have 6
virtual terminals in Linux, available as Alt-F1 through Alt-F6. Each one
can be logged in as a different user. And of course, you can have as many
telnet sessions coming in as you want (but not til you install networking).
And if you're running X, you can start an indefinite number of shells.
Troubleshooting
Carefully read all error messages, and narrow down the problem. If it gets
frustrating, try reinstalling and see if that changes the symptom.
Write a Couple Programs
By Steve Litt
Note! In Linux, all filenames are case sensitive. hello.cpp
is NOT the same file as HELLO.CPP, which is not the same as HeLlOw.CpP.
Using the editor of your choice (vi or emacs, or Linux also has some others,
including some that use the old Wordstar keystrokes), make the following
C++ program, which you will name hello.cpp:
#include <iostream.h>
int main(void)
{
cout << "Hello World\n";
return(0);
}
|
Now compile it with this command:
c++ hello.cpp
That produces a runnable file called a.out. You can then run a.out with
the following command:
./a.out
Be sure to use the dot and the forward slash. In Linux that's necessary.
It should write the words "Hello World" to the screen.
Now write Perl progam hello.pl as follows:
Run it with the following command:
perl -w hello.pl
It should write the words "Hello World" to the screen.
That's it. You've just programmed in Linux, both C++ and Perl.
Boot Floppies -- Getting Back Into a Locked
Up System
By Steve Litt
Sooner or later it happens. You make a small change to a file, reboot,
and the boot hangs. If you could boot, you could repair the damage, and
if you could repair the damage you could boot. To make matters worse, you
didn't make a boot floppy or a rescue floppy. According to Red Hat documentation,
you're toast.
But I found out you can get into your file system anyway. You need to
make an install diskette and a rescue diskette on another machine, as follows
|
Dos/win |
Linux/unix |
Install
floppy |
-
insert formatted floppy
-
cd d:\dosutils
-
rawrite
-
image file is ..\images\boot.img
-
destination is a:
|
-
insert a formatted floppy
-
mount /dev/cdrom /mnt/cdrom
-
dd if=/mnt/cdrom/images/boot.img of=/dev/fd0 bs=1440k
|
Rescue
floppy |
-
insert formatted floppy
-
cd d:\dosutils
-
rawrite
-
image file is ..\images\rescue.img
-
destination is a:
|
-
insert a formatted floppy
-
mount /dev/cdrom /mnt/cdrom
-
dd if=/mnt/cdrom/images/rescue.img of=/dev/fd0 bs=1440k
|
Now boot from the install floppy, and at the LILO prompt type the word
rescue,
then hit Enter. It will do its thing for a while, the ask you to install
the rescue disk (it calls it something else, but it's the rescue disk).
Insert the rescue disk and hit Enter. Eventually you'll be brought to a
bash#
prompt, in single user Linux. Then type this command:
mount /dev/hda6 /mnt
Note that on my system the root partition is on hda6, on yours it might
be something else. You'll need to experiment to find out which partition
is the root on your machine. Now you can browse /mnt, which will look like
your old /, find the file you need to fix, fix it with the vi editor, and
save it.
THEN DISMOUNT THE DRIVE!!! The command is umount /mnt.
If you fail to do that, the file will revert back to its pre-edited condition!
With the drive dismounted, type
exit at the bash#
prompt to halt the machine, remove the floppy, and boot back to the hard
disk. Note that this will also work with your system dependent boot floppy
you made at the end of your install (just remember to type rescue
at the LILO prompt).
Get X Working
By Steve Litt
Important Note:
If you need to quickly exit graphics mode, use the Ctrl-Alt-Backspace keystroke
combination. This is especially important if you lose sync (horizontal
lines, or screen split in 2 or 3, or maybe even just black) in graphics
mode. Operating a monitor out of sync for a long time can physically damage
the monitor, so you want to bail as soon as it happens. Ctrl-Alt-Backspace
is the way to do that.
Ctrl-Alt-Backspace is pretty clean, but obviously the preferred way to
exit Xwindows is click the start button, then click "Exit fvwm".
Startx
The startx command starts the XFree86 program, a free-software Xwindows
workalike. You'll notice a resemblance to the Win95 interface, although
personally I like Win95 better. Be aware that when you hit the Start button
the mouse pointer may move on its own. Go through your start menu and note
all the programs and configuration tools you can use. If you happen to
break something, you can always reinstall.
Xconfigurator -- Troubleshooting
This is where you Troubleshoot. Xconfigurator helps you get your video
mode right for Xwindows. Its use is pretty obvious. You can experiment
with it til you get a configuration you like. It's especially challenging
on old beater circa 1992 monitors. Note that if you absolutely can't get
Xwindows running, check your video card for compatibility. Be sure you
check what kind of video card you have -- don't just take the Linux installer's
word for it. See what Win98 reports about your video card.
Netscape, Control Panel
Try the various applications and configuration tools available from Xwindows'
start button. There's Control Panel, offering lots of configuration options,
there's Netscape Navigator (complete with a less than perfect version of
Composer). Also, you should know about Kill, with a bomb for an icon. It's
located in the Window Operations submenu. Click it, then the next program
you click on will be terminated. Sometimes this is the only way to end
a program in the graphics environment.
Dual Booting Linux With Win98
By Steve Litt
Anyone who's written me asking a dual boot question knows I'm not a fan
of dual booting, but in this case Windows 98 makes a great diagnostic tool
for configuring Linux, so I recommend a dual boot. Also keep in mind that
this machine should be a spare one with no valuable data or configurations.
Partitioning is a little tough, because there's no fdisk program which
can properly do it. That is, except for Linux's fdisk program. Not Install's
Disk Druid (that won't let you do certain things), and not Dos or Win Fdisk
(those won't let you create or delete some non-dos partions). So here's
what you do:
Note: These instructions are good ONLY if you're using
a spare machine with no valuable data or configurations. It's entirely
likely that a single misstep will require a complete re-installation of
one or both of the operating systems, with total data loss.
-
Boot from your Linux Boot Diskette
-
Take the defaults on the prompts (unless you'd like your prompts in a language
other than English or your keyboard is non-standard).
-
When you get to the screen asking "Which tool would you like to use" and
giving you the choice of Disk Druid or Fdisk, choose Fdisk because you'll
be doing some specialized partitioning. You'll be brought to a screen titled
"Partitioning Disks" listing your installed physical hard disks, and sporting
a Done, an Edit, and a Back button. Careful, this screen is Very tricky.
-
Use the arrow keys to highlight the first hard disk (hda).
-
Use the tab key to move to the Edit button, then hit Enter. You'll be brought
to the Fdisk program, on the hda hard disk.
-
Note that you can get a list of commands by hitting m, and a list
of all partitions by hitting p.
-
Use the p and d commands to delete existing partitions. Use the p command
to verify they're gone.
-
Use the n command to create partition 1 (10Meg). Make it a primary partition.
For first cylinder, put the first available according to the prompt (should
be 1). For the last cylinder put +10M(be sure to remember the plus sign
and upper case M), to tell Fdisk the size without having to calculate cylinders
yourself.
-
Use the p command to make sure you have one and only 1 partition, and it's
the one you just created. DO NOT attempt to create the Win98 partition
from Linux. You can do it, but it will cause corruption later
-
Use the w command to write the changes. You'll be brought back to the "Partition
Disks" screen.
-
Hit Ctrl-Alt-Delete to bail out of the Linux Installation program, which
you used just to make the 10 meg Linux partition.
-
Boot a DOS or Win9x install disk, and Fdisk a 300mb partition to host C:
-
Install Windows 98, typical configuration, to the 300 mb partition.
-
Boot to a Linux installer diskette, use Disk Druid to add a 127mb swap
partition and a 1 gig (at least) partition, mount point /. If your first
hard disk doesn't have enough space, you can put the / partition on the
second partition. Install ALL packages -- it's not worth your time to pick
and choose. When asked where to put LILO, say MBR (Master Boot Record)
-
Reboot. At the boot prompt, you'll have 5 seconds to decide which system
to boot. You can hit Enter to boot to Linux, or enter dos (or
win
if you changed it to win in linuxconf) then hit Enter to go into Windows.
If you don't decide in 5 seconds, it will default to Linux.
-
To increase the decision time in the above step, get into Linux as root,
linuxconf->config->boot mode->Configure LILO defaults (Linux
boot loader)->Base options->Prompt timeout in seconds, and change the 5
second entry to a more appropriate 60 seconds. Then accept all the way
out.
-
If you want to change the "boot to Windows" command you enter from the
boot prompt (after all, "dos" is kind of misleading), it's at linuxconf->config->boot
mode->LILO other OS configurations. Hit Enter on the dos label to bring
up an input form, and change the label from "dos" to a more realistic label,
such as win. Remember to keep it short and easy to type, because often
you may have little time to type it in. Then accept all the way out.
Dual booting an existing Win98 installation
I really don't recommend this. It's very likely you'll destroy the Win98
system. However, if you insist, here's the easiest way:
-
Add a second hard drive
-
Run Linux install
-
Using Disk Druid, make the first partition less than 1023 cylinders, and
give it a / mount point.
-
Make a swap partition on either drive, anywhere.
-
Make a large (>900meg) partition anywhere it will fit, and give it mount
point /var
-
BE ABSOLUTELY SURE to create a boot disk, as this will be the only way
you'll be able to boot to Linux on this setup.
-
BE ABSOLUTELY SURE to tell LILO to install on the Linux partition, NOT
on the MBR (Master Boot Record). Installing on the MBR will wreck your
Win98 installation.
-
When you want to boot Linux on this configuration, insert the Linux boot
disk you made and boot. To boot to Windows, remove the boot disk.
Note: According to the Red Hat documentation, if you accidentally destroy
your Win98 MBR, you can "put it back" by booting to your Win98 Startup
diskette (you did make one, didn't you?), and typing the undocumented command:
fdisk /mbr
According to their documentation, it will write a Win98 Master Boot Record,
and do nothing else. I can't vouch for it -- I haven't tried it. Once again
by far the best policy is never to dual boot a system with valuable data.
IP Address Review
By Steve Litt
Note: If you already know the theory and practice behind
IP addresses (like if you're a network administrator, or a long-time Unix
user), you can skip this article.
All Unix versions and workalikes, including Linux, communciate between
devices (computers, printers, cash registers, etc) using TCP/IP. TCP/IP
is so entrenched that Windows implemented it. In TCP/IP, each device (computer,
printer, cash registers, etc) has an IP address. The IP address is a 4
byte value that must uniquely identify the device. The four bytes are written
as four decimal numbers in the 0-255 range, separated by dots. Here's an
example:
192.168.100.3
Networks vs. Devices (hosts)
Devices (computer, printer, cash registers, etc) don't exist in a vacuum.
They're grouped into networks. One network contains several devices. The
network has a network address. In fact, the most significant digits of
a device's IP address signify the network address. For instance, the Intranet
operating on the desk in my office has the following devices:
-
192.168.100.1: My Win98 Pentium II, 300, my main working
machine.
-
192.168.100.2: My Pentium 150, operating as a Windows
98 machine.
-
192.168.100.3: My Pentium 150, operating as a Linux machine.
Obviously, the second and third are on the same physical computer and can't
coexist simultaneously. You'll notice all three share the 192.168.100 most
significant bits. That's because that (192.168.100.0) is my intranet's
network address. The reason the computers can talk to each other over my
cat 5 wires and hub, without specific routing information, is because
they're all on the same network. Each machine is configured for its IP
address, and also for a subnet mask, which in all cases is 255.255.255.0.
The subnet mask is the number which, when anded with the devices IP address,
yields the 192.168.100.0 network address.
Class A, B and C Network Addresses
Note that these classifications were recently re-arranged
for better flexibility. But the general principles still apply. Note that
this article is somewhat oversimplified to demonstrate the point.
4 bytes yields 4,294,967,296 unique addresses that must be unique worldwide
for every device directly connected to the Internet. Aren't four billion
addresses enough for the devices in the world? Nope!
First of all, numbers are lost because a network gobbles up addresses
it doesn't use. Here's how it works. Lets say my desktop Intranet was assigned
address 200.200.200.0 by Internic. My network would have device addresses
200.200.200.1 through 200.200.200.254 (somewhat oversimplified, but...).
I'd be using only 2 of my assigned 254 IP addresses, but nobody else would
be able to use them either, because those people's network address wouldn't
be 200.200.200.0.
Imagine a network with 4000 devices on it. You can't use a class C setup,
because it can only address 256 (minus 2) devices. So you must go class
B, which addresses 65536 (minus a few). So you're wasting 61,000+ addresses.
Of course, the new rules require you split your network/device allocation
bitwise (called classless) to get the most bang for your addressing buck,
but in a binary world there will always be address waste, no matter how
fine the bits are cut.
Intranet-Only IP Address Spaces
The IP address registrars (top level being IANA) have specified the following
address blocks be used as intranet-only addresses, which are never directly
connected to a network.
10.0.0.0 - 10.255.255.255 (10/8 prefix, Class A in old notation)
172.16.0.0 - 172.31.255.255 (172.16/12 prefix, 16 contiguous Class B in old notation)
192.168.0.0 - 192.168.255.255 (192.168/16 prefix, 256 contiguous Class C in old notation)
Use one of these (probably the 192... unless you have more than 254 devices
on your intranet) for your setup. Note that even in a production environment,
it often makes more sense to get one live IP address from your provider,
and use a gateway to route that to each of your intranet networks and devices.
There's an article about one such gateway, a Linux implementation called
Share The Net, further down in this issue.
Using Intranet-only addresses, and connecting to the net thru a single
live IP is more secure, less bureaucratic hassle, and even makes you a
better citizen for conserving ever more scarce 4 byte net addresses. Like
any other conservation, it could conceivably backfire if the addresses
become terribly scarce and "hoarders" start "gouging" those who were good
citizens. If you have a sizable corporate presence, it might not be a bad
idea to register a few IP addresses, but certainly not one for every device
on your network (IANA wouldn't let you, anyway).
Get a Win98 Network Running
By Steve Litt
Great diagnostic
Have you heard these Linux chauvinists say Windows is good for nothing?
They're just sour grapes. In fact, Win98 is a wonderful diagnostic program,
extremely well suited for configuring Linux. You can use Win98 to prove
that at least your network card hardware is capable of communicating.
Don't use Win95
Windows 95 was a wonderful program for its time, but its networking setup
is arcane. Think back to the times you've seen a Win95 workstation connectivity
problem, and having various networking experts come in, do their rain dances
and wizardly incantations, then go away scratching their heads. With Windows
98, a mere mortal can connect.
Try for the defaults
I'm assuming here you have a Win98 computer of your own, and you dual booted
your Linux computer with Win98. Install your network cards on both, then
add any necessary adapter, protocol and client. Take all the defaults.
Don't put in IP addresses or net masks, but instead let Windows networking
take care of it. Troubleshoot as necessary, and right-click directories
in Explorer to enable sharing on those directories. The defaults will probably
be a WINS-enabled configuration with DHCP used for WINS resolution. When
you can read and write to each computer from the other, you're ready to
go on to the next step.
Now put in IP addresses
For the purposes of this exercise, we'll be hard-coding IP addresses. That's
the easiest way to do it in Linux. We'll set up a class C network at Intranet
reserved address 192.168.100.0. All machines must have IP addresses starting
with 192.168.100. Since it's class C, all net masks will be 255.255.255.0.
Make your dedicated Win98 machine 192.168.100.1, and your dual-boot machine,
when booted to Win98, 192.168.100.2. Disable WINS. If it worked with WINS/DHCP,
then it should work with dedicated IP numbers.
You know you've succeeded when...
Once again, you know you've succeeded when you can share, read and write
directories from the other machine.
Troubleshooting
Windows networking is a strange beast. Use Windows Help to learn as much
as possible, run various tests, and see what you can come up with. Use
ping liberally.
Get Linux Networked With Win98
By Steve Litt
Install
BY FAR the easiest method of network configuration on a Linux machine is
to run the installation. The installation probes your network card, asks
you the ip address, network address, etc, and configures itself. If you
configured the network on installation, you're probably OK or very close.
Using linuxconf as a starting point
Like I said, by far the easiest way to configure your network is by installing,
letting install probe the card, ask you for IP addresses and netmasks and
other hosts, etc. But if you must, you can probably configure the network
without (re)installation. Here's what I've been able to find of network
configuration from linuxconf. Please note that two config options, the
network address and the broadcast address, are NOT reachable from linuxconf.
Instead you must edit file /etc/sysconfig/network-scripts/ifcfg-eth0, making
sure the NETWORK variable is the IPADDR anded with the NETMASK, while the
BROADCAST variable is the same as the NETWORK, except has a 255 as the
last number (I don't know how the BROADCAST variable would play out on
class B, class A, or the new classless addressing).
This article uses the following conventions:
-
My Pentium II 300, Win98 only
-
IP is 192.168.100.1
-
Host Name is P2300
-
My Pentium 150, dual boot Linux
-
IP is 192.168.100.3 (When running Linux)
-
Host Name is linuxhost.mydomain.cxm (when running Linux)
Here is the linuxconf configuration tree, and what goes in each part. This
is valid for the linuxconf that comes with Red Hat Linux 5.1. Other versions
may vary.
-
Linuxconf->config->Networking
-
Client tasks
-
Basic host information
-
Host name = linuxhost.mydomain.cxm
-
Adaptor 1 (See this note)
-
Enabled = True (checked)
-
Config mode = Manual
-
Primary name + domain = linuxhost.mydomain.cxm
-
Aliases (opt) = linuxhost
-
IP address = 192.168.100.3
-
Netmask (opt) = 255.255.255.0
-
Net device = eth0
-
Kernel module = eepro100 (Note: Network
Card Specific)
-
I/O port (opt) =
-
Irq (opt) =
-
Name server specification (DNS) : (Leave as is until configuring DNS)
-
DNS usage = [*] DNS is required for normal operation (true)
-
default domain = mydomain.cxm
-
nameserver 1 = 192.168.100.3
-
Routing and gateways : On simple network, leave all fields blank or as-is
-
Host name search path
-
Multiple IPs for one host = True
-
hosts, dns = True (Note: Once you begin configuring DNS,
change it to just dns=true)
-
Network Information System (NIS) : Leave all blank
-
Server tasks
-
Exported file systems (NFS)
-
Path to export = /
-
Comment (opt) =
-
Client name(s) = P2300
-
May write = false
-
Root privileges = false
-
translate symbolic links = false
-
Request access from secure port = true
-
IP aliases for virtual hosts
-
eth0
-
leave blank for now. Later we'll use it to implement virtual hosts.
-
UUCP (Unix to unix copy) : Leave blank
-
Misc
-
Information about other hosts
-
192.168.100.1 P2300
-
Primary name + domain = P2300
-
Aliases (opt) =
-
IP number = 192.168.100.1
-
Comment (opt) =
-
192.168.100.3 linuxhost.mydomain.cxm
-
Primary name + domain = linuxhost.mydomain.cxm
-
Aliases (opt) = linuxhost.mydomain.cxm
-
IP number = 192.168.100.3
-
Comment (opt) =
-
Information about other networks : Leave blank
-
Linuxconf network access
-
Log access in /var/log/htmlaccess.log = false
-
network or host = 192.168.100.1
-
netmask(opt) =
PLEASE REMEMBER!!! The above linuxconf work won't do
a thing unless you also edit /etc/sysconfig/network-scripts/ifcfg-eth0
and make sure the NETWORK variable is the IP address anded with the netmask.
Although it isn't necessary for minimal networking, you should probably
also add the BROADCAST variable set to the NETWORK variable, except that
all the trailing 0 bits are set to 1 (in other words, .255 for a Class
C IP).
At the risk of belaboring a point, I'd like you to remember that I didn't
figure all this stuff out. Instead, I had Red Hat's installation program
figure it out for me, "improved" it a little with linuxconf, then simply
reported the results to you.
Ping
The most basic test of a network connection is ping. It is not affected
by permissions. If the machines can "see each other" it succeeds. Otherwise
it times out.
From your Linux machine, ping your Linux machine. In my example where
my Linux machine is 192.168.100.3, I'd use the command:
Ping 192.168.100.3
from my Linux machine. If you can't ping yourself from a machine, there's
a basic problem with the machine's network setup or network card or network
card compatibility. Read, browse, and narrow it down. If you're working
with an unsupported network card, ask yourself whether the $60 you save
by not buying a supported one is worth the time you're losing. Even if
your unsupported card is secretly compatible, its unsupported status is
preventing you from ruling out hardware.
Once you can ping yourself on your Linux machine, be sure you can ping
yourself on your other (Win98) machine. In my case, my Win98 machine is
192.168.100.1, so the command on my Windows machine would be:
Ping 192.168.100.1
Once I can ping myself on each machine, it's time to try to ping the other
machine. From the windows machine, ping the Linux machine like this:
Ping 192.168.100.3
And from the Linux machine, ping the Windows machine like this:
Ping 192.168.100.1
A failure to ping the other machine when you can ping yourself indicates
a problem with wiring, the hub, the other machine's configuration, or maybe
you're using the wrong IP address. Narrow it down.
Once you can ping each machine from the other, you're about 90% of the
way.
FTP
I haven't been able to FTP from my Linux machine to my Windows machine,
but that's not surprising. Windows security is a wierd beast, and I haven't
taken the time to research it.
But it's easy to FTP from my Windows machine to my Linux machine, with
the command
ftp 192.168.100.3
I can then put, get, create directories, and do whatever else needs to
be done. Note that for heavy duty file transfer activities, I'd highly
recommend WS_FTP from IpSwitch. It works GREAT between Windows and Linux.
Troubleshooting
Assuming the machines can ping each other, it's almost certainly a matter
of file permissions.
First, whoever you're logging in as, make sure you're trying to ftp
to and from your home directory, where you should have complete rights.
If you are, and there's still a problem, it might be a lack of access granted
from Linux. First, remember Server tasks->Exported file systems (NFS)->Path
to export = /? Make sure you've filled that out correctly. Just keep
narrowing it down.
Telnet
Use Win98's telnet. For better screen representatation of Linux apps, configure
telnet as a vt100, and make sure telnet's font is set to Terminal font,
non-bold, size 9. Log in as yourself, not as root. It won't let you log
in as root from a telnet session. If you want to log in as root, first
log in as yourself and then use the su command. You should be able to use
a telnet session pretty much as you'd work from the console, except your
keystrokes won't always be interpreted the way you want them to.
Troubleshooting
Assuming the machines can ping each other, it's almost certainly a matter
of file permissions.
First, whoever you're logging in as, make sure you're trying to telnet
to and from your home directory, where you should have complete rights.
If you are, and there's still a problem, it might be a lack of access granted
from Linux. First, remember Server tasks->Exported file systems (NFS)->Path
to export = /? Make sure you've filled that out correctly. Just keep
narrowing it down.
Get Apache Main Page Working
By Steve Litt
NOTE: Don't even attempt working with http until you can
ping both ways, and you can ftp and telnet from your Windows machine into
your Linux machine.
From your Win98 machine, get on your favorite browser and type http://192.168.100.3
If everything's configured properly, you should get a web page with
"It Worked!" emblazoned in big letters at the top. The title of the page
is "Test Page for Red Hat Linux's Apache Installation".
Troubleshooting
-
Make sure you can really ping, ftp and telnet to 192.168.100.3 from the
Win98 machine. If not, make it so you can.
-
Once ping, ftp and telnet work, but http://192.168.100.3 doesn't, verify
that the httpd service is running and runs at bootup. If not, fix it in
linuxconf. If you didn't install the necessary packages, install them now
or reinstall Linux (probably easier).
-
If ping, ftp and telnet work, but http://192.168.100.3 doesn't, and httpd
is running, check your Apache configuration. There's probably nothing wrong
with it unless you dinked with one or more of the files in /etc/httpd/conf.
If you did, put em back and see if you can hit http://192.168.100.3. If
not, time to read info, manuals, Apache documentation, and search the net
for ideas. Remember to just keep narrowing it down.
Install a Website
By Steve Litt
In this section we'll cover how to install a website to a given user. This
is how many ISP's do it with non-corporate accounts -- your website goes
in /home/yourname/public_html and is called with http://ispname.com/~yourname/.
As mentioned before, in these articles we'll use a first level domain name
of cxm instead of com, to prevent any possibility of a practice DNS getting
on the net.
For the examples in this article, I'll use username of myuid,
so it will go in /home/myuid/public_html, and will be accessible with http://192.168.100.3/~myuid/
(trailing slash required).
Viewing Your Changes: Restarting Apache, Dumping Your Browser's Cache,
Reloading your Browser
The command to stop and restart Apache, which must be done to see the effect
of a configuration change, is:
kill -HUP `cat /var/run/httpd.pid`
Note that the ` marks surrounding most of the command are backticks (`),
not quotes ('). I took that command and put it into a command called restart
in the /etc/httpd/conf directory, so while in that directory I can restart
Apache simply by typing ./restart (the dot and slash before restart
are manditory in Linux).
Horrible troubleshooting problems occur if, after each configuration
change, the following are not done:
-
Restart Apache.
-
Dump your browser's cache, both file and memory. Just for fun, do each,
then do each again. Better safe than sorry.
-
Press your browser's "reload from server" button.
Failure to take these three steps creates the dreaded "problem escapes
from the box" Troubleshooting dilemma, which you can read about on other
parts of Troubleshooters.Com. Suffice it to say this type of problem can
easily cost extra hours or days. Failure to dump cache while troubleshooting
a cgi problem on my Linux machine cost me 4 hours a few nights ago. Do
as I say...
Enabling .HTM
Apache comes configured from Red Hat Linux without recognizing .htm extensions
as web pages. Simply edit file /etc/mime.types (after backing it up, of
course). Find the line saying:
text/html html
and add "htm" after the "html and a space. In otherwords, when you're done,
it should look like this:
text/html html htm
Of course, then restar httpd, clear browser cache, and reload your browser.
Creating Your Site
Of course, you must have a login on the Linux machine, and a home directory.
Assuming you haven't changed any defaults, if your login name is myuid
(like in all the examples in these articles), your home directory would
be /home/myuid.
Create a tiny test webpage called index.htm on your Windows machine.
If you don't know how to do this, the October 1998 issue of Troubleshooting
Professional Magazine can help.
Once the tiny webpage is created, go into FTP on your Windows machine
(we recommend WS_FTP from IpSwitch), FTP to 192.168.100.3, navigate to
/home/myuid (or whatever your username is), and create directory public_html
below it. Then navigate into public_html in ftp, and text-transfer index.htm
into it.
If you've done everything correctly up to this point, you should be
able to open your browser on your Windows machine, hit http://192.168.100.3/~myuid/
(trailing slash essential), and see the web page. If not, troubleshoot.
Setting File and Directory Permissions
The user directory i.e. /home/myuid must be marked as executable to all,
or else you'll get the "forbidden" message. Likewise, all directories below
it containing html must be executable to all. All html files must be readable
by all.
Troubleshooting
Assuming you can hit http://192.168.100.3
(that's the Apache Main Page), make sure you've enabled Apache to recognize
.htm. Once .htm is recognized, if there's still a problem, try hitting
http://192.168.100.3/~myuid/ from the Netscape Navigator on your Linux
machine. I'm not exactly sure what it would prove if you could hit it from
itself but not the Windows machine, but it's an easy test. Make sure the
users home directory, and all directories below it containing html, are
marked as executable to all. They need not be readable to all, however.
Make sure all .htm and .html files are readable to all, but they need not
(and should not) be executable to anyone.
Other than that, read all error messages carefully, look for documentation,
and view configuration files til you're familiar with them. See the next
article.
Configuration files in /etc/httpd/conf
By Steve Litt
access.conf
From what I've seen, this one comes configured pretty much good to go,
except for the line
Options Indexes IncludesNOEXEC
That line prevents execution of CGI in any directory except the server's
default CGI directory, which is probably not what you want on an Intranet
where convenience isn't completely subordinate to security. The line can
be commented out with a pound sign (#) to enable CGI.
srm.conf
This file has quite a few interesting configuration options. Here are some
I found interesting:
DocumentRoot /home/httpd/html
|
Defines which directory contains the server's home page. For instance,
my server's home page, accessible via http://192.168.100.3, is contained
in /home/httpd/html |
UserDir public_html
|
Defines the name of the directory below a user's home directory which
contains the user's home page. For instance, /home/myuid/public_html contains
the home page for http://192.168.100.3/~myuid/ |
DefaultType text/plain
|
DefaultType is the default MIME type for documents which the server
cannot find the type of from filename extensions. In the example to
the left (as it comes from Red Hat), any unknown extension will be formatted
as text. |
AddLanguage en .en
LanguagePriority en fr de
|
These lines define the language for your website. I believe this refers
to the character formatting, but I'm really not sure. |
ScriptAlias /cgi-bin/ /home/httpd/cgi-bin/
|
Defines the server's default location for CGI scripts. For ultimate
security, this directory would contain all CGI scripts. However, this level
of security might cause users to shun your webserver. |
AddHandler cgi-script .cgi
|
Enables CGI scripts |
AddType text/html .shtml
AddHandler server-parsed .shtml
|
Enables server side includes |
#Alias /perl/ /home/httpsd/perl/
#<Location /perl>
#SetHandler perl-script
#PerlHandler Apache::Registry
#Options +ExecCGI
#</Location>
|
These are supposedly to enable PERL, but my CGI scripts worked perfectly
with them commented out (they come commented out from Red Hat). Furthermore,
uncommenting them caused non-connects and timeouts. My advice would be
to leave them alone unless you have a very specific use for them. |
httpd.conf
Configuration options for the "guts" of Apache, such as log file locations,
timeout parameters, caching, proxy server directives, and virtual hosts
(multiple IP's served, like a commercial ISP). I'd advise leaving all this
stuff as shipped, for now. We'll be editing this file when we incorporate
virtual hosting.
Steve Litt is president of American Troublebusters and Troubleshooters.Com,
and editor of Troubleshooting Professional Magazine. He can be reached
at Steve Litt's email address.
Enable CGI
By Steve Litt
As shipped from Red Hat, Apache is nowhere near CGI ready. Here's what
you do:
access.conf
Comment out this line:
Options Indexes IncludesNOEXEC
srm.conf
Make sure these lines are not commented out or missing:
ScriptAlias /cgi-bin/ /home/httpd/cgi-bin/
AddHandler cgi-script .cgi
File Permissions
All cgi files should be configured as follows:
chmod a+x myfile.cgi
All directories containing cgi must be configured as follows:
chmod a+x mydirectory
chmod a+r mydirectory
All files written to by cgi scripts must be configured as follows:
chmod a+w myfile.whatever
All directories containing files written to by cgi scripts must be configured
as follows:
chmod a+w mydirectory
If that last command sounds like too great a security risk, you can often
write to a file in a read-only directory IF the writable file already exists.
My experience has been the directory need be writable only if you need
to create files. Note, however, that if the file is deleted for any reason,
your CGI that writes it will crash.
Perl Path
Every CGI script has a special comment on the first line. This special
comment isn't a comment at all, but instead points to the Perl executable
so the interpreter will run. On every cgi script, this must be correct.
Here's an example:
#!/usr/local/bin/perl
Note that the #! simply tell the system that this is the path to the interpreter.
Be sure you do this before finishing your configuration. If you get a message
saying
Internal Server Error
The server encountered an internal error or misconfiguration and was unable
to complete your request.
Please contact the server administrator, root@localhost and inform
them of the time the error occurred, and anything you might have done that
may have caused the error. |
then you might want to check this out. Note that another alternative
is to copy Perl into the directory already expected by your CGI scripts.
This is the way you'd do it if you are creating a test jig server to simulate
your ISP.
Other Issues
Your html files must call the cgi with a directory specification, as in
./myfile.cgi
or
cgi-bin/myfile.cgi
but never just
myfile.cgi
Troubleshooting
It's just like troubleshooting CGI on your ISP --
-
first you do it from the command line using the PERL command
-
then you do it from the command line without the PERL command
-
then run it from the command line and pipe it into junk.html, which you
can then observe in a browser
-
and finally you do it from html.
Also remember these common causes of problems:
-
Make sure all directories containing html or cgi are executable to all.
-
Make sure all .cgi's are executable to all.
-
Make sure all files written to by .cgi's are write-enabled to all.
-
Make sure that any directory in which a .cgi creates a file is writeable
by all (this is one reason why so many ISP's won't let you put your .cgi
just anywhere).
In every case, you exploit the differences (and the main difference between
calls from html and the command line is the userid doing the call, with
file permission and pathing considerations). A valuable test is to have
httpd run under your username. Here's what you do:
-
back up /etc/httpd/conf/httpd.conf
-
edit /etc/httpd/conf/httpd.conf
-
Find these two lines:
-
For each of those lines, change nobody to your username. For me, that's
-
Restart httpd with the command: kill -HUP `cat /var/run/httpd.pid`
-
On your browser, clear cache, both memory and disk. Then do it again.
-
On your browser, reload the page which calls the CGI
-
On your browser, click the link or button calling the CGI. Note whether
it now works.
-
If it now works, exploit the differences between user/group nobody and
your own. Look at some of the following:
-
File permissions. Who is it executable by? user, group, other, combination
of these?. Note that when httpd is run as nobody, any cgi owned by the
user should be executable by user, group AND other.
-
Permissions of the directory
-
Either way, BE SURE to put User and Group back
to nobody after troubleshooting, to avoid a horrible security breach and
horrible future troubleshooting problems.
Apache documentation is available on your Linux machine and available from
a link at http://192.168.100.3 (assuming you're using the conventions in
this magazine). Perl info is available in your installed Perl's documentation,
as well as Perl information sites such as Litt's PERL's of Wisdom.
Make a Replica of Your ISP
By Steve Litt
CGI and WebApp programmers -- how would you like to have a replica of your
ISP or your customer's Unix web back end? A replica with the root password
for debugging. A 100mbit connection so fast that the entire Troubleshooters.Com
site takes two minutes and twenty seconds to FTP across. A replica you
can reboot or reconfigure at will? If you've worked through the exercises
in this Troubleshooting Professional, you're just about there. The remaining
tasks are these:
-
Give your ethernet device other IP#s to respond to.
-
Tell Apache the root directory of your website(s).
-
Copy PERL to the same place as on your ISP.
-
Set individual directory permissions (for other, not user) the same as
on your ISP.
These steps will give you an almost complete replica of your setup on your
ISP or customer's Unix back end, but at 100mbit speed and with better troubleshooting
opportunities. The one thing this setup will NOT be able to do is CGI involving
domain names. Setting up a DNS server is covered later in this Troubleshooting
Professional issue.
Give your ethernet device other IP#s to respond to.
Give yourself an entire block of IP addresses. In Linuxconf, do config->Networking->server
tasks->IP aliases for virtual hosts->eth0, and input the following:
192.168.100.100-149
That just gave your network the ability to respond to IP addresses 192.168.100.100
through 192.168.100.149. Next we'll let Apache know what to do when they
encounter those addresses.
WARNING
As of late 2002, some distros are configured with the ifcfg-eth0-range0 file
rather than the ifcfg-eth0:0 file. Further complicating it is that the very
existence of an ifcfg-eth0:0 file prevents enablement through the
ifcfg-eth0-range0 file. Even worse, at least in Mandrake Linux version
9.0, the linuxconf program that ships with Mandrake 9.0 writes the
ifcfg-eth0:0 file, breaking IP aliasing.
To learn about the new configuration method, see
http://www.troubleshooters.com/linux/ipalias.htm.
|
Tell Apache the root directory of your website(s).
Get into directory /etc/httpd/conf, and edit httpd.conf. Go down to the
following code (probably at the bottom).
# Any httpd.conf or srm.conf directive may go into a VirtualHost command.
# See also the BindAddress entry.
#<VirtualHost host.some_domain.com>
#ServerAdmin webmaster@host.some_domain.com
#DocumentRoot /www/docs/host.some_domain.com
#ServerName host.some_domain.com
#ErrorLog logs/host.some_domain.com-error_log
#TransferLog logs/host.some_domain.com-access_log
#</VirtualHost>
|
Below that code, insert the following code to enable your website. Note
that the example is from Troubleshooters.Cxm, but documentroot has
been changed for the protection of my ISP. However, for DocumentRoot, you'd
put the directory your ISP set aside for your website, and obviously you'd
use a first level domain name of com instead of cxm. This code will make
a copy of Troubleshooters.Com at the Linux machine's /web/sites/troubleshooters.cxm
directory show up at http://192.168.100.113.
#Troubleshooters.Cxm virtual host at 192.168.100.113
<VirtualHost 192.168.100.113>
DocumentRoot /web/sites/troubleshooters.cxm
ServerName www.troubleshooters.cxm
ErrorLog logs/troubleshooters.cxm-error_log
TransferLog logs/troubleshooters.cxm-access_log
</VirtualHost>
|
Remember to create the directory (/web/sites/troubleshooters.cxm), change
its owner to the owner.group in charge of the site (myuid.myuid), and set
all file and directory permissions necessary to run CGI scripts on this
new website. This site at http://192.168.100.113 will be a replica of your
ISP once you've completed the steps in this article.
Now, just for fun, add one more virtual host. Make this one nag.internal.cxm,
and make the document root /usr/doc/LDP/nag, which is the location of the
network administrator's guide. Now, by cruising to http://198.168.100.148/node1.html
you can see the The Network Administrators' Guide.
#Virtual Host for Network Admin Guide at 192.168.100.148: start at node1.html
<VirtualHost 192.168.100.148>
DocumentRoot /usr/doc/LDP/nag
ServerName nag.mydomain.cxm
ErrorLog logs/nag.mydomain.cxm-error_log
TransferLog logs/nag.mydomain.cxm-access_log
</VirtualHost>
|
Copy PERL to the same place as on your ISP.
Presumably you know where your ISP's Perl is -- that's how you configured
your CGI programs' !#/whatever/perl lines at the top of your CGI scripts.
If that directory doesn't exist on your Linux machine, create it.
Now find out where your Linux machine's Perl is with this command:
which perl
It will print the path to Perl on the screen. Now, copy Perl from its location
on your Linux machine to the location it exists on your ISP. Copy it, don't
move it. If you delete it out of the original directory, a lot of things
might break.
Once you have a copy of Perl in the same directory as on your ISP, all
your CGI (except that depending on things we haven't installed, like news,
email, and dns) should work perfectly.
Set individual directory permissions (for other, not user) the same as
on your ISP.
Telnet into your ISP, do ls -l commands everywhere, and find file permissions.
Chmod everything on the Linux machine so other (not user or group) have
the same permissions as on the ISP. For troubleshooting purposes, you'll
probably want to give user greater permissions. Remember that when a CGI
is invoked from the web, the user is httpd's default user, probably user
nobody, group nobody.
To reduce load times for the magazine as a whole, this article has been
moved to its own page.
Redo It
By Steve Litt
Much of our learning is from repetition. Musicians, no matter how good,
practice their scales and riffs. A good way to nail down what you've learned
going through the articles in this magazine is to do it again. Not only
that, but doing it again is an excellent way to prepare for a job interview
or troubleshooting assignment with a Linux or Unix system.
I went through the whole thing, minus the dual-boot parts, in two hours
and forty minutes. Mileage may vary, but I think it's likely you'll complete
it in under four. Below is the timeline for my repeat installation:
-
0:00: Booted into install
-
0:02: Began swap partition format, checking for bad blocks.
-
0:03: Began / and /boot formats, checking bad blocks.
-
0:26: Formats finished, began remainder of install
-
0:31: Made user myuid
-
0:31-0:35: Made and ran hello.cpp and hello.pl
-
0:35-0:38: Ran X, ran Netscape Navigator on the linux machine, accessed
http://192.168.100.3 and http://linuxhost.mydomain.cxm.
-
0:39-0:45: Ran nslookup on the linux machine, telnet with su from
the win machine, ping on both machines to make sure everything OK
-
0:46: Verified that Netscape on the Win machine can hit http://192.168.100.3,
getting the Apache test page.
-
0:47: Fixed /etc/mime.types to enable .htm
-
0:49-0:54 Configured a WS_FTP for user myuid on 192.168.100.3, created
/home/myuid/public_html, and ftp'ed a site to that directory.
-
0:54-1:04: Troubleshot a problem of not being able to pull up my http://192.168.100.3/~myuid/
site to the fact that I had accidentally looked for http://192.168.100.3/~slitt/.
Nobody's perfect :-)
-
1:00-1:18: Edited access.conf, srm.conf, set file permissions, troubleshot
a "Internal Server Error" down to an accidental binary FTP putting junk
chars in the cgi script. Fixed the problem with a re-FTP in ascii mode.
-
1:18 - 1:19: Took a break.
-
1:19-1:27: linuxconf->config->Networking->server tasks->IP aliases for
virtual hosts->eth0, put in IP's 192.168.100.100-149, edited /etc/httpd/conf/httpd.conf
to includes virtual hosts troubleshooters.cxm at 192.168.100.113, nag.cxm
at 192.168.100.148
-
1:27-1:30: Created directory /web/sites/troubleshooters.cxm, set proper
permissions.
-
1:30: Began FTPing sites Troubleshooters.cxm, problemsolving.cxm and stevelitt.cxm
to document root /web/sites/troubleshooters.cxm. Note that a domain switcher
will pull up the proper site, depending on domain name.
-
1:40-1:45: Troubleshot inability to pull up http://192.168.100.113 to forgetting
to uncomment </virtualhost> in httpd.conf.
-
1:45-1:50: Fixed file permissions, etc, to enable CGI.
-
1:50-1:55: Fixed some earlier goofs I noticed after the fact.
-
1:55-2:10: Setting up DNS Hello World A. Tested. Troubleshot non-authoritative
nslookup down to lack of a period and using SQA instead of SOA.
-
2:10-2:30: Set up and troubleshot DNS Hello World B. Fixed problems caused
by typos and omissions.
-
2:30-2:40: Set up, tested and troubleshot DNS Hello World C: Fixed minor
problems.
|
Steve Litt offers courses on the Universal
Troubleshooting Process. He can be reached at Steve Litt's email address.
To reduce load times for the magazine as a whole, this article has been
moved to its own page.
Looking Forward
By Steve Litt
This issue of Troubleshooting Professional is long enough -- any more and
it would load too slowly. But if I were going to cover additional material,
here are some that I'd cover:
-
Email Server
-
Be your own webspace provider
-
Supercomputing
-
Linux to Linux networking
I'll cover these either in a book, or maybe in a future Troubleshooting
Professional (but the next 2 months are already spoken for).
Wrapup
By Steve Litt
We're done. Give yourself a big hand. You've installed Linux, both command
line and X. Written a couple programs, busted back into a locked up system
with boot/rescue floppies you made after the fact. You've dual-booted with
Win98, used Win98 as a diagnostic tool to install Linux, networked your
Linux machine, set it up as a webserver with virtual domains, full CGI
and DNS. You made it a replica of your ISP or customer. And if you did
the full tutorial, you created a data-enabled web app. You're now at home
with simple Linux admin tasks, and conversant in all the terminology. You'll
feel reasonably confident walking into a Linux or even Unix trouble call.
Do you think this might look pretty good on your resume?
You bet it does. Unix ISP's are popping up all over. Believe the trades
that NT is replacing Unix? Big ISPs like reliable systems, so many are
choosing Unix. For example, take Winfiles.Com, the ultimate Microsoft cheerleader.
Here's a quote from their FAQ page: "We use Pentium Pro computers running
the BSDI UNIX operating system with Apache Web server software.".
And of course, some of the tiny ISP's use Linux. Linux is being used
to build ultra-cheap supercomputers. And small business -- a Linux Intranet
can be built for a song (I bet you could reproduce the exercises in this
magazine (excluding the database web app) in 4 hours or less now), on equipment
the Microsoft world considers "obsolete".
But of course, Linux doesn't make you more valuable to everyone. Consider
the wing-tipped corporate manager obsessed with the trades' and advertisers'
reporting of "enterprise computing". He's read the trades, talked to his
wing-tip buddies, and made his decision -- his enterprise is straight Microsoft.
Here's how to work with him:
Nod gravely in agreement with his assertion that Linux is a toy and
always will be. Say "absolutely" when he tells you he chose Microsoft because
he can't afford the geniuses who work with Linux. Try not to laugh when,
right after his last statement, he bemoans the high price he needs to pay
for good talent. Resist the temptation to point out that of course it's
hard to get good people in a technology that costs $2000.00 hardware, $6000.00
software, and $5000.00 training just to get into the game. Refrain from
mentioning that super innovators Wosniak/Jobs (Apple), Kahn (Borland),
Andreeson (Netscape), and, why yes, Gates/Allen (Microsoft) did their big
innovations not on expensive big iron, but on whatever they could beg,
borrow or steal.
And above all, if you don't want to see him cry, don't tell him you
set up an Intranet with virtual hosting, DNS and full CGI (which can interface
to Oracle or Sybase or free PostgreSQL), in four hours on a $600 computer.
After all, he's had a crew of 8 working on that for three months.
He's the first to tell you he can't get fired for buying Microsoft.
You can bet if he was old enough to work fifteen years ago, he said the
same thing about IBM. And if he's lucky enough to continue his career fifteen
years more, he'll be saying the same thing about Linux.
Only by then, your salary will be triple his.
Steve Litt is president of American Troublebusters and Troubleshooters.Com,
and editor of Troubleshooting Professional Magazine. He teaches the Universal
Troubleshooting Process, and is also an application developer and technical
writer. He can be reached at Steve Litt's email address.
Letters to the Editor
All letters become the property of the publisher (Steve Litt), and may
be edited for clarity or brevity. We especially welcome additions, clarifications,
corrections or flames from vendors whose products have been reviewed in
this magazine. We reserve the right to not publish letters we deem
in bad taste (bad language, obscenity, hate, lewd, violence, etc.).
Submit letters to the editor to Steve Litt's email address, and be sure
the subject reads "Letter to the Editor". We regret that we cannot return
your letter, so please make a copy of it for future reference.
How to Submit an Article -- NOTE BETTER POLICY
We anticipate two to five articles per issue, with issues coming out monthly.
We look for articles that pertain to the Troubleshooting Process, or articles
on tools, equipment or systems with a Troubleshooting slant. This can be
done as an essay, with humor, with a case study, or some other literary
device. A Troubleshooting poem would be nice. Submissions may mention a
specific product, but must be useful without the purchase of that product.
Content must greatly overpower advertising. Submissions should be between
250 and 2000 words long.
By submitting content, you give Troubleshooters.Com the non-exclusive,
perpetual right to publish it on Troubleshooters.Com or any A3B3
website. Other than that, you retain the copyright and sole right
to sell or give it away elsewhere. Troubleshooters.Com will acknowledge
you as the author and, if you request, will display your copyright notice
and/or a "reprinted by permission of author" notice. Obviously, you must
be the copyright holder and must be legally able to grant us this perpetual
right. We do not currently pay for articles.
Troubleshooters.Com reserves the right to edit any submission for clarity
or brevity. Any published article will include a two sentence description
of the author, a hypertext link to his or her email, and a phone number
if desired. Upon request, we will include a hypertext link, at the end
of the magazine issue, to the author's website, providing that website
meets the Troubleshooters.Com criteria for links
and that the author's website first links to Troubleshooters.Com. Authors:
please understand we can't place hyperlinks inside articles. If we did,
only the first article would be read, and we can't place every article
first.
Submissions should be emailed to
@troubleshooters.com, with subject line Article Submission. The first
paragraph of your message should read as follows (unless other arrangements
are previously made in writing):
I (your name), am submitting this article for possible publication in Troubleshooters.Com.
I understand that by submitting this article I am giving the publisher,
Steve Litt, perpetual license to publish this article on Troubleshooters.Com
or any other A3B3 website. Other than the preceding sentence, I understand
that I retain the copyright and full, complete and exclusive right to sell
or give away this article. I acknowledge that Steve Litt reserves the right
to edit my submission for clarity or brevity. I certify that I wrote this
submission and no part of it is owned by, written by or copyrighted by
others.
After that paragraph, write the title, text of the article, and a two sentence
description of the author.
URLs Mentioned in this Issue
-
Guest Authors and Information Sources
_