Archive for February, 2008

RunningSlackware LinuxAsk old-time Linux users what the first (Web design conference)

Friday, February 29th, 2008

RunningSlackware LinuxAsk old-time Linux users what the first Linux distributionthey used was and many will tell you it was Slackware. Slackware is the oldest Linux distribution that is still activelydeveloped today. Although it does not have a fancy graphicalinstaller or specialized GUI tools, Slackware still has a loyalfollowing and is a good way to get a basic Linux system that isboth secure and stable. This chapter explores the Slackware distribution, discussesits strengths and weaknesses, and introduces those who useit. It also explains how to install Slackware. The first Slackware 10 CD image is on the DVD that comeswith this book. You can copy and burn that image to CD asdescribed in Appendix A. The first CD lets you install a good, basic set of features. If you want to install a GNOME or KDE desktop, you can install those features from the secondCD, (which you can obtain from www.slackware.com/ getslack). Getting into SlackwareAlthough full graphical installs and GUI administration toolscan make installing and configuring Linux easy, those toolscarry with them some overhead. They also hide some of thedetails of how Linux is being configured. On theDVD-ROM1414CHAPTER …In This ChapterGetting intoSlackwareCharacterizing theSlackware communityInstalling SlackwareStarting Slackware …

382Part IIIChoosing and Installing (Web servers) a Linux Distribution32.Install a

Thursday, February 28th, 2008

382Part IIIChoosing and Installing a Linux Distribution32.Install a Desktop.For most of us, it s not much fun just working from the com- mand line. The following command installs a basic set of desktop packages, including the X Window System (xfree), KDE desktop (kde), Mozilla browser(mozilla), and Openoffice.org office suite (openoffice-bin). This will take a longtime to install over the network! # emerge xfree kde mozilla openoffice-binAs an alternative, if you have these packages available on CD-ROM, you cantype the following commands to identify the location of the packages andinstall them from that location: # export PKGDIR= /mnt/cdrom/packages # emerge -k xfree gnome kde mozilla openoffice-binYou could also consider saving some time by installing only gnomeor kde(notboth). If you don t plan to create documents or spreadsheets, you probablydon t need to install openoffice-bineither. 33.Configure the X server.Now that your desktop software is installed, you needto configure the X Window System to work properly with your video card andmonitor. Type the following to configure your video card and monitor: # /usr/X11R6/bin/xf86configAt this point, you should have a working Gentoo system. For further documentation, check out www.gentoo.org/doc/en/index.xml. SummaryIn just a few years, Gentoo has distinguished itself as a premier distribution forLinux enthusiasts who are interested in complete control of the components andsettings of their Linux systems. The jewel of the Gentoo system is the Portage package management system. Usingthe Portage emergecommand, you can install any of thousands of Gentoo softwarepackages. Those packages can be downloaded and built from scratch, using settingsyou choose to tune them for how you use your Linux system. If you don t want to learn about the inner workings of a Linux system (and spendlots of time getting it to work), Gentoo may not be for you. An experienced Linuxperson usually takes several tries to get Gentoo going, while someone new to Linuxmay not get it installed and running at all without lots of help. However, if you liketo tune and tweak your operating system, Gentoo is a great way to go. …

381Chapter 13Running Gentoo Linux29.Add kernel modules.Add (Free web hosting with ftp) any extra

Thursday, February 28th, 2008

