Archive for August, 2007

106Part I:Getting Your Feet Wet If you ve been (Web hosting companies)

Thursday, August 9th, 2007

106Part I:Getting Your Feet Wet If you ve been using computers for many years, you may also be familiar with the command-line interface, which usually consists of a black screenwith white text. The initial release and early development of Linux was allcommand-line-oriented; GUIs then grew as the icing on the Linux cake, making it a lot more colorful to use and easier for people who would rather point and click than type. In choosing between the command-line and the GUI, you need to consider anumber of factors. For a lot of people, this decision is pretty much a no-brainerissue. They have no intention of leaving GUIs behind. That s fine, but at thevery least, you may want to become familiar with what s under the hood. Someday, your GUI might break and leave you at the ever-dreaded login prompt! Deciding Which Interface to UseOne important factor when choosing between the command-line interfaceand a GUI is speed. Keep in mind that if you re a programmer who needs tocompile programs or a scientist who needs to run software that does heavynumber crunching, the GUI slows down your system. You also need to typi- cally shut off the GUI when using Linux as a server, because it s mostly awaste of RAM and processing speed more often than not, a server justdoes its thing with no one sitting there watching over it. Readability can also be a big issue when choosing between the GUI and the command prompt. If you have a hard time reading text in those smallcommand-prompt windows from within the GUI (Chapters 14 and 20 covervarious ways to switch around), you can either make the windows and thefont bigger, or work directly with the command prompt outside of the GUI. However, on a desktop that you want to use for word-processing or editingimages, you ll want a point-and-click environment. This setup is the type Ifocus on, but I don t leave you without any clue about the command-line, just in case! You also can choose from two major GUI versions: GNOME and KDE. Somepeople prefer one, and some the other, and I m not here to tell you which touse. If you stuck with the defaults for your distribution, then you re using Fedora:GNOME Knoppix:KDE Linspire:KDE Mandrake:KDE SuSE:KDE Xandros:KDE10_

Chapter 6Checking Out Those DesktopsIn This Chapter Finding (Web design)

Thursday, August 9th, 2007

Chapter 6Checking Out Those DesktopsIn This Chapter Finding your way around Fedora Kicking around Knoppix Looking around Linspire Messing around with Mandrake Seeing what s what with SuSE Xightseeing around Xandros A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a workstation. . . . Steven WrightAlot of people like to characterize Linux as a DOS-like environment, where all you can do is operate in this antique-feeling world where youhave to type a lot of cryptic stuff and can t see any pretty pictures. However, the Linux desktop offers you quite a nice working environment, as you seethroughout this chapter. The cool thing is that most of it is configurable. Those who like to customize their systems can have way too much funchanging things around. Introducing the InterfacesLinux has two interface types: the command-line interfaceand the graphicaluser interface(GUI). If you use other computer systems, such as Windows orthe Macintosh, you re already familiar with a GUI. Most Linux distributionsinclude different versions of the GUI (which takes up the majority of thischapter), which you can heavily customize.

104Part I:Getting Your Feet Wet (Web site design)

Wednesday, August 8th, 2007

104Part I:Getting Your Feet Wet

If you re plagued (Apache web server for windows) with brief power outages or

Tuesday, August 7th, 2007

If you re plagued with brief power outages or spikes that cause your com- puter to reboot, look into getting a UPS (Uninterruptable Power Supply) foryour computer. These heavy recharging batteries can not only protect yourcomputer from damage read the box to see what features a particular UPSoffers but can also provide an extra five minutes or more of power to giveyou a chance to properly close your files and shut down a machine when thepower goes out. Better yet, for those really brief spikes, the only inconven- ience you ll have to deal with if you have a UPS in place is listening to it com- plain with beeps. Your computer won t be affected by the spike at all! Removing Linux from Your SystemAlthough I d hate to see you go, I d also hate to see you get trapped in Linuxif you don t want to use it! How to most easily get rid of Linux depends onwhat you want to do: If you want to replace Linux with Windows, just install Windows on themachine. It will overwrite all of Linux, including the boot menu. If you want to remove Linux from a dual boot setup, then boot into yourWindows option, access a command prompt, and type fdisk /mbr. Thisaction removes the Linux boot loader. It doesn t erase Linux, but youcan then format the Linux drive(s) or partition(s) for Windows. Windows XP and Xandros users have a special command they can use toremove this distribution. Boot your machine using your XP CD-ROM into theRecovery Console. Change to the Windows directory and then type fixmbr. 103Chapter 5: Booting and Stopping Linux09_

