stevesearle.com
Home
Champions
Techie Stuff
FAQ
Automake and Autoconf
MySQL and C++
CentOS 5.0 Server
Fedora 7 Workstation
Customise that Desktop
Blocking Online Ads
Downloads
Spam

Viewable With Any Browser

Valid HTML 4.01!
© Steve Searle 1999, 2006
Created and maintained using
Vim
Techie Stuff - GNU/Linux Workstation Setup (Fedora Core 5)

Fedora Project Well Fedora Core 5 is out, so time to update my workstations. These are the instructions I follow to install and configure it.

Contents
Install Fedora Core 5
Stop unnecessary daemons
Update packages
Configure miscellaneous settings
Configure Sendmail
NFS exports and other mounts
Backups
Install anti-virus
Install Uptimed
Update Perl
Install Webmin
Install Vim
Install Mutt
Install MPlayer
Using Grip for MP3s
Install Keychain
Install RealVNC
Install rdesktop
Install HTML Tidy
Install KDirStat
Customise
Install Fedora Core 5

Fedora Project These instructions are for installing Gnu/Linux onto a PC. If you have existing data or an operating system on the machine you are installing on, ensure that you know what you are doing, and that you have a full backup in case you overwrite anything you meant to keep.

These instructions are for installing the x86-compatible (32-bit) version of Fedora. Anything different that needs to be done for the x86_64 (64-bit AMD64, EM64T) version are shown in green, like this.

  1. Use the torrent to download the installation CDs or DVD from here, and burn the iso(s). Bittorrent
  2. Boot from the first CD.
  3. Press <ENTER> to install in graphical mode.
  4. Skip the media test unless it has not been previously tested.
  5. Click Next to start the install.
  6. Leave the language as English (English) and click Next.
  7. Select the United Kingdom keyboard and click Next.
  8. Select Install Fedora Core and click Next.
  9. Select Create custom layout and click Next.
  10. Delete any existing partitions and create the new ones according to the size of the hard drive(s). The /common and /img directories are non standard ones I create for my own use.
    fanny: 40Gb hard drive
    hda1   150 MB   /boot
    hda24,000 MB/home
    hda33,500 MB/var
    hda52,000 MB/tmp
    hda61,000 MB(swap)
    hda727,500 MB/
    gina: 80Gb hard drive
    hda1   1,000 MB   /boot
    hda237,000 MB/
    hda317,500 MB/home
    hda54,000 MB/var
    hda64,000 MB/tmp
    hda710,000 MB/common
    hda83,000 MB/img
    hda92,000 MB(swap)
    jenny: 190Gb hard drive
    hda1   1,000 MB   /boot
    hda2112,000 MB/
    hda322,000 MB/home
    hda525,000 MB/var
    hda65,000 MB/tmp
    hda720,000 MB/common
    hda83,000 MB/img
    hda72,000 MB(swap)
    Click Next.
  11. Leave the GRUB settings unchanged and click Next.
  12. Leave the Network Devices settings unchanged (i.e. use DHCP). Set the hostname, but don't enter a domain (e.g. fanny not fanny.stevesearle.com). Click Next.
  13. Select Europe/London and System clock uses UTC and Next.
  14. Set and confirm the Root Password and click Next.
  15. Select Office and Productivity and Software Development and Customize now. Click Next.
  16. Select/deselect packages as follows.
    Desktop Environments Select KDE (K Desktop Environment)
    Applications Editors Deselect vim-enhanced (I prefer to build my own version)
    Games and Entertainment Select kdegames
    Graphical Internet Deselect evolution
    Graphical Internet Select gftp
    Office/Productivity Select gnucash
    Sound and Video Select k3b
    Text-based Internet Deselect mutt (I prefer to build my own version)
    Development Select KDE Software Development
    Servers MySQL Database mysql-devel
    Click Next.
  17. Click Next and continue the installation.

Change CDs as prompted, and click on Reboot when the installation is complete.

  1. Click Forward at the Welcome screen.
  2. Accept the license and click Forward.
  3. Accept the default firewall settings (only SSH allowed) and click Forward.
  4. Change SELinux Setting: to Disabled and click Forward. Click Yes when prompted about rebooting.
  5. Click Forward at the Date and Time screen.
  6. Set an appropriate screen resolution and click Forward.
  7. Set yourself up as a user and click Forward.
  8. Test the sound card and click Finish.
  9. Click OK at the reboot prompt.

IMPORTANT - For machines that have an ATI Radeon card, specifically gina with a Radeon 7000/VE, a change needs to be made to stop the X Window System locking up when it is launched. Edit /etc/X11/xorg.conf and comment out the load "dri" line.

 #	load  "dri"

