Archive for November, 2007

252Part IIIChoosing and Installing a Linux DistributionDefragmenting your (Web site counters)

Friday, November 30th, 2007

252Part IIIChoosing and Installing a Linux DistributionDefragmenting your disk can be a fairly long process. The result of defragmenta- tion is that all the data on your disk are contiguous, creating a lot of contiguousfree space at the end of the partition. There are cases where you will have todo the following special tasks to make this true: If the Windows swap file is not moved during defragmentation, you mustremove it. Then, after you defragment your disk again and resize it, youwill need to restore the swap file. To remove the swap file, open theControl Panel, open the System icon, and then click the Performance taband select Virtual Memory. To disable the swap file, click Disable VirtualMemory. If your DOS partition has hidden files that are on the space you are try- ing to free up, you need to find them. In some cases, you won t be able todelete them. In other cases, such as swap files created by a program, youcan safely delete those files. This is a bit tricky because some files shouldnot be deleted, such as DOS system files. You can use the attrib -s -hcommand from the root directory to deal with hidden files. Once your disk is defragmented, you can use commercial tools described earlier(Partition Magic or Acronis Disk Director) to repartition your hard disk to makespace for Linux. An open source alternative to those tools is QTParted. Boot KNOPPIX or any of several other bootable Linux distributions (particularlyrescue CDs) and run QTParted by selecting System Tools.QTParted from thedesktop main menu. From the QTParted window, select the hard disk you want toresize. Then choose Options.Configuration to open a window where you canselect the ntfsresize tool to resize your NTFS partition. After you have cleared enough disk space to install Linux (see disk space require- ments earlier in this chapter), you can choose your Linux distribution and install it. As you set up your boot loader during installation, you will be able to identify theWindows, Linux, and any other bootable partitions so that you can select whichone to boot when your start your computer. Using Installation Boot OptionsSometimes a Linux installation will fail because the computer has some nonfunc- tioning or nonsupported hardware. Sometimes you can get around those issues bypassing options to the install process when it boots up. Those options can do suchthings as disable selected hardware (nousb, noscsi, noide, and so on) or not probehardware when you need to select your own driver (noprobe). Although some of these options are distribution-specific, others are simply optionsthat can be passed to an installer environment that works from a Linux kernel. Chapter 11 includes a list of many boot options that can be used with KNOPPIXandother Linux systems.

251Chapter 7Installing LinuxInstalling Linux from scratch goes faster (Business web hosting)

Thursday, November 29th, 2007

251Chapter 7Installing LinuxInstalling Linux from scratch goes faster than an upgrade. It also results in acleaner Linux system. So if you have the choice of backing up your data or justerasing it if you don t need it, a fresh install is usually best. Some Linux distributions, most notably Gentoo, have taken the approach of ongoingupdates. Instead of taking a new release every few months, you simply continuouslygrab updated packages as they become available and install them on your system. Dual Booting with Windows or Just LinuxIt is possible to have multiple, bootable operating systems on the same computer(using multiple partitions on a hard disk and/or multiple hard disks). Setting up toboot more than one operating system, however, requires some thought. It alsoassumes some risks. While tools for resizing Windows partitions and setting up multiboot systems haveimproved in recent years, there is still considerable risk of losing data on Windows/ Linux dual-boot systems. Different operating systems often have different views ofpartition tables and master boot records that can cause your machine to becomeunbootable (at least temporarily) or lose data permanently. Always back up yourdata before you try to resize a Windows (NTFS or FAT) file system to make spacefor Linux. If you have a choice, install Linux on a machine of its own or at least ona separate hard disk. If the computer you are using already has a Windows system on it, it s likely thatthat the entire hard disk is devoted to Windows. While you can run a bootableLinux such as KNOPPIX or Damn Small Linux without touching the hard disk, to doa more permanent installation you ll want to find disk space outside the Windowsinstallation. There are a few ways to do this: .Add a hard disk Instead of messing with your Windows partition, you cansimply add a hard disk and devote it to Linux. .Resize your Windows partition If you have available space on yourWindows partition, you can shrink that partition so there is available freespace on the disk to devote to Linux. Commercial tools such as PartitionMagic (www.semantec.com/partitionmagic) or Acronis Disk Director(www.acronis.com) are available to resize your disk partitions and set upaworkable boot manager. Some Linux distributions (particularly bootableLinuxes used as rescue CDs) include a tool called QTParted that is an opensource clone of Partition Magic (which includes software from the Linux-NTFSproject for resizing Windows NTFS partitions). Before you try to resize your Windows partition, you might need to defragmentit. To defragmentyour disk on some Windows systems, so that all your usedspace is put in order on the disk, open My Computer, right-click your hard diskicon (typically C:), select Properties, click Tools, and select Defragment Now. CautionTip14_

