Cheap web hosting - 385Chapter 14Running Slackware LinuxSlackware comes with a good

March 2nd, 2008

385Chapter 14Running Slackware LinuxSlackware comes with a good set of libraries that will take care of the dependencyneeds of most Linux applications. However, for video, audio, and some other typesof applications, you may find yourself hunting around for libraries. Tools for satisfyingpackage dependencies (such as yum and apt) can save you that trouble in otherdistributions. Characterizing the Slackware CommunityLike many other successful Linux distributions, Slackware was started by a strong- minded individual who created the kind of Linux system that suited himself. Slackware users are people who pretty much agree with him. The Slackware CreatorPatrick Volkerding started Slackware in 1993 as a Linux distribution to use for him- self and his friends. He was kind enough to answer some questions I had aboutSlackware, and I want to share his answers with you here: Patrick originally used a Linux distribution called SLS Linux (named after SoftLanding Linux, the company that made it). Why didn t he just contribute to SLSinstead of starting his own distribution? Patrick:I tried. By April of 1993 I had collected a huge list of bugs in SLS, along with the fixes for most of them. Plenty of people tried to get these toPeter MacDonald (SLS s author/maintainer), but the bugs in SLS (many ofwhich were quite obvious) never seemed to get fixed. Of course, I d started work on my patched version of SLS with no plan to tryto launch a lasting distribution. I figured I d get it online and SLS would fix theissues, and that might just be that. SLS was a great distribution and isn t givenenough credit for all the ideas that started there. Unfortunately, it was whilePeter was busy working on inventing kernel modules that SLS sat online for afew months, full of bugs and not getting any updates. Patrick decided to take the leap to separate Slackware from SLS after MacDonaldsuggested that Slackware was infringing on his copyrights (despite the only licenseon the SLS code saying Distribute freely; do not restrict. ): Patrick:So, I promised Peter that I would write a new installer for Slackwareinstead of using a modified SLS one, and that the new installer would be thenext change made to Slackware online. Did the great success of Slackware from the get-go surprise him? Patrick:Absolutely. I knew it worked better than the other distributions thatwere out at the time, but I didn t expect the kind of mass exodus from SLS thatoccurred. Note21

384Part IIIChoosing and Installing a Linux DistributionAsk Slackware (Tomcat web server)

March 1st, 2008

384Part IIIChoosing and Installing a Linux DistributionAsk Slackware devotees the value of Slackware, and they might recite their mantra, the 4S Rule : Stable, Solid, Simple, and Sensible. By keeping things basic, Slackwareoffers the following advantages: .Better comprehension.Because you use commands and configuration fileswith Slackware, you learn more about how Linux works on the inside. Mostgraphical installers and GUI tools hide the actual configuration that is goingon and often limit the features you can use. If something goes wrong, it can behard to debug a problem with most graphical interfaces. The Slackwareinstaller is menu-based, very flexible, and quite intuitive. .Less bloat.In general, graphical interfaces consume far more resources thantheir command-line counterparts. GUIs require more room on the distributionmedium, plus more hard disk space and more RAM. Slackware relies primarilyon basic Linux commands, text-based configuration files, and some simplemenu-driven administration tools. With a Slackware 4.0 system, you can installa command-line version on a 100MB hard disk. .Better for low-end computers.Slackware is the first distribution I recommendto run on low-end machines. A special ZipSlack distribution (www.slackware. com/zipslack) can be installed from a 100MB Zip drive or floppy disks. ZipSlack can install on a 386 PC with as little as 4MB of RAM. Even with the latest Slackware distribution, if you want a GUI, the installation procedure forSlackware lets you choose small, efficient window managers, Web browsers, mail clients, and other graphical tools. .Packages as projects intended.Slackware doesn t mold the software itincludes into one look-and-feel. The Apache Web server, KDE desktop, orSamba file/printer sharing projects work pretty much as they are deliveredfrom those projects. So, again, the knowledge you gain from using those pro- jects will transfer fairly easily to those same projects on other Linux systems. Instead of providing a unified look-and-feel, Slackware allows the desktop environ- ment or window manager you choose to dictate the desktop presentation. You canchange your desktop as you like, using the menus or preference windows that comewith those environments. Full KDE or GNOME desktops are available with Slackware(contained mostly on the second of two Slackware installation CDs). Or you can optfor a lighter, more efficient window manager, such as xfce, fvwm2, or twm. For system administration, Slackware offers some tools that are based on the ncurseslibrary. Ncurses allows an application to provide a screen-oriented interface from acharacter terminal, so you can use forms, menus, and sometimes even a mouse toconfigure some basic Linux features from any shell (no GUI required). Anything you can do with other Linux distributions, you can do with Slackware. Itmight just take a bit more manual work to get there. Slackware doesn t yet officiallyuse a package management system, such as the Red Hat RPM or Debian deb files. (Although there are some software management tools you can use, which aredescribed later.) In general, however, most Slackware users become adept at build- ing and installing their own applications (using tar, make, and similar tools).

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

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

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

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)

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

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

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

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)

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_