381Chapter 13Running Gentoo Linux29.Add kernel modules.Add any extra kernel modules that you need to add aboot time. You usually only need to do this if some piece of hardware isn tdetected and the module needed to use it isn t automatically loaded. Useeither kernel-2.4 or kernel-2.6, depending on which kernel you are using. # nano -w /etc/modules.autoload.d/kernel- You can type uname -ato see what your current kernel version is. 30.Configure the boot loader.You need to install a boot loader (grub in thisexample) and configure it. The example makes the following assumptionsabout your setup: Gentoo is installed on your first IDE hard disk (/dev/hda). You have a separate /bootpartition on /dev/hda1. Your initrd file in the /boot directory is initrd-2.4.26-gentoo-r9. Your kernel file in the /bootdirectory is kernel-2.4.26-gentoo-r9. If any of that information is different for your setup, you will need to adapt thefollowing step appropriately. To configure grub, install it with emerge, run thegrubcommand, and then create the grub.conffile as follows: # emerge grub# grubgrub> root (hd0,0) grub> setup (hd0) grub> quit# nano -w /boot/grub/grub.confdefault 0timeout 15splashimage=(hd0,0)/grub/splash.xpm.gztitle=Gentoo Linuxroot (hd0,0) kernel /kernel-2.4.26-gentoo-r9 root=/dev/hda0initrd /initrd-2.4.26-gentoo-r931.Reboot.Exit from your chroot partition by running umountto unmount allpartitions and then rebooting as follows: # exit; cd / # umount /mnt/gentoo/devfs /mnt/gentoo/proc /mnt/gentoo# rebootRemove the installation CD and allow the computer to boot from hard disk. After a few moments, you should see the GRUB boot screen. Select GentooLinux (press Enter). From here on, you will be booting from the hard disk and working directly from theoperating system you installed. If you see error messages, such as missing kerneldrivers, I recommend that you go to http://forums.gentoo.comand searchfor the driver that s causing problems. Chances are that someone else has had thesame problem and can offer you a solution. Note20_

380Part IIIChoosing and Installing a Linux Distribution25.Configure system (Web hosting service)

Wednesday, February 27th, 2008

380Part IIIChoosing and Installing a Linux Distribution25.Configure system services.Install your system services: system logger, cronservice, hotplug, and reiserfs service, and set the domain name. Then turn oneach of those services, as follows: # emerge syslog-ng# rc-update add syslog-ng default# emerge vixie-cron# rc-update add vixie-cron default# emerge hotplug# rc-update add hotplug default# emerge reiserfsprogs# rc-update add domainname default26.Add special driver support.There may be particular kernel modules requiredby your computer at this point. For example, if you have a special Ethernetadapter or a special type of video card, use the emergecommand to installkernel modules now. You may not need any of them. Here are a few examples: # emerge nvidia-kernel# emerge nforce-audio# emerge e100# emerge e1000# emerge emu10k1# emerge ati-driversThese emergecommand lines are only used if you have special hardwareassociated with the kernel drivers. Respectively, those commands loaddrivers for accelerated Nvidia video cards, audio for Nvidia NForce mother- boards, Intel e100 Fast Ethernet cards, Intel e1000 Gigabit Ethernet card, Sound Blaster Live!/Audigy support for 2.4 kernel, and ATI Radeon+/FireGLgraphics acceleration video cards. 27.Add user and machine information.Add a password for the root user, a regu- lar user account name of your choosing (chris in this example), a machinename, and a domain name. If you like, you can also edit the /etc/hostsand/etc/rc.conffiles to add IP addresses and hostname or change the basicsystem startup script. # passwd# useradd chris -m -G users,wheel,audio -s /bin/bash# passwd chris# echo mymachine > /etc/hostname# echo mydomain.com > /etc/dnsdomainname# nano -w /etc/hosts# nano -w /etc/rc.conf28.Set up networking.Edit the netfile, and then run rc-updateto add the eth0interface as the default. (Uncomment the line iface eth0=”dhcp”to havethe network use DHCP to start up automatically.) # nano -w /etc/conf.d/net# rc-update add net.eth0 default20_

Best web site - 379Chapter 13Running Gentoo Linux21.Install Gentoo: # emerge systemIt

Tuesday, February 26th, 2008

