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.
The emerge/install process of X will take awhile on even a quick system. The system is quite large, so be prepared to read a book, take a nap, etc.
To emerge X, all that you have to do is type:
# emerge xfree # env-update && source /etc/profile
After this rather long process is completed, configuration will begin.
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
international 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
Another way to configure XFree86 is to use
See
If you're an X-configuring veteran, you may be used to making
a symbolic link from your mouse device to
If you choose to use XFS (the XFontServer ), follow the appropriate instructions
below. Using XFS is highly recommended, as it makes font configuration
# rc-update add xfs default # /etc/init.d/xfs start # 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.
If you have a wheelmouse and
Run
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
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 IntelliMouse Optical] on usb1:2.0
Now that the mouse is detected, check
# cd /dev/input # cat miceMove your mouse when you cat the device, you should see a lot of garbage. To exit, simply press control-C.
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/mice" 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
# nano -w /etc/modules.autoload.d/kernel-2.4# We will add the following lines to the file. mousedev hid usbcore input
If you happen to have an NVIDIA card, now would be a good time to install the NVIDIA accelerated drivers.
# emerge nvidia-glx # emerge nvidia-kernel # nano -w /etc/X11/XF86Config # modprobe nvidia
# nano -w /etc/modules.autoload.d/kernel-2.4(We will add the following line to the file.) nvidia
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 startx one more time to make sure that X still comes up (this time with the NVIDIA splash screen, if you have installed the nvidia drivers).
Generally, the first thing to do after installing X is to install a nice window manager. Of course, you can stick to tvm if you want a really ugly, I mean functional, window manager.
There are many window managers to choose from. Some of these include KDE, GNOME, Fluxbox, Blackbox, the other *box 'es, Windowmaker, Sawfish, etc. As you can see, there is a nice selection of windowmanagers availible in Gentoo Linux.
I am assuming that you are going to install KDE if you are reading this section. KDE is fully supported in Gentoo Linux, but there are a couple of things that you want to make sure of before you emerge KDE:
Both of the above steps can be done by editing
# nano -w /etc/make.confInside of make.conf USE="qt kde -gnome -gtk"
To find out more about USE variables, please reference the
It's always useful to use the
# emerge --pretend kde # emerge kde # env-update && source /etc/profile
Now take a look inside
XSESSION="kde-3.1.2"
If you don't want to install KDE with all its components (which is what
Package | Description |
---|---|
Have a nice nap!
# export PKGDIR=/mnt/cdrom/packages(Normally Portage expects packages to be in /usr/portage/packages) # emerge --usepkg /mnt/cdrom/packages/All/kdebase-x.y.z.tbz2(The --usepkg flag makes sure that binary packages are used for the dependencies (if available).) # env-update && source /etc/profile
After KDE is installed, it maybe preferable to use a nice login manager, specifically the KDE login manager, or KDM. KDM comes with the KDE packages, so to run it all you have to do is:
# 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/KDE comes up!
Before you start installing GNOME packages, you might want to edit your USE variables. Doing this will enable GNOME support in supported applications that you compile.
Both of the above steps can be done by editing
# nano -w /etc/make.conf(Inside of make.conf) USE="gnome gtk -kde -qt"
To find out more about USE variables, please reference the
Now, install the necessary GNOME packages.
# emerge --pretend gnome # emerge gnome # emerge xscreensaver # env-update && source /etc/profile
This will take a good while to do, so kick back and watch a movie. Author recommends Pulp Fiction.
Now open up
XSESSION="Gnome"
GNOME configuration is basically the same as KDE from this point forward. There are not really any GNOME specific configuration files, but there is GDM, the GNOME login manager, to setup.
After GNOME is installed, it maybe preferable to use a nice login manager, specifically the GNOME login manager, or GDM. GDM comes with the GDE packages, so to run it all you have to do is:
# gdm
You should be able to log in and see GDM in full working order.
Of course sound shouldn't be working yet, so you'll miss the annoying
GNOME start-up sound, but we'll fix that in a moment. Open a
console, 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=gdm
Now we just need to make sure that the
# rc-update add xdm default
Reboot, and see if X/GNOME comes up!
To install ALSA, please refer to the
KDE has some nice sound utilities, including the KDE sound mixer
You may want to try
I happen to like the
# emerge postfix 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
# RECEIVING MAIL # The inet_interfaces parameter specifies the network interface # addresses that this mail system receives mail on. By default, # the software claims all active interfaces on the machine. The # parameter also controls delivery of mail to user@[ip.address]. # #inet_interfaces = all #inet_interfaces = $myhostname #inet_interfaces = $myhostname, localhost inet_interfaces = $myhostname, localhost mydestination = $myhostname, localhost.$mydomain
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: stopping 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
Below we will also install Ximian's
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 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 mod_php (PHP-support for Apache) at the same time, since Squirrelmail is a PHP program.
# emerge apache mod_php
You should take a good look at
# Do NOT add a slash at the end of the directory path. # DocumentRoot "/var/www/localhost"(edit this line if desired)
# rc-update add apache2 default * apache2 added to runlevel default... * Caching service dependencies... [ ok ] * rc-update complete. # nano -w /etc/conf.d/apache2
Use
APACHE2_OPTS="-D SSL -D PHP4"
# /etc/init.d/apache2 start * Starting Apache... [ OK ] # links 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.
# nano -w /var/www/localhost/test.php <?php phpinfo(); ?> # links http://localhost/test.php
phpinfo() (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 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(<-- replace "grant" w/ your username and "passwd" w/ your password) 1 OK LOGIN OK(Hit <ctrl>-"]" and type "quit" to exit)
##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"
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
# mutt -f imaps://localhost
Fortunately, installing and configuring Squirrelmail, once all of the components are in place, is straightforward.
# emerge squirrelmail # cd /var/www/localhost # 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
Now we just need to restart Apache, and we will be ready to go!
# /etc/init.d/apache2 restart
Now you can browse to
# links 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 links 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 evolution # emerge 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