Don t Just Turn Off the Machine! Even (Com web hosting) when

Tuesday, August 7th, 2007

Don t Just Turn Off the Machine! Even when you re not tapping the keyboard or clicking buttons, Linux is stillrunning along in the background and doing lots of housekeeping chores. Some of these chores may involve swapping cached datato and from thefixed disk a geeky way of saying that it s actually jotting down things ontoyour hard drive that before it had just been making sure to remember inRAM. When you shut off the power out of the blue, anything the computerwas remembering but hadn t written is lost, kind of like when you or I fallasleep before making a to-do list for the next day. If you re used to Windows 98, you need to recondition yourself from justshutting off the power when you re finished. For one thing, many Linux usersleave their computers on when they re not using them; they just log out oftheir accounts so that no one can mess with their stuff and shut off the moni- tor because monitors draw a lot of power. When you do decide to turn offyour Linux machine, for whatever reason, you must shut down the computerin an orderly manner. You can use one of these methods to shut down Linux properly: If you re in the GUI, log out of your account using the main menu s LogOut option and then click the display manager option that says, strangely enough, Shut Down. If you have a command prompt open, enter the haltcommand at theshell prompt (#) followed by the root password, and Linux shuts itselfdown and tells you when it s all right to turn off the machine. If you have a command prompt open, enter the rebootcommand, andLinux goes through the motions of shutting itself down and then immedi- ately reboots the machine. If you have a command prompt open, entering shutdown -f nowis themost traditionally accepted method. The shutdowncommand optionallyallows you to send messages to logged-in users and determine how longuntil the shutdown takes place. Another method is the poweroff com- mand, which is just an alias to the previously mentioned haltcommand. If you do accidentally cut the power to your Linux box, take heart; all is notlost. More often than not, you can reboot your computer and pick up whereyou left off. However, you may have to pay for your error by waiting during aquick file system check while the machine makes sure that nothing was dam- aged. This process is similar to the one in Windows, where, if you power offincorrectly, the operating system may need to scan its hard drives to makesure that everything is okay. 102Part I:Getting Your Feet Wet

SuSE:The DVD, or the first installation (Web hosting company) CD, contains

Friday, August 3rd, 2007

SuSE:The DVD, or the first installation CD, contains a Rescue Systemmenu option. Use your arrow keys to highlight this option and pressEnter. Xandros:The CD contains a rescue mode. When the installer starts, press the Shift key. This action opens a list of menu options. Use thearrow keys to select Rescue Console, and press Enter. To enter rescue mode in Fedora Core, place the DVD or your first CD intoyour DVD-ROM or CD-ROM drive and boot the machine. Then follow thesesteps: 1.When the disk first loads, type linux rescueat the bootprompt. This action begins booting the system into maintenance mode. 2.Select your language and press Enter. 3.Select your keyboard type and press Enter. The rescue system does its thing for a while, perhaps a minute or two ona slow system. 4.When asked whether you want to start the network interfaces, answerNo unless you know you need to download something. 5.At the Rescue screen, select one of the three options offered and thenpress Enter. Your three options are Continue: The rescue interface tracks down your installed FedoraCore system for you. If you select this option (or the next) and it fails, you may need toreboot and restart the rescue system. After restarting, choose Skip. Read-Only: The same as Continue, but you aren t able to make anychanges to your hard drive installation. Skip: Don t bother trying to locate the filesystem, just give me aprompt! I assume that you chose Continue. If so, a shell prompt(the rescue command-line interface) appears, and you now have access to therescue interface. 6.If the rescue process was able to load your Fedora installation, typechroot/mnt/sysimageto be able to use your system without havingto type /mnt/sysimagein front of everything. 101Chapter 5: Booting and Stopping Linux09_

The main problems you may encounter with initare (Fedora web server)

Friday, August 3rd, 2007

The main problems you may encounter with initare services(programs that run in the background) that fail to start properly, as is indicated by the[FAILED]status shown during the boot process. Many of these services don tkeep you from logging in and using your system. Services usually fail becauseof misconfigurations or unsupported hardware drivers. Sometimes a problemservice takes a long time to start up, so you may need some patience while youwait it out. Once the machine boots up, you can use the techniques describedin Chapter 12 to shut off the problem service if it s being a pain. If the machinecan t boot because of this service, you ll need to access your distribution srescue mode to shut off the service. Rescue mode is covered in the next sec- tion. Entering Rescue ModeHeavy-duty system repair tends to happen in rescuemode, which is a special boot selection that simulates your hard disk in whatis called a RAM disk,holding the files entirely in memory. The benefit of thisdisk is that you can perform necessary system surgery without requiring util- ities that are part of the installed system; everything you need is part of therescue disk. The drawback is that this is a purely command-line interface, and you really have to know your stuff to find your way around. Appendix A contains a list of Linux commands, roadmap to try to help youout. Chapter 20 addresses, among other things, how to fix your boot loadersfrom here if your problem is with the boot loader, and how to track down theerror messages your kernel might have left behind. You may also be able tofind helpful tips by reviewing your distribution s documentation and helpforums. Knoppix is quite popular to use for system rescues because it s a whole dis- tribution on a CD. (For more on Knoppix and live CDs, see Chapter 2.) SeeChapter 20 for more on using Knoppix for things like rescuing broken Linux(and even Windows) systems. Just about every Linux distribution includes a rescue mode. Due to spacerestrictions, I have room to cover entering only Fedora s rescue mode in step- by-step detail, but at the very least, here s a quick reference to how to findthe rescue mode in the distributions covered in this book: Linspire:The CD contains a rescue mode. When the installer starts, useyour arrow keys to select Diagnostics and then press Enter. Fedora:The DVD, or the first installation CD, contains a rescue modethat you can enter by typing linux rescueat the installer s bootprompt. Mandrake:The first CD contains a rescue mode. When the installerstarts, press F1 to access the command prompt, type rescue, and pressEnter. 100Part I:Getting Your Feet Wet

Web hosting solutions - This list shows some symptoms of a missing,

Thursday, August 2nd, 2007

This list shows some symptoms of a missing, incorrect, or corrupt systemkernel all would occur after you either make your menu selection andpress Enter, or just let the boot loader do its thing automatically withoutchoosing anything: The system freezes. A few dots appear across the top of the monitor, and then the systemfreezes. A few messages appear on the screen, and the final message readskernel panic. The system reboots automatically. You know when the kernel is loading because you start to see crazy text like: Uncompressing Linux… Ok, booting the kernel. audit(1092566112,337:0): initializedRecovering from a kernel loading failure (aside from operating system notfound see previous section) is one of the more challenging issues in Linux. This task is unfortunately not for the faint of heart. On the other hand, thefailed kernel may be an updated one. If you have more than one Linux optionin your boot menu, look at the version numbers for each of the options andchoose the second newest. Doing so lets you boot into the last working kerneland have a working system. Then you can open up www.google.comandsearch on the error messages or wait until the next kernel update comes outand ignore the bad one for now. In the case where it s your original install that doesn t properly start, youunfortunately don t have a fallback kernel option. If this is your problem, Irecommend either contacting your distribution s support address (if you pur- chased a commercial product) or joining the installation or beginner s helpdiscussion list if you downloaded a free product. See Chapter 2 to find outwhere to locate help for each distribution discussed in this book. Step 4: Control is handed over to initOnce the kernel s finished loading, it passes off the system initializationprocess to a program named init. The initprogram is responsible for start- ing all services and programs. You can see these processes starting as theyscroll up the screen with [OK]or [FAILED]on the right side of the monitor. Ifyou see these lines, you know that your kernel has finished loading. 99Chapter 5: Booting and Stopping Linux09_

Sometimes bad things can happen to your boot (Free php web host)

Thursday, August 2nd, 2007

Sometimes bad things can happen to your boot loader. One common symp- tom of boot loader problems is a message saying that the operating systemcould not be found. Another hint that the problem is your boot loader is if younever see your boot menu,which is a screen that comes up during the bootprocess that lets you choose what operating system and version to boot. The boot menu will look different from distribution to distribution. If you suspect a boot loader problem, see the section Entering RescueMode, later in this chapter. For another option, see the sidebar CustomBoot Disks. Step 3: The boot loader (GRUB or LILO) loads the system kernel into memoryEvery computer (and electronic device) requires an operating system to run. The technical term for this operating system, or at least the core of it, is thekernel.If the kernel is your maestro, orchestrating all the components of yourcomputer and delegating resources in a logical and cooperative manner, theboot loader is the red carpet on which the maestro arrives. Many Linux distributions today actually put up a GUI progress screen duringthe kernel loading and system initializationphase (after the kernel finishesloading, when it finishes up the boot process). If you want to see what hap- pens, you can typically click an icon or press a key. Just look for instructionson how to see details. 98Part I:Getting Your Feet Wet Custom boot disksYou can protect against boot loader failures afteryou get your installation working by making acustom boot floppy disk, which you can use toboot the system if the boot loader on your harddrive gets corrupted. Many distributions havespecial programs or tools available to makecustom boot disks for you, and some will offer tomake the disks during installation. The programsto make a disk manually are mkbootdisk forFedora Core and Mandrake, drakfloppy forMandrake as well, yast for SuSE, and build-boot- floppy for Xandros. However, a custom boot diskwon t help you if something goes wrong with thelater boot steps. It s only good for boot loaderproblems. After you manage to boot with thefloppy, open a terminal window (see Chapter 14), type su -to become the root (administrative) user, and then double-check which boot loaderyour distribution uses. For LILO, type lilo -vto try to repair your boot loader on your harddrive. For GRUB, look in the file /boot/grub/ menu.lstand look for a line in the beginningwith the text boot= for example, it may sayboot=/dev/hde. Then, type grub-installbootdrive, where bootdrive is the hard drivelisted in the boot line, such as grub-install/dev/hde. Now you can try rebooting withoutthe floppy in the floppy drive.

Disney web site - was running properly before you began your Linux

Thursday, August 2nd, 2007

was running properly before you began your Linux installation, your com- puter should be getting through the POST just fine POST problems don ttend to be caused by installing a new operating system; they re far more fun- damental to the computer itself. For all but the last of these errors, it s time to question your nephew Mortimer, who was last seen lurking around your computer with a screwdriver. (Or takeyour computer into a computer repair shop!) If you see an error message indi- cating a hardware failure, you might have a shot of fixing the problem in theBIOS. As the POST does its thing and finishes up, it briefly displays (usually atthe bottom of the screen) instructions on how to enter setup. Typically, theseinstructions mention pressing the DEL key or a function key such as F1. Whenyou press this key, if all goes well, you usually see a blue screen with black andwhite text. From here, if you re familiar with your hardware, you can try tofigure out and fix the problem. However, many people would rather have a rootcanal with no anesthesia than mess with this stuff, so you may want to grab thenearest teenager or computer repair shop to take a look. The good news is that if you can get to the BIOS at all, the problem may beeasier to fix than one where the computer fails before you reach the BIOS. Step 2: The BIOS passes the baton to the boot loaderAfter the BIOS gives the okey-dokey with a successful POST, the BIOS locatesthe first hard drive in your system and reads the first sectorof that disk, whichis often referred to as the MBR (Master Boot Record). On that first chunk ofdisk is a small program called a boot loader.The boot loader doesn t knowmuch about anything, except how to start loading your operating system. Two boot loader programs understand how to load a Linux operating system: LILO (LInux LOader) and GRUB (GRand Unified Boot loader). LILO has been atried-and-true boot loader for as long as Linux has been a gleam in a geek seyeball. GRUB is a newer and much more sophisticated boot loader programthan LILO. Many distributions allow you to choose your boot loader. Typically, most people just stick with the defaults, which are as follows for the five dis- tributions discussed in this book: DistributionDefault Boot LoaderFedora CoreGRUBLinspireLILO, with its own special routines on top of it. MandrakeLILOSuSEGRUBXandrosLILO, with its own special routines on top97Chapter 5: Booting and Stopping Linux09_