379Chapter 13Running Gentoo Linux21.Install Gentoo: # emerge systemIt will take a long time for the emerge systemcommand to complete. If it failsbefore it is finished, check that the settings in your make.conffile are correct. 22.Set the time zone: # ln -sf /usr/share/zoneinfo/path/etc/localtimeYou need to substitute pathwith the path to the file that represents the timezone your computer is in. For example, the entire path for Central time in theUnited States would be /usr/share/zoneinfo/US/Central. 23.Create file system table.Add the file systems you want to mount automati- cally at boot time to your /etc/fstabfile. Here s an example: # nano -w /etc/fstabHere s what the /etc/fstabmight look like (given the partitions created ear- lier in this example procedure): # /dev/hda1 /boot ext2 noauto,noatime 1 2/dev/hda2 none swap sw 0 0/dev/hda3 / reiserfs noatime 0 1/dev/cdroms/cdrom0 /mnt/cdrom auto noauto,user 0 0none /proc proc defaults 0 0none /dev/shm tmpfs defaults 0 024.Build kernel. Either install a prebuilt kernel or build one yourself. To buildone, you need a kernel sources package (gentoo-sources is recommended). Type the emergecommand as follows to get the gentoo-sources package: # emerge gentoo-sourcesNext, use the following command to get the genkernel package and configurea kernel using menuconfig: # emerge genkernel#genkernel –menuconfig allAfter you have made any changes you want to your kernel configuration, select Exit, and then choose Yes to save it. At this point, genkernelmakesyour new kernel. This will take awhile. Configuring your own kernel can be quite tricky at first. If you run into problems, refer to the Gentoo Linux Handbook (www.gentoo.org/doc/en/handbook/ handbook-x86.xml). Select Section 7, Configuring the Kernel, for further information. NoteNote20_

Web host server - 378Part IIIChoosing and Installing a Linux Distribution13.Extract the

Tuesday, February 26th, 2008

378Part IIIChoosing and Installing a Linux Distribution13.Extract the stage 1 tarball. # cd /mnt/gentoo# tar -xvjpf /mnt/gentoo/tmp2/stage1-*.tar.bz2You can remove the stage1 tarball once you have untarred it. 14.Select mirror site.Use the mirrorselectcommand to search for a Gentoomirror site from which you can efficiently download the files you need to dothe install. Run the following command to select an efficient mirror and add itto your make.conffile (it will take awhile to test download speed from morethan 150 servers): # mirrorselect -a -s4 -o |grep GENTOO_MIRRORS >> /mnt/gentoo/etc/make.confIf, when you run emergecommands later in this procedure, you see messagesthat files are not found from any of the download sites, you might need to addother mirror sites to the make.conffile. 15.Mount file systems.Mount the /procand /devfsdirectories as follows: # mkdir /mnt/gentoo/devfs# mount -t devfs devfs /mnt/gentoo/devfs# mkdir /mnt/gentoo/proc# mount -t proc none /mnt/gentoo/proc16.Change root directory.Use the chrootcommand to change /mnt/gentootobe your root directory, but first copy the resolve.conffile so it can be usedfrom there: # cp /etc/resolv.conf /mnt/gentoo/etc/resolv.conf# chroot /mnt/gentoo /bin/bash17.Update environment.Read in environment variables as follows: # env-update; source /etc/profile18.Update Portage tree.Type the following command to have the latest packageinformation installed to your /usr/portagedirectory: # emerge sync19.Modify make.conf.Use the nano text editor to change the make.conffilethat is used to build your Gentoo system. Here s how: # nano -w /etc/make.confIf you don t know what to change, refer to the /etc/make.conf.examplefilefor information about the settings you may want to change before continuing. Ifyou don t know what processor your computer has, type cat /proc/cpuinfo. 20.Bootstrap Gentoo: # cd /usr/portage/ ; scripts/bootstrap.shNote20_

377Chapter 13Running Gentoo Linuxas /dev/hdaor (Web site traffic) /dev/sdafor your first

Monday, February 25th, 2008