Contents

Stop unnecessary daemons

By default, Fedora installs with a number of daemons that I don't need. Turning these off saves system resources and makes the machine more secure.

 # chkconfig avahi-daemon off
 # service avahi-daemon stop
 # chkconfig bluetooth off
 # service bluetooth stop
 # chkconfig hidd off
 # service hidd stop
 # chkconfig cpuspeed off
 # service cpuspeed stop
 # chkconfig irqbalance off
 # service irqbalance stop
 # chkconfig isdn off
 # service isdn stop
 # chkconfig lm_sensors off
 # service lm_sensors stop
 # chkconfig mdmonitor off
 # service mdmonitor stop

Contents

Update packages

Yellow dog Updater, ModifiedRun yum to update any RPM packages that are out of date.

 # yum update

Enable the yum daemon, which uses a daily cron job to get the updates automatically.

 # chkconfig yum on
 # service yum start

Clean the old yum headers occaisionally with a monthly cron job to run.

 yum clean all

Now use yum to install the following:

 # yum install alacarte
 # yum install bittorrent-gui
 # yum install compat-gcc-32-c++
 # yum install easytag
 # yum install grip
 # yum install gtk+-devel
 # yum install mail-notification
 # yum install multitail
 # yum install pan
 # yum install sendmail-cf
 # yum install unison
 # yum install xscreensaver-gl-extras
 # yum remove gnome-screensaver

Contents

Configure miscellaneous settings

Customise the shell prompt by adding the following lines to the end of /etc/bashrc.

 ColourFuscia="\[\033[0;36m\]"
 ColourGreen="\[\033[0;32m\]"
 ColourDefault="\[\033[0m\]"
 
 # Set green to red if root
 if [ "$UID" = "0" ]; then
        ColourGreen="\[\033[1;31m\]"
 fi
 
 PS1="$ColourGreen($ColourFuscia\u@\h$ColourGreen:$ColourFuscia\w$ColourGreen)$ColourFuscia\\$ $ColourDefault"


Change the resolution of the virtual terminals (running on Ctrl-Alt-1 through Ctrl-Alt-6). Edit /boot/grub/grub.conf and add vga=791 to the end of the menu kernel line, e.g.

 kernel /vmlinuz-2.4.20-30.9 ro root=LABEL=/ hda=ide-scsi vga=790

790 produces a 1024x768 resolution with 32,768 colours. You could use any of the following (if you video card supports them).

Colours 640x480 800x600 1024x768 1280x1024 1600x1200
256 769 771 773 775 796
32,768 784 787 790 793 797
65,536 785 788 791 794 798
16.8M 786 789 792 795 799

The bios on gina.stevesearle.com is from the year 2000, so fails the cutoff date. To get round this and run the acpid daemon, add acpi=force to the /boot/grub/grub.conf, as follows.

 ...
 kernel /vmlinuz-2.6.11-1.27_FC3 ro acpi=force root=LABEL=/1 vga=795
 ...

Keep /tmp tidy. Create a script in /etc/cron.daily containing the following lines. It will delete files and directories that are more than a week old.

 find /tmp -mtime +7 -type f -print -exec rm {} ";"
 find /tmp -empty -mtime +7 -type d -print -exec rm -rf {} ";"

Contents

Configure Sendmail

