![]() | ![]() |
|
Configuration HOWTOGuido ``goccia'' Gonzato ggonza@tin.it Version 1.99.7. 6 November 2001.
1. Introduction1.1. Why This HOWTOCurrent distributions are approaching perfection, but some fine-tuning is still needed. Many new users are intimidated by the apparent complexity of a Linux system, and as a result I note that the same questions crop up on c.o.l.setup over and over again. To try and remedy this situation, and for my own convenience, I wrote a to--do list that eventually became this HOWTO. Here you will find configuration tips and examples for the most common applications, programs, and services, which should save you a fair amount of time and work. I realise that this HOWTO is quite RedHat-centric. Currently, I only have access to Red Hat and Mandrake machines, kernels ranging from 2.0.36 to 2.2.15; so don't take any of my tips as gospel if you have other distributions. Previous versions of this HOWTO provided some information for SuSE, Debian and Caldera; but as I no longer have access to those machines, I can't keep the details up-to-date. No information is better that inaccurate information, so it's up to you to to adapt my tips to your distribution. This HOWTO can't replace others, and it's not meant to. Reading docs and HOWTOs always pays, so you're strongly advised to do so if you want to know more. Also, no spoon--feeding here: if you realise you don't understand something, please refer to the relevant HOWTO. Let me remind you that the right place for seeking help with Linux configuration is Usenet, i.e. news:comp.os.linux.setup. Please, don't seek help from me because I'm quite overloaded. The official place for this document, which also hosts all other HOWTOs I refer to and some translations, is http://www.linuxdoc.org . 1.2. What We Will Be ConfiguringThere can be endless hardware configurations for a PC, but in my experience one is quite common: a PC fitted with a large HD split into three partitions (one for DOS/Windows, one for Linux, one for the swap), sound card, modem, CD-ROM drive, printer, mouse. A parallel port Zip Drive is also very common. This machine is possibly part of a mixed Windows-Linux network, where it acts as server. This is the hardware I'll assume you want to configure, but it's easy to adapt the following tips to different configurations. It's implicitly assumed that you'll be root when editing/fixing/hacking. And now, lads, sleeves up. 2. General System Setup2.1. A Few Words About SecurityEven before your system boots, you should decide what level of security you want to implement. To begin with, don't connect your machine to the network until you have decided what to do. Security is a vast subject that goes beyond the scope of this HOWTO; two good starting points are the Linux Security Administrator's Guide http://www.securityportal.com/lasg and the Linux Security Guide http://nic.com/~dave/SecurityAdminGuide/index.html . You should consider at least the following steps: using shadow passwords (Shadow Password HOWTO), restricting network access to the machine (Section Section 3.4), using the Secure Shell (http://www.openssh.org ) or the Secure Remote Password ( http://srp.stanford.edu/srp/). Good luck. 2.2. Start the Logbook!To keep your installation in shape, it's essential that you know exactly what happened to your machine, which packages you installed that day, what you removed or modified, and so on. So, the first thing you'll do before you tamper with your machine is start a ``logbook''. Therein you'll take note of every move you make as root; in my own logbook I also keep a section where I list all modified system files, additional .rpms, and .tar.gz I installed. Optimally, backtracking your moves you should be able to re-obtain a fresh installation. Make a backup copy of the system files you touch. Better still, use RCS; you'll be able to backtrack all changes. Never work as root without logging your moves! 2.3. KeyboardIf you missed this step during installation or have changed your keyboard, you'll have to:
To load the key table, issue
Other special keys will be dealt with in the following sections. To enable NumLock on by default, add these lines to /etc/rc.d/rc.sysinit:
Normally, the Linux console cannot distinguish between, say, Arrow and Shift-arrow, but some applications (namely, the editor Section 4.5.3) do. Normally, these key bindings are only available in xterm. The following key map, which you can choose to load at boot time, is very handy:
2.4. Boot and Rescue FloppyMake a couple of boot floppies for your newly installed system. Your distribution may include a command for creating such a floppy (say, mkbootdisk or something like that); if not, these commands will do:
Also, have at least a couple of rescue disks ready. There's a wide choice of rescue disks at ftp://metalab.unc.edu/pub/Linux/system/recovery ; if you don't know which one to choose, I suggest you try out Tomsbtrt, whose home page is http://www.toms.net/rb . It's very complete, but some utilities seem missing at first; for example, ftp is not there but you get nc (netcat) instead. Please read its documentation. 2.5. Console ColoursWhy stick to white on black in Linux console? With the setterm command you can choose nicer combinations:
Type setterm alone for a list of arguments. 2.6. Kernel MattersIMHO, the first thing to do next is build a kernel that best suits your system. It's very simple to do but, in any case, refer to the README file in /usr/src/linux/ or the Kernel HOWTO. Hints:
2.7. Hard Disk PerformanceYour (E)IDE hard disk's performance can be greatly enhanced by carefully using hdparm(8). If your Linux distribution doesn't include it, you'll find on ftp://metalab.unc.edu/pub/Linux/system/hardware ; look for a file called hdparm-X.Y.tar.gz. Since many details depend on your hard disk and HD controller, I can't give you a general recipe. You risk to toast your filesystem, so read the man page carefully before using some of the options. At its simplest, you could add the following line to /etc/rc.d/rc.sysinit:
which enables (E)IDE 32-bit I/O support. As for the `-m' option, this is what hdparm author Mark Lord emailed me: " (...) if your system uses components from the past couple of years [< 1997], it will be fine. Older than that, there *may* be a problem (unlikely). The really buggy chips were the CMD0646 and RZ1000 chips, used *extensively* on 486 and (early) 586 motherboards about 2-3 years ago. " For recent machines, these settings should work fine:
2.8. Parallel Port Zip DriveStock kernels include the driver for both old (ppa) and new (imm) Zip drives. If you recompile the kernel, make sure that SCSI support and SCSI disk support are enabled. Remember, there can be conflicts between the printer and the Zip drive on the same parallel port, so you have better use kernel modules. Zip disks are sold preformatted on partition /dev/sda4. To enable the Zip, append this to /etc/rc.d/rc.sysinit:
Zip disks can be mounted via /etc/fstab as shown below, or via Mtools adding this line to your /etc/mtools.conf:
besides, the command mzip allows you to eject, query the status, write and password protect Zip disks; man mzip for details. The Mtools home page is at http://linux.wauug.org/pub/knaff/mtools. 2.9. Device DriversDevices in /dev (or better, links to the actual device drivers) may be missing. Check what devices your mouse, modem, and CD--ROM drive correspond to, then do what follows:
In most notebooks the mouse device is /dev/psaux: take this into account when configuring X11. If you wish, do chmod 666 to these devices to make them fully accessible by every user. 2.10. Sound CardMy desktop PC is fitted with an old Sound Blaster 16; even if you've got something different, you may take what follows as guidelines. I compiled the sound card support as a module (sb.o). Then I put this in /etc/conf.modules:
To enable the sound, make sure that modprobe sound is invoked in /etc/rc.d/rc.sysinit. Alternatively, get the tool sndconfig from the RedHat site. Besides the standard kernel sound drivers, the Alsa drivers ( http://www.alsa-project.org) are an excellent choice. Strangely, though, the sound channels are muted by default. You'll want to use aumix and this /etc/aumixrc to set the volume to 100%:
2.11. Login MessagesIf you wish to customise the login messages, check whether your /etc/rc.d/rc.local overwrites /etc/issue and /etc/motd. (RedHat does.) If so, get on with your editor. If you'd like a colourised login message, you may adapt your rc.local inserting lines like these:
2.12. HostnameIssuing the command hostname new_host_name may not be enough. To avoid the dreaded sendmail lock, follow these steps (only valid for a stand--alone machine):
2.13. Mousegpm mouse services are useful to perform cut and paste in tty mode, and to use the mouse in some applications. Make sure that you have a file called /etc/sysconfig/mouse and that it reads:
Moreover, you must have a file /etc/rc.d/init.d/gpm, where you'll put additional command line parameters. Mine reads:
Obviously, make sure this configuration is right for your mouse type. In most notebooks, MOUSETYPE is ``PS/2''. If you like to use menus in console with Ctrl-button, then configure gpm-root. Edit the default menu in /etc/gpm-root.conf, then launch gpm-root from /etc/rc.d/rc.local. 2.14. Mount PointsIt's handy to have mount points for the floppy, other devices and NFS-exported directories. For example, you can do the following:
This creates mount points for a DOS/Win floppy, the CD--ROM, the Windows partition, the parallel port Zip drive, and an NFS directory. Now edit the file /etc/fstab and add the following entries:
Obviously, you must use the correct device in the first field. Note the `auto' filesystem type in the first line; it allows you to mount both ext2 and vfat (DOS/Windows) floppies, but you need a recent version of mount. You may find mtools more convenient. 2.15. Automount PointsIf you don't like the mounting/unmounting thing, consider using autofs(5). You tell the autofs daemon what to automount and where starting with a file, /etc/auto.master. Its structure is simple:
In this example you tell autofs to automount media in /misc and /mnt, while the mountpoints are specified in/etc/auto.misc and /etc/auto.mnt. An example of /etc/auto.misc:
Start the automounter. From now on, whenever you try to access the inexistent mount point /misc/cdrom, il will be created and the CD-ROM will be mounted. 2.16. lilo(8) and LOADLIN.EXEMany users run both Linux and DOS/Windows on their PC, and want to choose at boot time which os to use; this should be done at install time, but in case, do what follows. Let's suppose that /dev/hda1 contains DOS/Windows and that /dev/hda2 contains Linux.
This makes the Linux partition bootable. Then write this basic /etc/lilo.conf file:
Now issue /sbin/lilo and you're done. Being lilo a crucial part of your installation, you're strongly advised to read its documentation anyway. To boot Linux from DOS/Windows without resetting, put LOADLIN.EXE in a directory (in the DOS partition!) included in the DOS path; then copy your kernel to, say, C:\TEMP\VMLINUZ. The following simple .BAT file will boot Linux:
If you use Windows 9x, set the properties of this .BAT so as it starts in MS--DOS mode. 2.16.1. Security TipMaking a backup copy of your MBR before installing Linux is a safe move. Prepare a Windows rescue floppy, and make sure it includes FDISK.EXE. To restore the MBR, all you have to do is
2.17. Printer Configuration (lpd)All distributions I know have a configuration tool for setting up the printer (printtool, yast, or magicfilter); if you don't have it, this is a basic manual configuration. Let's suppose you have a non--PostScript (non ``Windows-only'' too!) printer you want to use to print raw text (e.g., C source files) and PostScript files via Ghostscript, which is assumed to be already installed. Setting up the printer involves a few steps:
For more complex or exotic printing configurations, the Printing-HOWTO awaits you. If you use printtool, be aware that the GSDEVICE chosen by Printtool will work, but not necessarily at its best for your printer. You may consider fiddling a bit with the file postscript.cfg; for instance, I changed GSDEVICE from cdj500 to djet500 and now my prints come out much quicker. 2.18. SVGATextModeThis utility, available on ftp://tsx-11.mit.edu/pub/linux/sources/sbin, is useful for changing the console screen resolution, font, and cursor shape. Users whose language include accented characters will be able to use them in console applications, while notebook users may change the cursor shape to make it more visible. Edit /etc/TextConfig or /etc/TextMode, starting with the default VGA definition. Europeans should be happy with this ``LoadFont'' section:
Once you're done, try your configuration with a command like SVGATextMode "80x34x9", and if everything appears to be working fine, remove the warnings from /etc/TextMode and include this line in etc/rc.d/rc.sysinit:
Please note that the block cursor only works with some modes; on my notebook, "80x30x9". 3. Common Administration TasksHere is where the fun begins. This section is rather network-centric, though many other tasks await you. Networking is a vast subject which cannot be fully covered here. The reference is the NET-3 HOWTO, and most distributions provide documentation on setting up network services. Only a few points will be recalled here. A quick to-do list for the services you may want to install: cron and timed tasks like calendar or reminder, Http, Samba, telnet/ssh access, anonymous ftp, POP/IMAP server, NFS... 3.1. Network ConfigurationIf your network card wasn't recognised at install time, don't worry: in most cases it's either NE2000 or 3c59x compatible. Issue the command modprobe ne or modprobe 3c59x and see if the relevant module is loaded, then add this line in /etc/conf.modules:
Now you're ready to use netcfg or similar tool to set up the network configuration. The relevant files are /etc/HOSTNAME, etc/hosts, /etc/resolv.conf, /etc/sysconfig/network, and /etc/sysconfig/network-scripts/ifcfg-eth0; services should be started with scripts in /etc/rc.d/init.d. This is a sample etc/hosts:
This is /etc/resolv.conf:
This is /etc/sysconfig/network (Red Hat-dependent):
And finally, /etc/sysconfig/network-scripts/ifcfg-eth0. This one, too, is Red Hat-dependent; it must be executable.
Although the actual method of starting network services of your distribution may be much more complex, the following script should be enough to get you started:
This script is handy for enabling network access when you use a rescue disk. Obviously, this lets you only ping, ftp and telnet to the outside; it won't start any daemon. 3.2. Network for NotebooksWhen you plug the network PC card in, the script /etc/pcmcia/network will be run. All it needs is a properly set up /etc/sysconfig/network-scripts/ifcfg-eth0. Setting up the network can become a bit trickier, though. In fact, you must provide the right settings for each network you connect to, as well as settings for the notebook when it's not connected. I rolled up a rough but functional solution. I use my notebook as a stand-alone machine, connecting to the net via PPP; at home, IP address 192.168.1.2; and at university, IP 137.204.x.y. So, I created a set of configuration files for each network; all these are kept in /etc/mobnet. A script is then used to select the working environment. For instance, this is /etc/mobnet/home.cfg:
This is mnet, the script I use to choose the network profile:
As I said, it is rough and even not complete: other files may depend on the network, like /etc/fstab, /etc/exports, and /etc/printcap. Think about network printers and NFS shares. Feel free to adapt this bare-bone solution to your needs. 3.3. Sharing the InternetOne of the most useful tasks for a Linux server. Currently, most stock kernels come with IP firewalling, masquerading and forwarding enabled by default; if in doubt, consult the IP-Masquerade mini-HOWTO to learn how to enable them. Then install ipfwadm (kernels 2.0.x; http://www.xos.nl/linux/ipfwadm/) or ipchains (kernels 2.2.x; http://www.adelaide.net.au/~rustcorp/ipfwchains/ipfwchains.html ). Remember to enable kernel modules for the services you need, e.g. for ftp you'll add this line to /etc/rc.d/rc.sysconfig:
Other modules are usually found in /lib/modules/KERNEL-VERSION/ipv4. Enabling IP masquerading for other machines in your local network is very simple. First, check the network initialisation scripts (/etc/sysconfig/network should be the right place) to see if they contain a line that reads FORWARD_IPV4=true. It's used to set /proc/sys/net/ipv4/ip_forward to 1 when the network subsystem comes up. Add these lines to /etc/rc.d/rc.sysinit:
If you use a kernel of the 2.2.x series, use ipfwadm-wrapper instead of ipfwadm to get started quickly. More information at http://ipmasq.cjb.net. Now you'll want something to let client machines dial the ISP; I use Mserver ( http://cpwright.villagenet.com/mserver/). Edit etc/mserver.conf; the only entries that you should modify are ``checkhost'', ``shadow'', and ``cname''. Then define your connection(s). Obviously, install a suitable client on the client machines. 3.4. Restricting Network AccessLet's suppose you connect to the Internet via PPP. Once you're connected, your machine may become vulnerable to attacks. Insert this in /etc/hosts.allow:
and this in /etc/hosts.deny:
If you belong to a network with direct Internet access, you had better disable finger, telnet, and possibly other services for security reasons; use ssh instead of telnet. The file to edit is /etc/inet.conf. Alternatively, you can restrict network access putting this in /etc/hosts.allow:
and this in /etc/hosts.deny:
3.5. NFS Exports
It is common to export home directories on the server; a problem arises if a user's UID and GID are not consistent across different machines. If user `guido' has UID/GID = 500 on server and UID/GID = 512 on client, a convenient configuration is this:
3.6. SambaAlmost trivial, but there's always a little bit to do. If you want to connect Windows 98/NT clients, did you remember to read the docs and, in case, enable clear text passwords? The distribution includes .reg files for Win9x/NT/2000; if your clients can't connect to the Linux server, load them on every client. Samba comes with a fairly complete sample /etc/smb.conf, but strangely it lacks a section showing how to (un)mount removable media. The clauses preexec and postexec do the trick:
Also: you know what Swat is, don't you? Enable it adding this line in your /etc/inetd.conf:
and this in /etc/services:
Restart inetd with SIGHUP, and point your browser to http://localhost:901. 4. Software ConfigurationThese are the the configuration files we are going to custimise: /etc/profile /etc/bashrc .bashrc .bashrc .bash_profile .bash_logout .inputrc .less .lessrc .xinitrc .fvwmrc .fvwm2rc95 .Xmodmap .Xmodmap.num .Xdefaults .jedrc .abbrevs.sl .joerc .emacs . Don't add users until you have completed your system configuration; you'll put the dot files in /etc/skel. 4.1. bash (1)Arguably, the most important piece of software after the kernel. To tailor the behaviour of bash, these are the main files to edit:
Examples of these files are shown below. First, the most important: /etc/profile. It's used to configure a lot of features in your Linux box, as you will see in the following sections. Please look out for reverse quotes!
This is a sample /etc/bashrc:
This is a sample .bashrc:
This is a sample .bash_profile:
This is a sample .inputrc:
To make the backspace and delete keys work correctly in xterm and other X11 applications, the following is also needed:
rxvt is a wee bit more complicated, as some compile--time options influence its behaviour. See the above /etc/profile. More info in bash (1) and readline (3) man pages. Don't expect every application to work correctly! If you run joe in xterm, for instance, some keys won't work; the same holds for some versions of rxvt. 4.2. I18n(This section doesn't apply to native English speakers.) A.k.a. ``internationalisation''. Gasp. This long word means ``to adapt Linux to your local conventions: language, format of date, currency etc.''. Although Red Hat has its own method for setting up i18n (/etc/sysconfig/i18n), you may want to enable your language only in some cases. I, for one, enabled i18n in kdm (via kdmconfig) and xfce, but want to read English messages when I work in console or xterm. Consider these lines:
If you insert them in your .xinitrc or .xsession just before the line that starts the window manager, you'll get internationalised messages - including those in xterms started from within the window manager. But if you'd rather get English messages, set the language to ``en'' and put the same lines in .bash_profile. 4.3. ls (1)ls can display directory listings using colours to highlight different file types. To enable this feature, you just need a couple of lines in /etc/profile as seen above. However, this won't work with old versions of rxvt; use some flavour of xterm instead. It looks like some old rxvts have a bug that prevents them from inheriting the environment correctly in some circumstances. 4.4. less (1)With this excellent pager you can browse not only plain text files, but also gzip compressed, tar and zip archives, man pages, and what have you. Its configuration involves a few steps:
4.5. EditorOnly the most popular will be covered here. 4.5.1. emacs (1)I rarely use emacs, so I have only a couple of tips for you. Some emacs distributions don't come preconfigured for colours and syntax highlighting. Put this in your .emacs:
This only works in X11. Moreover, to enable accented characters you'll add this line:
I'll leave it to you to peruse all of emacs' documentation to find out how to tailor it to your needs---potentially, it can take months of hacking. The Dotfile generator (Section Section 5) is a good helping hand. 4.5.2. joe (1)(Why use joe when jed is so small and powerful? Duh.) Some versions of joe don't work with colours in console, and some special keys don't work either. A quick and dirty (and inelegant) solution to the former problem is this:
To make the special keys work, all you have to do is edit .joerc, .jstarrc or your favourite emulation; you can start from the system-wide config files in /usr/lib/joe. Look for the fourth section (key bindings). This enables Home and End:
Find out the desired ESC sequences typing cat followed by the special keys. 4.5.3. jed (1)This is my favourite editor: it does what I need, it's lighter and easier to configure than emacs, and emulates other editors quite well. Many users at my university use jed to emulate EDT, VMS' system editor. jed's configuration files are .jedrc and /usr/lib/jed/lib/*; the former can be adapted from jed.rc in the latter directory.
4.6. pine (1)Edit the global configuration in /usr/lib/pine.conf, taking care at least of the following fields: user-domain, smtp-server, and nntp-server. Note that inbox-path depends on your MTA: if you use sendmail or postfix, that'll be var/spool/mail/$USER; with Qmail, /home/$USER/Mailbox (but root will use /var/qmail/alias/Mailbox. 4.7. minicom (1)Users can't use minicom unless a global configuration has been made by root. Remember to make it. 4.8. efax (1)This package is probably the most convenient for simple sending/receiving of faxes. You'll have to tailor the script /usr/bin/fax or (mandrake) /etc/fax.config; easy job, but a couple of quirks caused me quite a headache:
That done, there are a few permissions to fix to enable non-root users to send and receive faxes. The directories /var/lock and /var/spool/fax must be writable. To do so, create the group faxusers, add users to it, then type:
As a normal user, you'll issue newgrp faxusers before sendig a fax. 4.9. GhostscriptThis essential tool suffers from a small snag. Owing to to the well-known export regulations in the USA, the utility pdf2ps doesn't work with encrypted .pdf files. Never mind: point your browser to http://www.ozemail.com.au/~geoffk/pdfencrypt, download the file pdf_sec.ps and replace the file with the same name that comes with the Ghostscript distribution. 4.10. TeX and FriendsThe ``root'' of a TeX system is the directory $TEXMF, which is /usr/share/texmf in teTeX; other distributions may differ (search for ``texmf'' on your system). You normally add stuff or fiddle with files therein. 4.10.1. Expanding $TEXINPUTSTo include PostScript figures or TeX files that reside in subdirectories, it is convenient to expand TeX's search path to include subdirectories. Put this command in your .bash_profile:
which makes TeX search in $HOME/mylib before the default directories, and the directory ./figures afterwards. 4.10.2. Hyphen PatternsTo configure the hyphenation pattern for your language, edit the file $TEXMF/tex/generic/config/language.dat, then do:
Even if you don't write in English, don't remove the entry ``english''; TeX pukes without it. 4.10.3. dvips (1)To tailor dvips, the file to edit is $TEXMF/dvips/config/config.ps. Be aware that the fields regarding the default resolution also affect xdvi's behaviour; if you experience annoying attempts to create fonts each time you run it, put the line
in your .Xdefault. This should help. 4.10.4. Adding LaTeX PackagesAdditional LaTeX packages are available from your nearest CTAN (Comprehensive TeX Archive Network) mirror site, e.g. ftp://ftp.dante.de/pub/tex. Unpack the package under $TEXMF/tex/latex. If no .sty file exist, run the command latex newstyle.ins or latex newstyle.dtx to create it, then run the command texhash so that teTeX recognises the new package. 4.11. DocbookLaTeX is the best choice for typesetting, Docbook for multiformat documents (This HOWTO is written in Docbook.) Once you get all of the tools in place, you'll want to use simple scripts to avoid the complex command line. If these are not provided with the distribution, use the following db2pdf as template:
If you find that your PostScript od .PDF looks very bad, the file to hack is dbparams.dsl. In my Mandrake system, it's located in /usr/share/sgml/docbook/dsssl-stylesheets-1.57/print/. 4.12. Avoid PPProblems!I'll take it for granted that your kernel has PPP + TCP/IP support compiled in, that loopback is enabled, and that you already have the pppd package correctly installed and, if you will, set uid root. Obviously, your ISP must support PPP. There are now two ways to get PPP to work: a) manual configuration, and b) a configuration program that automagically sees to it. Whichever option you choose, have the following information on hand:
Manual configuration is a drudgery. It's about editing files and writing scripts; not too much work, but it's easy to make mistakes and newcomers are often intimidated. The PPP HOWTO is there for you. Alternatively, there are tools that ask for the information above and do all the work. Gnome and KDE include, respectively, gnome-ppp and kppp which are easy enough to set up. Alternatively, I suggest that you have a look at a couple of tty--based tools, wvdial and eznet. You feed them your ISP's phone number, your username, your password, and you're in business. Their home pages are at http://www.worldvisions.ca/wvdial and http://www.hwaci.com/sw/eznet. Both are great, but I prefer the latter. 4.12.1. A Quick Start with eznetFirst of all, create an /etc/resolv.conf like this:
where you'll insert the address of your ISP's nameserver. To create an account with eznet, issue the following command:
which creates the file /var/eznet/eznet.conf, owned by root.root with permissions 600; chmod it to 666 if you want it to be world readable. Now dial your ISP with eznet up YOUR_ISP. If the modem keeps waiting for the dial tone and won't connect, then try this command:
To hang up, the command is eznet down. That's all! 4.12.2. A Quick Start with wvdialwvdial's setup is even shorter. Type wvdialconf /etc/wvdial.conf, then edit the resulting file to include your username, password, and phone number. Try it out with wvdial, and keep your fingers crossed. To hang up, stop it with Ctrl-C. 4.13. POP ClientTo retrieve your mail from a POP3 server, you need a POP client. Most such clients require that you run an MTA like sendmail, qmail or postfix; a bit of an overkill on low-spec machines. However, there are clients that work without an MTA. The first kind is well represented by fetchmail; the second by fetchpop or frenchie. Sites: ftp://metalab.unc.edu/pub/Linux/system/mail/pop, http://www.lowcountry.com/~jscottb/tcltk.shtml. To configure these clients:
4.14. Basic Mail FilteringYou will want to protect yourself from spam or huge mail messages. There are two cases: 1) permanent connection to the net, 2) a POP link. In the first case, you can write a .procmailrc file, while in the second there are tools for checking the mail prior to fetching it. A very simple .procmailrc that defines a few rules:
man procmailex for further examples. POP users will want to use poppy, a useful Perl script for checking the mail before fetching it. Get it from ftp://metalab.unc.edu/system/mail/pop. 4.15. X Window System (XFree86)4.15.1. Setting Up the X ServerCome on, it's no longer as difficult as it used to be... All major distributions include a tool for setting up X11 (e.g. XConfigurator, sax, XF86Setup, or at least xf86config). X configuration is virtually automatic these days, but a few video cards may cause a headache. First of all, check out at the XFree86 site ( ftp://metalab.unc.edu/system/mail/pop) whether your video card is supported. If so, then try this procedure:
This has always worked for me, but your mileage may vary. Please note that most times X11 won't start because you chose wrong specs for your monitor! Start with conservative settings, i.e. 800x600 and 256 colours, then pump it up. Warning: these operations are dangerous and your monitor might be damaged! If your card isn't supported, you can either: 1) wait for the next version of XFree86; 2) buy a commercial X server; 3) buy a supported video card. Quartum non datur. 4.15.2. The X Startup SequenceThere are two ways to launch X11: from the console via startx, or directly via /etc/inittab. 4.15.3. KeypadWe have seen above how to make a few special keys work. The sample file .Xmodmap works well if you want to use Xjed, but it makes the keypad unusable. You'll then need another config file, which we'll call .Xmodmap.num:
Make sure that your /etc/X11/XF86Config does not contain these three lines:
and in case, comment them out. To re-enable the keypad, you'll issue the command xmodmap .Xmodmap.num. 4.15.4. Graphical Login with xdmTo be greeted by a graphical login, edit the file /etc/inittab, which should include a line like this:
where 5 is the runlevel corresponding to X11. Modify the line that defines the default runlevel (usually 2 or 3), changing it as above:
The number of colours is specified in /etc/X11/xdm/Xserver:
If you already have .xinitrc, copy it to .xsession and make the latter executable with chmod +x .xsession. Now issue the command telinit 5 and you're in business. 4.15.5. Window ManagerOnce X works, there are endless possibilities of configuration; it depends on the window manager you use, there are tens to choose from. Mostly, it's all down to editing one or more ASCII files in your home directory; in other cases you don't have to edit a thing, and use an applet or even a menu. Some examples:
In short: if you don't mind editing config file, choose something like icewm, fvwm*, blackbox etc; if you do mind, the choice is currently restricted to KDE, Gnome, WindowMaker, and Xfce. Email me if I'm wrong. It's important to have a good .xinitrc. An example:
Although it doesn't appear to be strictly required, make it executable with chmod +x .xinitrc. The .xinitrc above lets you choose the window manager: try
4.15.6. Defaults for X11 AppsFind out where the app-defaults directory is (it should be /usr/X11R6/lib/X11/app-defaults). Several apps keep a configuration file there. 4.15.7. Adding FontsRecent versions of XFree86 (say, > 3.3.4) use an X Font Server that supports PostScript Type 1 and True Type fonts natively, so you can use the wealth of fonts available on the net. There's a simple procedure to follow. Suppose that you downloaded a Type 1 font collection, e.g. Freefont ( ftp://ftp.gimp.org/pub/gimp/fonts/freefonts-0.10.tar.gz ). To make it visible to the font server, unpack the archive from /usr/X11R6/lib/X11/fonts/. Then edit /etc/X11/fs/config, add an entry for the new directory, and restart the font server. If you're rolling your own font collection, you'll need to supply the files fonts.dir and fonts.scale; the tool to make them is type1inst, available from http://http://goblet.anu.edu.au/~m9305357/type1inst.html . As for the True Type fonts, group them in a directory of your choice and create fonts.dir using ttmkfdirfonts.dir, included in the Freetype archive; http://www.freetype.org . Then proceed as above. For example, if you want to use the Windows fonts you have in, say, /mnt/win/windows/fonts, go to that directory, run ttmkfdir, edit /etc/X11/fs/config and restart the font server. It all started from the original True Type X font server: http://http://www.dcs.ed.ac.uk/home/jec/programs/xfsft/ . 4.16. Users' ConfigurationsWhen you're done editing the dot files, copy them to /etc/skel as seen in Section Section 4. 4.17. Making .rpmsrpm is such a wonderful method of keeping packages under control that I'm reluctant to install .tar.gz archives but in very few special cases (e.g., security). Whenever you install a tarball, consider turning it into an .rpm archive, then reinstall it; consult the RPM HOWTO. Also, if you use recent gcc versions, it may be advisable to put this in your /etc/rpmrc:
4.18. UpgradingIf you upgrade your machine, do your backup as usual and remember to save a few additional files. Some could be /etc/X11/XF86Config, /usr/bin/fax, all the stuff in /usr/local, the kernel configuration, the whole /etc, and all the mail in /var/spool/mail. Then it's time to upgrade (in rare cases, downgrade!) applications that your distribution ship with, and to add additional packages. Keep a list of these ones. 5. Configuration Software + DocsThere are several programs that make Linux easy to setup and configure. Some are becoming sort of standard: Red Hat, Caldera and other distributions ship with apps like setup, printtool, netcfg, usertool, etc, while S.u.S.E. ships with a comprehensive configuration program called Yast. Other useful programs are:
Documents on Linux configuration are popping up everywhere. One of the most complete is TrinityOS, http://www.ecst.csuchico.edu/~dranch/LINUX/index-linux.html . Bug the author to have him turn the document in nicer formats. A jolly good page is http://dotfiles.com. Just what it says - a collection of configuration files. 6. The End6.1. CopyrightCopyright (c) by Guido Gonzato, ggonza at tin.it. This document may be distributed only subject to the terms and conditions set forth in the LDP License at http://www.linuxdoc.org/COPYRIGHT.html, except that this document must not be distributed in modified form without the author's consent. If you have questions, please refer to the Linux Documentation Project home page, http://www.linuxdoc.org. 6.2. FeedbackPerhaps even more than other HOWTOs, this one needs and welcomes your suggestions, criticisms, and contributions. Not only is feedback welcome: it's necessary. If you think something is missing or wrong, please email me. If you have a distribution other than Red Hat/Mandrake and your config files are different or placed in other directories, please tell me and I'll include your tips. My aim is making life with Linux as easy as possible. Linux has a huge number of packages, so it's impossible to include directions for all of them. Please keep your requests/suggestions pertinent to the ``most reasonable'' programs---I'll leave it to your common sense. 6.3. DisclaimerThis document is provided ``as is''. I put great effort into writing it as accurately as I could, but you use the information contained in it at your own risk. In no event shall I be liable for any damages resulting from the use of this work. Many thanks to all other HOWTO authors and man pages writers/maintainers, whose work I've shamelessly pilfered; and to all people who provided me with feedback. I hope you'll find this work useful, though. Whenever I install a new Linux box, I actually do... Enjoy, Guido =8-) |