Needless to say, you first need to have Gentoo Linux installed
(
# emerge sync
A quick note is in order about the packages that I have chosen to discuss here. Gentoo Linux has a considerable wealth of window managers, mail transport agents, etcetera that can easily be installed. The specific packages that I have chosen to cover are not preferred by Gentoo Linux, they are simply packages that the author likes and/or knows how to configure. In other words, they're the packages on the author's own desktop.
Having installed Gentoo Linux and updated Portage, my first task is generally to install X and a desktop manager. X takes forever to compile, and KDE takes even longer, so I highly recommend doing this right before going to bed.
It's always useful to use the
# emerge --pretend kde # emerge kde-base/kde
Have a nice nap!
#export PKGDIR=/mnt/cdrom/gentoo/packages Normally Portage expects packages to be in /usr/portage/packages #emerge --usepkg /mnt/cdrom/gentoo/packages/All/kdebase-x.y.z.tbz2 The --usepkg flag makes sure that binary packages are used for the dependencies (if available).
I like using the console-based
#/usr/X11R6/bin/xf86config
Because I have a three-button mouse I choose not to enable
3-button emulation. Don't forget to add XKB support if you have an internation keyboard or need multiple language support.
You'll have to guess at a screen resolution and pixel depth that you'll like. I happen
to like 1280x1024 at 24bpp on my viewsonic, but that's only because it
doesn't work at a higher resolution. If you've never done this before,
don't be surprised if you end up running
If you're an X-configuring veteran, you may be used to making
a symbolic link from your mouse device to
# startx
If you configured X properly, running
If you have a wheel mouse you'll want to edit the XF86Config file by hand:
# cp /etc/X11/XF86Config /etc/X11/XF86Config.working # nano -w /etc/X11/XF86Config
Section "InputDevice" # Identifier and driver Identifier "Mouse1" Driver "mouse" Option "Protocol" "IMPS/2" Option "Device" "/dev/psaux" Option "ZAxisMapping" "4 5"
Because I have an intellimouse I changed the "Protocol" from "PS/2" to "IMPS/2". Getting the wheel to scroll just requires adding the 'Option "ZAxisMapping" "4 5"' line, where '4' and '5' correspond to mouse wheel up and mouse wheel down.
Run
#emerge nvidia-glx #emerge nvidia-kernel #nano -w /etc/X11/XF86Config
Section "Module" # This loads the GLX module # Load "glx"(Uncomment this line)
Section "Device" Identifier "NVIDIA GeForce" #Driver "nv" Driver "nvidia" #VideoRam 32768 # Insert Clocks lines here if appropriate EndSection
Run
# kdm
You should be able to log in and see KDE in full working order.
Of course sound shouldn't be working yet, so you'll miss the annoying
KDE start-up sound, but we'll fix that in a moment. Open a
konsole, type
All that's left is to make sure that X comes up when Gentoo boots.
Edit
# nano -w /etc/rc.conf
# What display manager do you use ? [ xdm | gdm | kdm ] DISPLAYMANAGER=kdm
Now we just need to make sure that the
# rc-update add xdm default
Reboot, and see if X comes up!
First, we have to install the necessary GNOME packages.
#emerge --pretend gnome #emerge gnome
This will take a good while to do, so kick back and watch a movie.
GNOME configuration is basically the same as KDE from this point forward. It is still necessary to edit XF86Config and set up the NVIDIA drivers and default desktop manager. Please consult above for these procedures.
A USB mouse is your friend on a high resolution screen. The kernel takes care of the scaling so you don't have to move your mouse five times across the pad to make it across the screen.
The first thing that has to be done is the installation of the kernel modules. The modules that will be needed for a USB mouse to work are usbmouse, mousedev, hid, usbcore, and input. After the necessary kernel configuration is done, insmod the modules.
Now, unplug the mouse, and plug it back in, and check your kernel log for a message that looks something like this
hub.c: USB new device connect on bus1/1, assigned device number 2 input0,hiddev0: USB HID v1.00 Mouse [Microsoft Microsoft IntelliMouseOptical] on usb1:2.0
Now that the mouse is detected, check
#cd /dev/input #cat mouse0 Move your mouse when you cat the device, you should see a lot of garbage.
Once the mouse is properly detected and installed, now we have to tell X to use the USB mouse. All that is required here is a slight change to what device X uses for the mouse.
# cp /etc/X11/XF86Config /etc/X11/XF86Config.working # nano -w /etc/X11/XF86Config
Section "InputDevice" # Identifier and driver Identifier "Mouse1" Driver "mouse" Option "Protocol" "IMPS/2" Option "Device" "/dev/input/mouse0" Option "ZAxisMapping" "4 5"
Okay, restart X, and the mouse should be working!
Don't forget to add the modules that your mouse uses to modules.autoload.
#echo $'/n'usbmouse $'/n'mousedev $'/n'hid #'/n'usbcore $'/n'input >> /etc/modules.autoload
Gentoo Linux supports Alsa for sound using the default kernel. Alsa can
be run with or without
# emerge alsa-driver
I am going to assume
here that you have
Now we set up the
# nano -w /etc/modules.d/alsa # update-modules
## ## IMPORTANT: ## You need to customise this section for your specific sound card(s) ## and then run `update-modules' command. ## Read alsa-driver's INSTALL file in /usr/share/doc for more info. ## ## ALSA portion alias snd-card-0 snd-emu10k1 alias snd-card-1 snd-emu10k1 alias snd-card-2 snd-emu10k1 alias snd-card-3 snd-emu10k1 alias snd-card-4 snd-emu10k1 alias snd-card-5 snd-emu10k1 alias snd-card-6 snd-emu10k1 alias snd-card-7 snd-emu10k1
You'll want to replace
You should also verify that
# nano -w /etc/devfsd.conf # rc-update add alsasound boot
# ALSA/OSS stuff # Comment/change these if you want to change the permissions on # the audio devices LOOKUP snd MODLOAD ACTION snd LOOKUP dsp MODLOAD LOOKUP mixer MODLOAD LOOKUP midi MODLOAD REGISTER sound/.* PERMISSIONS root.audio 660 REGISTER snd/.* PERMISSIONS root.audio 660
At this point the simplest method is to reboot. You still won't be able to hear any sound, though, because alsa keeps all sound channels muted by default.
# emerge alsa-utils # amixer Group 'Input Gain',0 Capabilities: volume mute jointly-mute Channels: Front-Left Front-Right Limits: min = 0, max = 15 Front-Left: 11 [73%] [mute] [---] Front-Right: 11 [73%] [mute] [---] Group 'Master Mono',0 Capabilities: volume mute capture exclusive-capture Capture exclusive group: 1 Channels: Front-Left Front-Right Limits: min = 0, max = 31 Front-Left: 23 [74%] [mute] [---] Front-Right: 23 [74%] [mute] [---] Group 'Headphone',0 Capabilities: volume mute jointly-mute Channels: Front-Left Front-Right Limits: min = 0, max = 31 Front-Left: 0 [0%] [mute] [---] Front-Right: 0 [0%] [mute] [---] Group 'Master',0 Capabilities: volume mute jointly-mute capture exclusive-capture Capture exclusive group: 1 Channels: Front-Left Front-Right Limits: min = 0, max = 63 Front-Left: 50 [79%] [mute] [---] Front-Right: 50 [79%] [mute] [---][chopped for brevity] # amixer set Master 100 unmute # amixer set PCM 100 unmute # aplay /usr/kde/3/share/sounds/pop.wav(pop.wav is part of KDE)
After installing the alsa utilities we use
You may want to emerge alsa-xmms as that will provide ALSA support for XMMS.
When you reboot your system, the
For standard kernel sound, you will have to recompile the
kernel if you didn't compile your sound module when you installed
gentoo.
If you chose to compile the sound driver as a module (not
compile it directly into the kernel), they you need to add
the module name (without the .o extension) to
# cd /dev # /usr/sbin/MAKEDEV audio
# cat /usr/kde/2/share/sounds/pop.wav > /dev/dsp # emerge media-sound/sox # play /usr/kde/2/share/sounds/pop.wav
If any sound at all results from cat'ing the .wav file to
KDE has some nice sound utilities, including the KDE sound mixer
# emerge --search kdemultimedia [ Results for search key : kdemultimedia ] [ Applications found : 1 ] * kde-base/kdemultimedia Latest version Available: 2.2.2 Latest version Installed: 2.2.2 Description: ${DESCRIPTION}Multimedia # kmix
I happen to like the
# emerge --pretend net-mail/postfix net-mail/mutt These are the packages that I would merge, in order. Calculating dependencies... done! [ebuild N ] dev-libs/libpcre-3.4-r1 to / [ebuild N ] net-mail/mailbase-0.00-r1 to / [ebuild N ] net-mail/postfix-20010228.2 to / [ebuild N ] net-mail/mutt-1.3.22.1 to / # emerge net-mail/postfix net-mail/mutt
If you only intend to use your mail server for sending mail,
then postfix is already set up for you. Otherwise, you'll
want to edit
Let's see if it works.
# postfix check # newaliases # postfix start postfix-script: starting the Postfix mail system # mutt -x root /root/.maildir does not exist. Create it? ([y]/n):[answer y] To: <root> Subject: test (End message with a . on a line by itself) test . # mutt[You should see your message]
By using
Assuming everything is working, then it's time to set up postfix so that it starts at boot time.
# postfix stop postfix-script: starting the Postfix mail system # rc-update add postfix default * postfix added to runlevel default... * Caching service dependencies... [ ok ] * rc-update complete. # /etc/init.d/postfix start Starting postfix...... [ ok ]
If you would prefer a GUI mail client, we install a web-based mail server,
Squirrelmail, later in this guide. Alternatively, Daniel Robbins highly
recommends a combination of IMAP (which we install below as a prerequisite to
Squirrelmail) and KDE's
# emerge --search kdenetwork [ Results for search key : kdenetwork ] [ Applications found : 1 ] * kde-base/kdenetwork Latest version Available: 2.2.2 Latest version Installed: 2.2.2 Description: ${DESCRIPTION}Network
Also below we will install Ximian's
For simple systems where you don't need
# emerge net-print/pdq # xpdq
Just click on
CUPS is a much larger print spooler that is fully suitable for
use as a large-scale print server. Fortunately it is pretty easy
to set up, since most of the configuration can be done using CUPS'
built-in web server. Although CUPS is nominally a System V
print spooler (meaning that it uses the
# emerge --pretend net-print/gimp-print-cups These are the packages that I would merge, in order. Calculating dependencies.. done! [ebuild N ] net-print/cups-1.1.10-r6 to / [binary N ] net-print/gimp-print-cups-4.1.1 to / # emerge gimp-print-cups # rc-update add cupsd default * cupsd added to runlevel default... * Caching service dependencies... [ ok ] * rc-update complete. # /etc/init.d/cupsd start Starting Common Unix Printing System...... [ ok ] # konqueror localhost:631
The
Configuring cups simply requires using a web browser to connect to the
web server that cups runs on the localhost network on port 631.
[Note that because the cups web server is configured
to accept requests only on localhost and
Samba is a remarkable package that lets your linux box share files
and printers with MS Windows machines. For more detailed information read
the Samba articles by Daniel Robbins at
# emerge net-fs/samba # rc-update add samba default # cd /etc/samba # cp smb.conf.example smb.conf # nano -w smb.conf
# workgroup = NT-Domain-Name or Workgroup-Name, eg: REDHAT4 workgroup = MYGROUP[change to match your workgroup]
# It should not be necessary to specify the print system type unless # it is non-standard. Currently supported print systems include: # bsd, sysv, plp, lprng, aix, hpux, qnx ; printing = bsd printing = cups
# You may wish to use password encryption. Please read # ENCRYPTION.txt, Win95.txt and WinNT.txt in the Samba documentation. # Do not enable this option unless you have read those documents encrypt passwords = yes
I have fairly minimal Samba needs. I just want to be able to share
files between my linux and windows machines, and I want to use my
linux box as a print server (using
# smbpasswd -a grant[Replace "grant" with your user name] New SMB password: Retype new SMB password: Added user grant.
For each user that you want to be able to use samba from a windows machine
you need to run the
# /etc/init.d/samba start Starting samba... [ ok ]
Start samba, and you should be able to connect to your Gentoo Linux
box from any of your windows machines and see the home directory for
whatever user you connect as and also whatever printers you have set up.
If you can't connect, take a look at
Assuming that you have a static IP address (or you use a service such as dyndns with your dynamic IP address), then you might want an effective way to check your e-mail when you're out of town. The solution that I have chosen is to set up a webmail server, Squirrelmail, that I can access remotely using any web browser.
The first step is to install a web server. Most of the rest of the world uses Apache; we will too. We will also install PHP (PHP4, actually) at the same time, since Squirrelmail is a PHP program. The version numbers shown in the code listing below might be different by the time you read this. Please adjust them accordingly. Don't just copy and paste the commands into your terminal!
# emerge net-www/apache dev-lang/php net-www/mod_ssl # ebuild /var/db/pkg/dev-lang/php-4.1.2-r7/php-4.1.2-r7.ebuild config # ebuild /var/db/pkg/net-www/mod_ssl-2.8.8/mod_ssl-2.8.8.ebuild config # nano -w /etc/apache/conf/apache.conf
You should take a good look at
# Do NOT add a slash at the end of the directory path. # DocumentRoot "/home/httpd/htdocs"(edit this line if desired)
# rc-update add apache default * apache added to runlevel default... * Caching service dependencies... [ ok ] * rc-update complete. # nano -w /etc/conf.d/apache
Use
APACHE_OPTS="-D SSL -D PHP4"
# /etc/init.d/apache start * Starting Apache... [ OK ] # lynx localhost
You can check to make sure your Apache web server is working
by using any browser to connect to localhost. To make sure that SSL support
is functional, use a browser to connect to
Now we need to make sure that PHP is working correctly. The first step is to create a simple PHP file and put it in the Apache DocumentRoot directory.
# echo "<? phpinfo(); ?>" > /home/httpd/htdocs/test.php # lynx http://localhost/test.phpphpinfo() (p1 of 26) PHP Logo PHP Version 4.0.6 System Linux my.server.edu 2.4.10 #1 Tue Oct 9 16:33:50 Local time zone must be set--see zic manuali686 i686 unknown Build Date Oct 16 2001
If you see something like the above, then Apache is successfully processing PHP code.
Squirrelmail is a PHP application, but it relies on an IMAP server as the glue between the web server and e-mail. Since Gentoo linux uses Maildir mail folders by default, Courier IMAP is a good choice.
# emerge net-mail/courier-imap # rc-update add courier-imapd default * courier-imapd added to runlevel default... * Caching service dependencies... [ ok ] * rc-update complete. # nano -w /etc/courier-imap/authdaemonrc # /etc/init.d/courier-imapd start # telnet localhost 143 Trying 127.0.0.1... Connected to localhost.localdomain. Escape character is '^]'. * OK Courier-IMAP ready. Copyright 1998-2001 Double Precision, Inc. See COPYING for distribution information. 1 LOGIN grant passwd##NAME: authmodulelist:0 # # The authentication modules that are linked into authdaemond. The # default list is installed. You may selectively disable modules simply # by removing them from the following list. The available modules you # can use are: authcustom authcram authuserdb authpam #authmodulelist="authcustom authcram authuserdb authpam" authmodulelist="authpam"(<-- replace "grant" w/ your username and "passwd" w/ your password) 1 OK LOGIN OK(Hit <ctrl>-"]" and type "quit" to exit)
If you want Courier IMAP to have SSL support you just need to make the IMAP SSL certificate (and tell courier-imap where to find it),
# /usr/sbin/mkimapdcert
and then start up imap-ssl.
# rc-update add courier-imapd-ssl default # /etc/init.d/courier-imapd-ssl start
You can verify that imap is working by using any IMAP-enabled mail client, such as netscape, kmail, or mutt.
# mutt -f imap://localhost
Fortunately, installing and configuring Squirrelmail, once all of the components are in place, is straightforward.
# emerge net-mail/squirrelmail # cd /home/httpd/htdocs # cd squirrelmail # ./configure
For squirrelmail to work correctly, you need to make sure that
all of the files are owned by the user that Apache runs
as (the squirrelmail ebuild assumes that user is "apache").
Use
SquirrelMail Configuration : Read: config.php --------------------------------------------------------- Server Settings 1. Domain : my.server.edu 2. IMAP Server : localhost 3. IMAP Port : 143 4. Use Sendmail/SMTP : SMTP 6. SMTP Server : localhost 7. SMTP Port : 25 8. Authenticated SMTP : false 9. Server : courier 10. Invert Time : false 11. Delimiter : detect R Return to Main Menu C. Turn color off S Save data Q Quit Command >>
Make sure that
SquirrelMail Configuration : Read: config.php --------------------------------------------------------- General Options 1. Default Charset : iso-8859-1 2. Data Directory : ../data/ 3. Attachment Directory : /tmp/ 4. Default Left Size : 150 5. Usernames in Lowercase : false R Return to Main Menu C. Turn color off S Save data Q Quit Command >>
I use the data directory in the package, although it would be
better security to use one outside the Apache document tree. I
also use
Before using squirrelmail, we first have to modify the PHP
configuration file,
# nano -w /etc/php4/php.ini # /etc/init.d/apache restart; You should do your best to write your scripts so that they do not require ; register_globals to be on; Using form variables as globals can easily lead ; to possible security problems, if the code is not very well thought of. ;register_globals = Off
Now you can browse to
# lynx https://localhost/squirrelmail/SquirrelMail - Login [sm_logo.jpg] SquirrelMail version 1.2.0 [rc2] By the SquirrelMail Development Team SquirrelMail Login Name: ____________________ Password: ____________________ Login
(I don't really suggest using lynx with Squirrelmail, but you could!)
Evolution is an exceptionally nice Personal Information Management
tool that syncs with a Palm pilot quite well. The first step is
to emerge evolution. If you do intend to use evolution with a
Palm pilot, make sure "pda" is in your USE variables in
# emerge --pretend net-mail/evolution These are the packages that I would merge, in order. Calculating dependencies................................ done! [ebuild N ] app-text/ghostscript-6.50-r2 to / [ebuild N ] app-text/tetex-1.0.7-r4 to / [ebuild U] media-libs/freetype-2.0.5-r1 to / [ebuild N ] gnome-base/ORBit-0.5.12-r1 to / [ebuild N ] media-libs/giflib-4.1.0-r3 to / [ebuild N ] media-libs/imlib-1.9.10-r1 to / [ebuild N ] gnome-base/gnome-libs-1.4.1.2-r2 to / [ebuild N ] dev-libs/libxml-1.8.16 to / [ebuild N ] gnome-base/libglade-0.17-r3 to / [ebuild N ] media-libs/gdk-pixbuf-0.14.0 to / [ebuild N ] gnome-base/gnome-print-0.34 to / [ebuild N ] dev-libs/popt-1.5 to / [ebuild N ] dev-util/intltool-0.12 to / [ebuild N ] gnome-base/oaf-0.6.7 to / [ebuild N ] gnome-base/bonobo-1.0.17 to / [ebuild N ] dev-libs/libunicode-0.4-r1 to / [ebuild N ] dev-util/guile-1.5.4 to / [ebuild N ] gnome-base/gconf-1.0.7-r2 to / [ebuild N ] gnome-base/gnome-vfs-1.0.3 to / [ebuild N ] gnome-extra/gal-0.18.1 to / [ebuild N ] gnome-base/control-center-1.4.0.1-r3 to / [ebuild N ] dev-libs/pilot-link-0.9.6-r3 to / [ebuild N ] app-text/scrollkeeper-0.2 to / [ebuild N ] gnome-base/gnome-core-1.4.0.4-r3 to / [ebuild N ] gnome-extra/gnome-pilot-0.1.64 to / [ebuild N ] gnome-base/libghttp-1.0.9-r1 to / [ebuild N ] gnome-extra/gtkhtml-1.0.0 to / [ebuild N ] gnome-extra/bonobo-conf-0.14 to / [ebuild N ] app-arch/zip-2.3-r1 to / [ebuild N ] app-arch/unzip-5.42 to / [ebuild N ] net-www/mozilla-0.9.6-r4 to / [ebuild N ] net-mail/evolution-1.0-r2 to / # emerge net-mail/evolution
Unfortunately, the evolution build takes slightly longer than forever
(notice that
While building
# groupadd serial # chown root.serial /dev/tts/0 # chmod g+rw /dev/tts/0 # ls -l /dev/tts/0 crw-rw---- 1 root serial 4, 64 Dec 31 1969 /dev/tts/0 # ln -s /dev/tts/0 /dev/pilot # nano -w /etc/group(add appropriate users to the serial group)
We've added a "serial" group to the system, and you should add any users who need
to use the serial port (any Palm pilot users) to the serial group. We've given
the serial group "rw" permissions on
Users will want to use the