250Part IIIChoosing and (Web server extensions) Installing a Linux Distribution .DVD

Thursday, November 29th, 2007

250Part IIIChoosing and Installing a Linux Distribution .DVD or CDdrive You need to be able to boot up the installation processfrom a DVD or CD. If you can t boot from a DVD or CD, there are ways to startthe installation from a hard disk or using a PXE install. Some distributions, such as Slackware or Fedora (prior to Fedora Core 2), let you use floppy disksto boot installation. Once the install is booted, the software can sometimes beretrieved from different locations (over the network or from hard disk, forexample). .Network card If you are doing an install of one of the distributions for whichwe provide a scaled-down boot disk, you might need to have an Ethernet cardinstalled to get the software you need over the network. A dial-up connectionwon t work for network installs. You don t necessarily have to be connected tothe Internet to do a network install. Some people will download the necessarysoftware packages to a computer on their LAN and then use that as an installserver. If you re not sure about your computer hardware, there are a few ways to checkwhat you have. If you are running Windows, the System Properties window canshow you the processor you have, as well as the amount of RAM that s installed. Asan alternative, you can boot KNOPPIX and let it detect and report to you thehardware you have. (Run lspci, lsmod, and dmsegcommands in Linux to viewinformation about your computer hardware.) Upgrading or Installing from ScratchIf you already have a version of the Linux you are installing on your computer, manyLinux distributions offer an upgrade option. This lets you upgrade all packages, forexample, from version 1 of the distribution to version 2. Here are a few generalrules before performing an upgrade: .Back up data There is a possibility that after you finish your upgrade, theoperating system won t boot. It s always a good idea to back up any criticaldata and configuration files (in /etc) before doing any major changes to youroperating system. .Remove extra packages If there are software packages you don t need, remove them before you do an upgrade. Upgrade processes typically upgradeonly those packages that are on your system. Upgrades generally do morechecking and comparing than clean installs do, so any package you canremove saves time during the install. .Check configuration files A Linux upgrade procedure often leaves copies ofold configuration files. You should check that the new configuration files stillwork for you.

249Chapter 7Installing LinuxWith your Linux distribution in hand (Top ten web hosting)

Wednesday, November 28th, 2007

249Chapter 7Installing LinuxWith your Linux distribution in hand (either the DVD or Cd with this book or the setof CDs you got elsewhere), proceed to Appendix A for details on burning your ownCDs or DVDs. After that, instructions for installing the distributions from the DVDcan be found in separate chapters for each distribution (Chapters 8 through 18). Before you proceed, however, there s some information that is useful for nearlyevery Linux system you are installing. Exploring Common Installation TopicsBefore you begin installing your Linux distribution of choice, there is some generalLinux information you should understand. Reading over this information might helpyou avoid problems or keep you from getting stuck when you install Linux. Knowing Your Computer HardwareEvery Linux will not run on every computer. When installing Linux, most people usea Pentium-class PC. There are Linux systems that are compiled to run on other hard- ware, such as Mac PowerPCs or AMD 64-bit computers. However, the distributionsprovided with this book run on only 32-bit Pentium-class PCs. Minimum hardware requirements from the Fedora Project are pretty good guide- lines for most Linux systems: .Processor The latest version of Fedora Core recommends that you atleasthave a Pentium-class processor. For a text-only installation, a 200 MHzPentium is the minimum, while a 400MHz Pentium II is the minimum for a GUIinstallation. If you have a 486 machine (at least 100 MHz), consider trying Slackware. The prob- lem is that many machines that old have only floppy disks, so you can t use the CDor DVD that come with this book. In that case, you can try ZipSlack (www.slackware.com/zipslack), which is a Slackware version that comes on about 30+ floppy disk images or a 100MB zip disk and can run on a 486 with at least 100MB ofdisk space. .RAM You should have at least 64MB of RAM to install most Linux distribu- tions and run it in text mode. Slackware might run on 8MB of RAM, but 16MBis considered the minimum. If you are running in graphical mode, you willprobably need at least 192MB. The recommended RAM for graphical mode inFedora is 256MB. A GNOME environment generally requires a bit less memoryto run than a KDE environment. If you are using a more streamlined graphicalsystem (that runs X with a small window manager, such as Blackbox), youmight get by with as little as 32MB. In that case, you might try Damn SmallLinux or Slackware. Note14_