Sendmail Sendmail is a mail transfer agent. MTAs are used to transfer messages between machines. Normally Sendmail will send out any mail with headers showing it as coming from the local client - in my case a from address of steve@gina.stevesearle.com. So the following changes to the Sendmail configuration make it look as if the email has come from steve@stevesearle.com. To do this, the following lines are added to the /etc/mail/sendmail.mc file (uncomment - remove dnl ... dnl - and edit where neccessary). The MAIL_HUB line is added at the end of the first block of defines and causes email that would otherwise have been delivered to a local user on the machine to be sent to the network mail server.

 ...
 define(`SMART_HOST', `marilyn.stevesearle.com.')
 ...
 define(`MAIL_HUB', `relay:stevesearle.com.')
 ...
 MASQUERADE_AS(`stevesearle.com')
 ...
 FEATURE(masquerade_envelope)
 ...

Note that the EXPOSED_USER line in /etc/mail/sendmail.mc will prevent mail sent by root from being masqueraded, this should be removed if this is a problem.

Regenerate the /etc/mail/sendmail.cf (note the sendmail-cf package must be installed for this to work, and no warnings are displayed if it isn't installed).

 # make -C /etc/mail

Restart sendmail.

 # service sendmail restart

Create a .forward file to ensure that any mail to root gets read. Ensure that it is only writable by the user, otherwise it will be ignored.

 # chmod 644 ~/.forward

Contents

NFS exports and other mounts

Add mount points for any NFS exports from other machines, by editing /etc/fstab and adding the appropriate lines, e.g.

 hayley:/backups        /backups        nfs     rsize=8192,wsize=8192

This would automatically mount hayley's /backups directory under /backups on this machine. (Permission would have to be granted on hayley via the /etc/exports file to allow this.) Don't forget to create the /backups directories on the local machine.

Contents

Backups

I run an old machine as a backup device. A backup folder is NFS exported to the rest of the network, and each machine runs a cron tar job to back up various files and directories.

Contents

Install anti-virus

Clam AntiVirusThese instructions have been derived from the excelent SpamAssassin-ClamAV-Procmail-Howto.

Download Clam AntiVirus to /tmp.

Create a user group and user.

 # groupadd clamav
 # useradd -g clamav -s /bin/false -c "Clam AntiVirus" clamav

Install.

 $ cd /tmp
 $ tar -xzf clamav-0.80.tar.gz
 $ cd clamav-0.80
 $ ./configure
 $ make
 $ su -c "make install"

Edit both /usr/local/etc/clamd.conf and /usr/local/etc/freshclam.conf and remove or comment out the Example directive.

 ...
 # Comment or remove the line below.
 # Example
 ...

Create /etc/init.d/clamd as follows.

#!/bin/bash

 TMPDIR=/tmp
 PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin

 case "$1" in
	start)
		echo "Starting ClamAV..."
		if [ -S /tmp/clamd ]; then
			echo "ClamAV is already running!"
		else
			/usr/local/bin/freshclam -d -c 10 --datadir=/usr/local/share/clamav
		  	/usr/local/sbin/clamd
	  	fi
  		echo "ClamAV is now up and running!"
  	;;
	stop)
  		echo "Shutting down ClamAV..."
	  	array=(`ps ax | grep -iw '/usr/local/bin/freshclam' | grep -iv 'grep' \
	   		| awk '{print $1}' | cut -f1 -d/ | tr '\n' ' '`)
	   	element_count=${#array[@]}
   		index=0
	   	while [ "$index" -lt "$element_count" ]
		do
 			kill -9 ${array[$index]}
		   	let "index = $index + 1"
	   	done
   		array=(`ps ax | grep -iw '/usr/local/sbin/clamd' | grep -iv 'grep' \
   			| awk '{print $1}' | cut -f1 -d/ | tr '\n' ' '`)
		element_count=${#array[@]}
	   	index=0
		while [ "$index" -lt "$element_count" ]
		do
			kill -9 ${array[$index]}
			let "index = $index + 1"
		done
		if [ -S /tmp/clamd ]; then
			rm -f /tmp/clamd
		fi
		echo "ClamAV stopped!"
	;;
	restart)
		$0 stop && sleep 3
		$0 start
	;;
	*)
		echo "Usage: $0 {start|stop|restart}"
		exit 1
 esac
 exit 0

Make it executable and start it.

 # chmod  755 /etc/init.d/clamd
 # /etc/init.d/clamd start

Make it start at boot up and stop at close down.

 # ln -s /etc/init.d/clamd /etc/rc2.d/S20clamd
 # ln -s /etc/init.d/clamd /etc/rc3.d/S20clamd
 # ln -s /etc/init.d/clamd /etc/rc4.d/S20clamd
 # ln -s /etc/init.d/clamd /etc/rc5.d/S20clamd
 # ln -s /etc/init.d/clamd /etc/rc0.d/K20clamd
 # ln -s /etc/init.d/clamd /etc/rc1.d/K20clamd
 # ln -s /etc/init.d/clamd /etc/rc6.d/K20clamd

Schedule the following command to run regualry to check for viruses.

 /usr/local/bin/clamscan -ir --stdout /

Contents

Install Uptimed

Uptimed is used to keep track of the highest uptimes my GNU/Linux computers have.

Download it, and build and install it with

 $ cd /tmp
 $ tar -xjf uptimed-0.3.1.tar.bz2
 $ cd uptimed-0.3.1
 $ ./configure
 $ make
 $ su -c "make install"

Then add the following to /etc/rc.d/rc.sysinit to create a unique id each time the server is booted.

 echo "Creating unique uptime daemon bootid..."
 /usr/local/sbin/uptimed -b

Now add these lines to /etc/rc.d/rc.local to start the uptime daemon.

 echo "Starting uptime daemon..."
 /usr/local/sbin/uptimed

Rename uptimed.conf-dist

 # mv /usr/local/etc/uptimed.conf-dist /usr/local/etc/uptimed.conf

then edit this to set the EMAIL and SEND_EMAIL variables.

Reboot and enter:

 $ uprecords

to see how long the server has been up for.

Contents

Update Perl

Perl CPAN Download various perl modules as follows. The SSLeay stuff is needed to use SSL with Webmin. You need to be on-line for this.

 # perl -MCPAN -e shell
 cpan> install MD5
 cpan> install Bundle::CPAN
 cpan> reload CPAN
 cpan> install Net::SSLeay
 cpan> exit

Contents

Install Webmin

Webmin Install Webmin, a browser based tool for administering and configuring the system.

The tarball should be un-tarred in /usr/local or similar, as this is just configured in the directory it was un-tarred in.

 # cd /usr/local
 # tar -xzf webmin-1.130.tar.gz
 # cd webmin-1.130
 # ./setup.sh

If you want to access the webmin from another machine, you need to change the firewall settings. Add the following line to /etc/sysconfig/iptables (immediately before the -A RH_Firewall-1-INPUT -j... line).

 -A RH-Firewall-1-INPUT -p tcp -m tcp -m state --dport 10000 --state NEW -j ACCEPT

Restart the firewall.

 # service iptables restart

Contents

Install Vim

Vim Download and install Vim, the best editor around.

 $ cd /tmp
 $ tar -xjf vim-6.2.tar.bz2
 $ cd vim62
 $ make
 $ su -c "make install"

Add the following line to your /etc/bashrc, to make Vim the default editor for mutt, crontab, etc. The "-f" will prevent it forking when invoked, and will avoid the update encoding warning when editing an email.

 export EDITOR="gvim -f"

Contents

Install Mutt

Mutt Mutt is my email client of choice. Dowload it and build it.

 $ cd /tmp
 $ tar -xzf mutt-1.4.2.1i.tar.gz
 $ cd mutt-1.4.2.1
 $ ./configure --enable-pop --enable-imap --with-ssl
 $ su -c "make install"

Now install urlview, a utility that will fire up the browser to display any URLs in any emails.

 $ cd /tmp
 $ tar -xzf urlview-0.9.tar.gz
 $ cd urlview-0.9
 $ ./configure
 $ make
 $ su -c "make install"
 $ su -c "cp url_handler.sh /usr/local/bin"

Edit /usr/local/bin/url_handler.sh to select the preferred browser. Change any occurances of /usr/X11R6/bin/netscape to /usr/bin/firefox.

Contents

Install MPlayer

MPlayer Install MPlayer which is brilliant for watching mpegs, etc. Build and install it.

 $ cd /tmp
 $ tar -xjf essential-20060611.tar.bz2
 $ cd essential-20060611
 $ su -c "mkdir /usr/local/lib/codecs"
 $ su -c "cp * /usr/local/lib/codecs"
 $ cd /tmp
 $ tar -xjf MPlayer-0.92.tar.bz2
 $ cd MPlayer-0.92
 $ ./configure --enable-gui --enable-largefiles --enable-menu --cc=gcc32
 $ make
 $ su -c "make install"
 $ cd /tmp
 $ tar -xjf font-arial-iso-8859-1.tar.bz2
 $ cd font-arial-iso-8859-1/font-arial-18-iso-8859-1
 $ su -c "cp * /usr/local/share/mplayer/font"
 $ cd /tmp
 $ tar -xjf Blue-1.4.tar.bz2
 $ su -c "cp -r Blue /usr/local/share/mplayer/skins/default"

Enter gmplayer to run the gui version.

Contents

Using Grip for MP3s

Grip To use Grip to rip MP3s, it needs to be configured to use LAME. Use Yum to downloads them (see Update packages).

To use LAME from Grip, change Config->Encode->Encoder, set Encoder executable to /usr/local/bin/lame and set Encode file format to /music/%A/%d/%t%n.mp3.

Contents

Install Keychain

Keychain is a script that makes the use of ssh-agent to ssh into other machines without entering passwords simple and easy. This section was put together with using Kimmo Suominen's Getting started with SSH. Download and install Keychain with

 $ cd /tmp
 $ tar -xjf keychain-2.0.3.tar.bz2
 $ cd keychain-2.0.3
 $ su -c "install -m0755 keychain /usr/bin/keychain"

Generate a public/private dsa key pair.

 $ ssh-keygen -t dsa
 $ ssh-keygen -t rsa

Enter a passphrase when prompted. Then copy the public keys to all the machines you wish to connect to.

 $ scp .ssh/id_dsa.pub steve@emma:

On the machine you wish to connect to, add the contents of the file you have just copied to authorized_keys in .ssh directory. Also make sure that only you can write to the .ssh directory and the authorized_keys file.

 $ cd     
 $ cat id_dsa.pub >> ~/.ssh/authorized_keys
 $ chmod go-w .ssh .ssh/authorized_keys

Now alter ~/.bash_profile to run keychain when you log in. If it is not already running, it will be started and you will be prompted for the passphrase, but then this will be remembered until the machine is rebooted.

 keychain ~/.ssh/id_rsa ~/.ssh/id_dsa
 . ~/.keychain/${HOSTNAME}-sh

Contents

Install RealVNC

Real VNC VNC is remote control software that allows you to interact with other computers on the network. I use it to manage the Windows boxes on the network.

Extract the source tarball and ./configure and make. To install, switch to root and enter

 $ cd /tmp
 $ tar -xzf vnc-3.3.7-unixsrc.tar.gz
 $ cd vnc-4_1_1-unixsrc/unix
 $ ./configure
 $ make
 $ su -c "./vncinstall /usr/local/bin"

Launch a VNC server on the target machine, and then run vncviewer on the client to take control.

 $ vncviewer

Contents

Install rdesktop

rdesktop Install rdesktop an an open source client for Windows NT Terminal Server and Windows 2000/2003 Terminal Services. Download and install.

 $ cd /tmp
 $ tar -xzf rdesktop-1.3.1.tar.gz
 $ cd rdesktop-1.3.1
 $ ./configure
 $ make
 $ su -c "make install"

To connect to server angie as administrator with a 1024x768 screen resolution, use

$ rdesktop -u administrator -g 1024x768 angie

Contents

Install HTML Tidy

HTML Tidy HTML Tidy is a great application for tidying up HTML source code. Download it to /tmp and build and install with

 $ cd /tmp
 $ tar -xzf tidy_src.tgz
 $ cd tidy
 $ /bin/sh build/gnuauto/setup.sh
 $ ./configure --prefix=/usr
 $ make
 $ su -c "make install"

Contents

Install KDirStat

KDirStat I use KDirStat to monitor diskspace and identify what it is being used for. It is a great utility that graphically represents file sizes, so that you can easily identify where and who the largest users of filespace are.

Download it to /tmp and build and install with

 $ cd /tmp
 $ tar -xjf kdirstat-2.4.0.tar.bz2
 $ cd kdirstat-2.4.0
 $ ./configure
 $ make
 $ su -c "make install"

Contents

Customise

The following steps are personal customisations I setup for my own user.

To share a set of personal files in my user, I have a directory on the server that is mounted on each workstation. A similar situation exists so I can easily maintain the development version of my web site. These are setup as follows.

Add these lines to /etc/fstab.

 ingrid:/home/steve/share  /home/steve/share       nfs     user,exec,rsize=8192,wsize=8192
 ingrid:/var/www/steve     /home/steve/www         nfs     user,rsize=8192,wsize=8192

Then create mountpoints and mount these files.

 $ cd ~
 $ mkdir share
 $ mount share
 $ mkdir www
 $ mount www

Now create links to my standard muttrc, vimrc amd sig files and gpg directory.

 $ cd ~
 $ ln -s share/.muttrc
 $ ln -s share/.vimrc
 $ ln -s share/.signature
 $ ln -s share/.gnupg

Now setup the directory for the Mutt SSL certificates file.

 $ cd ~
 $ mkdir .mutt

Now create an icon on the panel to run Mutt. Right-click on the panel and select Add to Panel.... Select Custom Application Launcher. Set Name: to Mutt, Comment: to Email client and command: to gnome-terminal --geometry 120x40 --hide-menubar --window-with-profile=dark -t "Mutt" -x mutt. Click on Icon: and select an appropriate one. Click OK. Profile dark needs to be set up from within a gnome-terminal for this to work.

Now set GNOME to use Mutt as the default mail client. From the Desktop menu select Preferences -> More Preferences -> Preferred Applications and select Mutt as the Mail Reader.

Right-click on the original panel email icon and remove it. Remove other panel icons as preferred.

Use the shared Firefox bookmark file. This needs to be backed up first, as when you change the Firefox bookmarks file, it overwrites it. Seems daft to me.

 $ cp ~/share/.bookmarks.html /tmp

In Firefox, enter about:config as the URL. Right click on the screen, and select New -> String. Set the preference name to browser.bookmarks.file and the string value to /home/steve/share/.bookmarks.html. Exit Firefox, and restore the bookmarks file.

 $ cp /tmp/.bookmarks.html ~/share

Contents