377Chapter 13Running Gentoo Linuxas /dev/hdaor /dev/sdafor your first IDE or SCSI hard disk, respectively). Then type hto display a list of commands. (See Chapter 7 for information aboutusing fdiskto partition your hard disk.) Repartitioning your disk will destroy existing data on your hard disk. Back up anydata you value before starting this procedure. Be sure not to delete or change anypartitions that have data on them that you want to keep. # fdisk /dev/hda8.Make file systems. To create the appropriate file systems on your disk parti- tions, use the mk2fsand mkswapcommands. For example, with an IDE harddrive that has the first partition as the boot partition (/dev/hda1), the secondas swap (/dev/hda2), and the third as the root (/) partition (/dev/hda3), you could type the following: # mke2fs /dev/hda1# mkswap /dev/hda2# mkreiserfs /dev/hda39.Turn on swap.Use the swaponcommand to turn on your swap partition. Forour example (with hda2 being the swap partition), you would type: # swapon /dev/hda210.Mount root (/) partition.You need to mount the root (/) partition temporarilyto begin installing Gentoo to it. In this example (with the root file system on/dev/hda3), you would type: # mount /dev/hda3 /mnt/gentoo11.Mount the /boot partition.Next, mount the boot partition to install to it: # mkdir /mnt/gentoo/boot# mount /dev/hda1 /mnt/gentoo/boot12.Get the stage1 tarball. Assuming that you have the minimal Gentoo installationCD, you need to download the stage1 tarball. Find a mirror site near where youare (as described earlier). Then make a directory on your hard disk to copy itto and download the tarball using a tool such as wget. Here is an example: If you are using the universal CD, the stage1 tarball is available there. Instead ofdownloading it, jump to the next step and extract the tarball from /mnt/cdrom/ stages/stage1*.tar.bz2. # mkdir /mnt/gentoo/tmp2# cd /mnt/gentoo/tmp2# wget -c http://gentoo.osuosl.org/releases/x86/2004.2/ stages/x86/stage1-x86-2004.2.tar.bz2The wgetcommand, which appears on two lines here, should all be typed on oneline. (There s no space between the slash at the end of the first line and the word stages at the beginning of the next.) If the download should stop in the middle, you can restart it by running the same command again in the same directory. NoteNoteCaution20_

376Part IIIChoosing and Installing a Linux DistributionIf you (Frontpage web hosting)

Sunday, February 24th, 2008

376Part IIIChoosing and Installing a Linux DistributionIf you have a slow processor, consider getting precompiled packages because thefull compilation process can take a long time. If you need further information about any of the steps described in this proce- dure,refer to the Gentoo Handbook: www.gentoo.org/doc/en/handbook/ index.xml. With the install CD in hand, here s how to install Gentoo on your computer: 1.Insert the CD (minimal or universal) into your computer s CD or DVD drive. 2.Reboot your computer. 3.Boot CD.From the boot prompt, press Enter. (If you are not able to boot theinstall medium, press F1 or F2 to see other install options that might help youget going.) Gentoo should detect your computer hardware, start the install process, anddisplay a boot prompt. 4.Set date. Type the datecommand to make sure the date and time are set correctly. If they need to be changed, use the datecommand (with options) to change them. For example, to set the date to 8:15 a.m., June 15, 2005, youwould type: # date 0615081520055.Load modules. If some piece of hardware was not auto-detected, you mayhave to load the module you need to access that hardware. Use the modprobecommand with the name of the module you want to load. For example, to loadthe module for an Orinico wireless LAN card, you could type: # modprobe orinocoSearch the Web for the term Linux and the name of the hardware that is not beingdetected to find out what module to load. 6.Configure network. Type ifconfig eth0to see if the Internet connection toyour first Ethernet card is up and running. Then try to ping a computer on theInternet to make sure you can get out (for example, ping www.gentoo.org). If you are not able to pick up a DHCP server to automatically connect to theInternet, you can set up your Internet connection manually, by typing: # net-setup eth0Refer to the network configuration information in the installation procedure inChapter 8 to help you answer questions about setting up your Internet con- nection manually. 7.Partition hard disk. Partition your hard disk to prepare it to receive yourGentoo installation. You can use the fdiskutility to do this. Gentoo recom- mends a 64MB boot volume (ext2 file system), a swap partition that s doublethe size of your RAM, and a large root (/) partition (ReiserFS file system). Startfdiskby following the command with the name of your first hard disk (suchTipNote20_

Web hosting provider - 375Chapter 13Running Gentoo LinuxBegin with the following CD