Free web space - 248Part IIIChoosing and Installing a Linux DistributionThere is

Tuesday, November 27th, 2007

248Part IIIChoosing and Installing a Linux DistributionThere is also a facility called BitTorrent (http://bitconjurer.org/BitTorrent) you might want to look into. BitTorrent lets you download a file to your computer bygrabbing bits of that file from multiple computers on the network that are download- ing the file at the same time. For the privilege, you also use your upload capacity toshare the same file with others as you are downloading. During times of heavydemand with a new Linux distribution, BitTorrent can be the best way to go. If you are on a dial-up modem, you should strongly consider purchasing Linux CDs(or getting them from a friend) if the DVD or CD with this book doesn t have what youwant. You might be able to download a whole 700MB CD in a couple hours on a fastDSL or cable modem connection. On a dial-up line, you might be talking a whole dayor more per CD. For a large, multi-CD distribution, available disk space can alsobecome a problem (although, with today s large hard disks, it s not as much of aproblem as it used to be). Burning the Distribution to CDWith the CD images copied to your computer, you can proceed to verify their con- tents and burn them to CD. All you really need is a CD burner on your computer. With Linux running, you can use the md5sumcommand to verify the CD. If you are using Windows to validate the contents of the Linux CD, you can get theMD5Summer utility (www.md5summer.org) to verify each CD image. Assuming you downloaded the MD5 file associated with each CD image and have it inthe same directory as your CD images, run the md5sumcommand to verify the image. For example, to verify the KNOPPIX CD shown previously in the wget example, youcould type the following: $ md5sum KNOPPIX_V3.6-2004-08-16-EN.iso5bc8e9fee2a8be0b7180fcf3e49b5386 KNOPPIX_V3.6-2004-08-16-EN.isoThe MD5SUM file I downloaded previously from the download directory was calledKNOPPIX_V3.4-2004-05-17-EN.iso.md5. It contained this content: 5bc8e9fee2a8be0b7180fcf3e49b5386 * KNOPPIX_V3.6-2004-08-16-EN.isoAs you can see, the checksum (first string of characters shown) that is output fromthe ISO image matches the checksum in the MD5 file. So you know that the imageyou downloaded is the image they put on the server. As long as you got the imagefrom a reliable site, you should be ready to burn the CD. Note14_

Linux web host - 247Chapter 7Installing Linuxin directories. Those separate software directories

Monday, November 26th, 2007

247Chapter 7Installing Linuxin directories. Those separate software directories enable you to start an installprocess with a minimal boot disk that can grab packages over the network duringthe installation process. (Some of the installations we recommend with this bookare done that way.) When you follow links to Linux software repositories, here s what you look for: .Download directory You often have to step down a few directories fromthe download link that gets you to a repository. Look for subdirectories thatdescribe the distribution, architecture, release, and medium format. For exam- ple, mirrors for the Fedora Core 3 Linux distribution might be named fedora/ linux/core/3/i386/iso. .ISO images The software images you are going to burn to CD are typicallystored in ISO format. Some repositories include a README file to tell you whatimages you need (others just assume you know). To install a distribution, youwant the set of ISOs containing the Linux distribution s binary files. For exam- ple, the set of four Fedora Core 3 installation images for i386 platforms startswith FC3-i386-disc1.iso (with the others named disc2, disc3, and disc4). Although an ISO image appears as one file, it s actually like a snapshot of a file sys- tem. You can mount that image to see all the files the image contains by using theloop feature of the mountcommand. For example, with an image called abc.isoin the current directory, create an empty directory (mkdir myiso) and run themount command as follows: mount -o loop abc.iso myiso. Change to themyisodirectory, and you can view the files and directories the ISO image contains. .MD5SUM To verify that you got the right CDs completely intact, after youdownload them, look for a file named MD5SUM or ending in .md5in the ISOdirectory. You can use that file to verify the content of each CD (as describedlater). Downloading the DistributionYou can download each ISO image by simply clicking the link and downloading it toa directory in your computer when prompted. You can do this on a Windows orLinux system. If you know the location of the image you want, with a running Linux system, thewgetcommand is a better way to download than just clicking a link in yourbrowser. The advantage of using wgetis that you can restart a download thatstopsin the middle for some reason. A wgetcommand to download a KNOPPIX CDimage (starting from the directory you want to download to) might look like this: $ wget -c ftp.tux.org/pub/linux/knoppix/KNOPPIX_V3.6-2004-08-16-EN.isoIf the download stops before it is completed, run the command again. The -coptiontells wgetto begin where the download left off, so that if you are 640MB into a 650MBdownload when it stopped, it will just add in the last 10MB. Note14_

Web server address - 246Part IIIChoosing and Installing a Linux DistributionFinding Another

Monday, November 26th, 2007

246Part IIIChoosing and Installing a Linux DistributionFinding Another Linux DistributionYou can go to the Web site of each distribution (such as http://fedora.redhat. com/downloador http://slackware.com/getslack) to get Linux software. Those sites often let you download a copy (or sample) of their distributions andgive you the opportunity to purchase a boxed set. However, a way to get a more complete view of available Linux distributions is to goto a Web site that s dedicated to spreading information about Linux distributions. Use these sites to connect to forums, download sites, and documentation aboutmany Linux distributions. Here are some examples: .DistroWatch (www.distrowatch.com) The first place I go to find Linux distributions is DistroWatch.com. Go to the Major Distributions link to readabout the top Linux distributions (most of which are included with this book). Links will take you to download sites, forums, home pages, and other sitesrelated to each distribution. .LinuxISO (www.linuxiso.org) Like DistroWatch, this site also connectsyou to download sites, as well as forums, home pages, and other sites forLinux distributions. Look for the Helpful Stuff box on the LinuxISO home pagefor great information on getting, burning, and verifying Linux ISO images. .Linux Help (www.linuxhelp.net) Select the ISO images link from thissite s home page, and you can find download links to ISO images for many ofthe most popular Linux distributions. If you don t want to download and burn the CDs yourself, there are plenty of ads onthose sites from places willing to sell you Linux CDs or DVDs. Distribution prices areoften only a little bit higher than the cost of the media and shipping. If you really likea particular Linux distribution, it s a good idea to purchase it directly from the orga- nization that makes it. That can ensure the health of the distribution into the future. Books such as the Red Hat Fedora Linux Biblecan also be a good way to get a Linuxdistribution. Up-to-date documentation is often a weakness when you have nothingbut a CD to start out with. Standard Linux documentation (such as HOWTOs andman pages) are often out of date with the software. So, I would particularly recom- mend a book and distribution (such as this one or Red Hat Fedora Linux Bible) forfirst-time Linux users. Understanding What You NeedBy far, the most common way of getting Linux is on CDs, or secondarily, DVDs. Thenext most common way is to start with a floppy or CD that includes an installationboot image and get the parts of Linux you need live from the network as you installLinux. The images that are burned on to the CDs are typically stored on the Internet inwhat are called software repositories.You can download them and burn them to CDsyourself. Alternatively, the software packages are usually also included separately14_

245Chapter 7Installing LinuxThis (Web host server) book exposes you to several

Sunday, November 25th, 2007

245Chapter 7Installing LinuxThis book exposes you to several different Linux distributions. It gives you theadvantage of being able to see the strengths and weaknesses of each distributionby actually putting your hands on it. You can also try to connect into the growingLinux user communities because strong community support results in a more solidsoftware distribution and help when you need it (from such things as forums andonline chats). Other DistributionsThere seems to be a new Linux distribution every five minutes, and I really have tostop writing this book at some point. To keep the descriptions of Linux distributionsto a reasonable size (and actually have the space to describe how to use Linux), there are several interesting Linux distributions that aren t explored in this book. Notable Linux distributions not included in this book are TurboLinux, Lycoris, andXandros. TurboLinux (www.turbolinux.com) is a popular distribution in AsiaPacific countries. Lycoris (originally based on OpenLinux) and Xandros (designedto operate well in Microsoft Windows environments) are both well-regarded desk- top Linux systems (see www.lycoris.comand www.xandros.com, respectively). The following sections look beyond the confines of this book for those and otherLinux distributions. Getting Your Own Linux DistributionBy packaging a handful of Linux distributions with this book, I hoped to save youthe trouble of getting Linux yourself. If you have a DVD or CD drive, perhaps youcan use this opportunity to at least try KNOPPIX or Damn Small Linux so you ll seebetter what s being discussed. If for some reason you can t use the software on the DVD, you may want to get yourown Linux distributions to use with the descriptions in this book. Reasons you mightwant to get your own Linux distributions include: .No DVD or CD drive You need a bootable DVD drive on your computer todirectly use the software that comes with this book. (If you have access to aCD drive, however, you can copy Coyote Linux from the CD and create a Linuxdistribution, as described in chapter 17, hat runs from a floppy disk.) .Later distributions You may want a more recent version of a particular dis- tribution than comes with this book. .Complete distributions Because there s limited space on the DVD andbecause some distributions require subscriptions or other fees, you maywantto obtain your own, more complete distribution with which to work. Today, there is no shortage of ways to get Linux.

Web site developers - 244Part IIIChoosing and Installing a Linux DistributionChoosing a

Saturday, November 24th, 2007

244Part IIIChoosing and Installing a Linux DistributionChoosing a Linux DistributionThere are literally hundreds of Linux distributions available today. Some are gener- alized distributions that you can use as a desktop, server, or workstation system; others are specialized for business or computer enthusiasts. Part of the intention ofthis book is to help you choose which one (or ones) will suit you best. Using the DVD that comes with this book, you can boot directly to KNOPPIX (to tryout Linux without installing it on your hard disk) or to Fedora Core 3 (to installLinux on your computer s hard disk). Because the Fedora Core 3 included with thebook is the complete FC3 distribution, you can install a full range of desktop inter- faces and applications, programming tools, and server features. So after you vetried out KNOPPIX and are ready to install Linux on your hard disk, I recommendyou try Fedora. The CD that comes with this book boot directly to either Damn Small Linux (a compact KNOPPIX derivative) or to a Devian GNU/Linux network install (to install a customized Debian system over the network). Damn Small Linux runs well onlower-memory machines, while te Debian install we describe works well for thesample web (LAMP) and mail servers described in chapters 23 and 24. Other Linux distributions included on the DVD are stored there in ISO images thatfit on CDs, or, in some cases, mini-CDs or bootable business card-sized CDs (shapedlike business cards but can be read by most CD drives). Because of space limitationson the DVD, some of the distributions contained there are intended for networkinstalls, which means you need an Internet connection to get some of the softwareto complete a full install. Linux at WorkBecause I know a lot of people who use Linux, both informally and at work, I wantto share my general impressions of how different Linux distributions are being usedin the U.S. Most consultants I know who set up small office servers used to use RedHat Linux but now have mostly split off to using Fedora Core or Debian GNU/Linux. Mandrakelinux has been popular with people wanting a friendly Linux desktop, butFedora and SUSE are also well liked. The more technically inclined like to play withGentoo (highly tunable) or Slackware (Linux in a more basic form). For people who are transitioning to Linux with Mac hardware, Yellow Dog Linux letsthem install on a PowerPC and learn skills that are useful to expand later to Red HatLinux systems (Yellow Dog is based on Red Hat). As for the bootable Linuxes, every- one I know thinks they are great fun to try out and a good way to learn about Linux. For a bootable Linux containing desktop software that fits on a full CD (or DVD), KNOPPIX is a good choice; for a bootable mini-CD-size Linux, Damn Small Linuxworks well.

Web design programs - Installing LinuxIf someone hasn t already installed and configured

Friday, November 23rd, 2007

Installing LinuxIf someone hasn t already installed and configured a Linuxsystem for you, this chapter is going to help you get startedso you can try out the Linux features described in the rest of thebook. If you are a first-time Linux user, I recommend that you: .Try a bootable Linux.This book s DVD and CD includeseveral bootable Linux systems. The advantage of abootable Linux is that you can try out Linux withouttouching the contents of your computer s hard disk. Inparticular, KNOPPIX is a full-featured Linux system thatcan give you a good feel for how Linux works. Using theDVD or CD, youcan boot directly to KNOPPIX or DamnSmall Linux, respectively. There are also other bootableLinux distributions on the CD that you can use to createyour own bootable CDs (listed in Appendix A). .Install a desktop Linux system.Choose one of the otherLinux distributions and install it on your computer s harddisk. This will give you more flexibility for adding andremoving software, accessing and saving data to harddisk, and more permanently customizing your system. Installing Linux as a desktop system lets you try outsome useful applications and get the feel for Linuxbefore dealing with more complex server issues. This chapter provides you with an overview of how to choosea Linux distribution and then describes issues and topics thatare common to installing most Linux distributions. AppendixA describes exactly which Linux distributions are included onthis book s DVD and CD and how to either boot them from theDVD or CD or burn them to CD for installation. Each of theother chapters in this part of the book is dedicated to under- standing and installing a particular Linux distribution. After you ve installed Linux, you ll want to understand howtoget and manage software for your Linux system. These areimportant topics that are actually covered throughout thebook, but this chapter describes the major packaging formatsand tools to get you going. 77CHAPTER …In This ChapterChoosing a LinuxdistributionGetting a LinuxdistributionUnderstandinginstallation issues …