Sunday, February 24th, 2008

375Chapter 13Running Gentoo LinuxBegin with the following CD image: install-x86-minimal-2004.2.iso.Thisbootable minimal install CD image (only about 78MB) includes just enough softwareto begin the install procedure. This CD image is included on the CD that comes withthis book, so you can copy and burn that image to CD to start this installation pro- cedure. You can also find this image in any Gentoo mirror site (in thereleases/x86/2004.2/livecddirectory). If you have a slow computer or no broadband Internet connection, I recommendthat you get the universal CD instead, as well as the packages CD before you begininstalling. Those two CDs will enable you to do a complete Gentoo install withoutneeding to get on the Internet. You can download the disk images from Gentoo mirrorsites (refer to www.gentoo.org/main/en/mirrors.xmlfor the locations of Gentoomirror sites). Here s where you can find the universal and packages CD images: .install-x86-universal-2004.2.iso. This bootable install CD image contains enough software to enable you to have a working Gentoo systemwithout going on the Internet. It is located in releases/x86/2004.2/livecddirectories on a mirror site. .packages-x86-2004.2.iso. This nonbootable CD image contains many popular packages you might want with Gentoo. The contents include popular, precompiled packages that you can add after the basic Gentoo system isinstalled. While this CD saves you download and compile time, it does notletyou do the optimization for your particular machine on the packages itincludes. Its image is located in releases/x86/2004.2/packagecd/x86onamirror site. By the time you read this, there will certainly be a later version of Gentoo available. If you decide to use a later version, you should find the associated install proce- dure from the Gentoo site. Version numbers include the year and release number. For example, 2004.2 represents the second release in 2004. For a more detailed description of the Gentoo install process, refer to the GentooLinux/x86 Handbook (www.gentoo.org/doc/en/handbook/handbook-x86.xml). Starting Gentoo InstallationHere are the minimum computer requirements for a Gentoo installation using thex86 procedure described in this chapter: .1GB of hard disk space .64MB of RAM .A 486 processor (or better) .300MB of total memory (combined RAM and swap) Note20_

374Part IIIChoosing and Installing a Linux DistributionSimply step (Com web hosting)

Saturday, February 23rd, 2008

374Part IIIChoosing and Installing a Linux DistributionSimply step through the /usr/portagedirectory structure to see the softwarepackages you can install, information about how each is built, and patches that areavailable. Installing GentooA Gentoo installation is more like building your own Linux than it is like typicalLinux installs. While many Linux installations start you with a precompiled set ofsoftware and nice screens to lead you through, Gentoo boots you to a shell andexpects you to set up the computer by hand. In the example installation, you llevenbuild your own binaries from source code. To someone who has never used Linux (or other UNIX systems), Gentoo installscanappear daunting. If you can tough through it, however, you will learn what goesinto setting up and making a Linux system in a way that you won t find in any otherLinux distribution. The advantages to your installing Gentoo are that, as mentioned earlier, there isexcellent documentation available and an extraordinary community supportingGentoo. If you make it through the install, you will have: .A tuned system. Because you are making decisions about your software beforethe binaries are produced, you can tune your system to be built specificallyfor the hardware you are using. You can tell Gentoo the exact processor, filesystem types, sound cards, or other features you want built into the kernel orloadable modules. .The software you want. Gentoo enables you to select the software you wantto install, and because you are compiling it yourself, you can even tell Gentoowhat features to include with it. For example, if you are adding the Evolutione-mail client, you can choose to include (or not include) LDAP support forshared address books on your network. .Fewer dependency issues. When you build software yourself, dependencyissues are taken care of at compile time, so you don t have to worry about get- ting a software package that was created for a different architecture or kernel. Your applications will be built for your operating system because you buildthem that way. Getting GentooThe Gentoo Linux distribution is available in several different forms. To provide thefull feel of installing Gentoo, this chapter illustrates a Gentoo install that is done froma minimal disk image. You will download and compile most of the software you need(including the kernel itself). To do this procedure, you need a broadband Internetconnection (no dial-up).