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 3)

Fedora Project This is the process I used to install Fedora Core 3 onto gina, a HP BRIO Celeron 500. However they are intented to be usefull when installing on any PC.

If you use any of the information remember that I run a network securely protected by a firewall.

Contents
Install Fedora Core 3
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
Install Keychain
Install RealVNC
Install rdesktop
Install HTML Tidy
Install KDirStat
Install mozex
Install K3b
Install MultiTail
Install Unison
Customise
Install Fedora Core 3

Fedora Project BitTorrent 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.

Boot from the first CD.

Select graphical mode installation.

Run the media test if it hasn't been done before.

Select English as the installation language.

Select UK keyboard.

Select Install Fedora Core.

Select Workstation installation type.

Select Manual partition with Disk Druid and create the following partitions

gina: 20Gb hard drive
hda1   100 MB   /boot
hda34,000 MB/home
hda28,500 MB/
hda53,500 MB/var
hda62,000 MB/tmp
hda71,000 MB(swap)

Use GRUB as the boot loader.

Leave the IP and Netmask information configured by DHCP, but set the hostname, e.g. gina.stevesearle.com

Enable the firewall and allow Remote Login (SSH). Set Enable SELinux to Active.

Select English (Great Britain) as the default language. Deselect English (USA).

Select Europe/London and System clock uses UTC on the timezone screen.

Enter a root password.

Select Customize software packages to be installed.

Change the software selection as follows.

Click next and continue with the install.

Reboot!

Contents

Update packages

Yellow dog Updater, Modified Configure and run yum to update any RPM packages that are out of date.

 # rpm --import /usr/share/rhn/RPM*
 # 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

Use yum to install the following packages.

 # yum install cdrdao

Set up yum to maintain from some third party repositories. Create /etc/yum.repos.d/dag.repo.

 [dag]
 name=Dag RPM Repository for Fedora Core
 baseurl=http://apt.sw.be/fedora/$releasever/en/$basearch/dag/
 gpgcheck=1

Import the RPM GPG key.

 # rpm --import http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt

Now use yum to install bittorrent and flash (both from dag). Also install gtk+-devel (base) which is needed when building MPlayer and the Objective Caml compiler (dag) needed for building Unison.

 # yum install bittorrent
 # yum install mozilla-flash
 # yum install gtk+-devel
 # yum install ocaml

Contents

Configure miscellaneous settings

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

 COLOR1="\[\033[0;36m\]"
 COLOR2="\[\033[0;32m\]"
 COLOR3="\[\033[0;36m\]"
 COLOR4="\[\033[0;37m\]"
 
 if [ "$UID" = "0" ]; then
        COLOR2="\[\033[1;31m\]"
 fi

 PS1="$COLOR2($COLOR3\u@\h$COLOR2:$COLOR1\w$COLOR2)$COLOR1\\$ $COLOR4"


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. The following cron entry deletes all files

 30 1 * * * find /tmp -mtime +7 -type f -print -exec rm {} ";"; find /tmp -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 MAILHUB 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(`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 with (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 memory sticks and any NFS exports from other machines, by editing /etc/fstab and adding the appropriate lines, e.g.

 /dev/sdc1              /mnt/mem        vfat    rw,user,noauto 0 0
 
 hayley:/backups        /backups        nfs     rsize=8192,wsize=8192

This would allow users to mount a USB memory stick on /mnt/mem and 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 /mtn/mem and /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 --disable-zlib-vcheck
 $ 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 Crypt::SSLeay
 cpan> force install Net::SSLeay
 cpan> exit

Contents

Install Webmin

Webmin Install Webmin, an excellent 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

Contents

Install Vim

Vim Download and install Vim, the best editor around.

 $ cd /tmp
 $ tar -xjf vim-6.2.tar.bz2
 $ cd vim62
 $ ./configure
 $ 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 with

 $ 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"

/usr/local/bin/url_handler.sh needs to be edited 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 all-20050412.tar.bz2
 $ cd all-20050412
 $ 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
 $ 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/Skin/default"

Enter gmplayer to run the gui version.

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 -xjf 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 used 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

Install mozex

mozex I use mozex to intercept mailto: links in Firefox and open up a mutt email dialog. Click on the link on the installation page to install.

Then in Firefox, enter about:config as the URL, right-click on the page and create a new string with a preference name of mozex.command.mailer and a string value of /usr/bin/konsole --schema Linux.schema --vt_sz 120x32 -e mutt mailto:%A?subject=%S&cc=%C&body=%B. Also create a new boolean witha preference name of mozex.intercept.mailto set to true.

Contents

Install K3b

K3b Install K3b is brilliant CD and DVD burning software. Download and install.

 $ cd /tmp
 $ tar -xjf k3b-0.11.9.tar.bz2
 $ cd k3b-0.11.9
 $ ./configure
 $ make
 $ su -c "make install"

Contents

Install MultiTail

I use MultiTail to view multiple log files and to colorise them to make them easier to read.

Download it to /tmp and build and install.

 $ cd /tmp
 $ tar -xzf multitail-3.4.8.tgz
 $ cd multitail-3.4.8
 $ su -c "make install"

Contents

Install Unison

I use Unison to synchronise files on different machines. To build it the Objective Caml compiler needs to be installed (use yum) and then download and install Unison.

 $ cd /tmp
 $ tar -xzf unison-2.10.2.tar.gz
 $ cd unison-2.10.2
 $ make UISTYLE=text
 $ su -c "cp unison /usr/local/bin"

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.

 $ cd ~
 $ mkdir share
 $ mkdir www

Then 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

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 Mutt SSL certificates file

 $ cd ~
 $ mkdir .mutt
 $ touch .mutt/certificates

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 konsole -T "Mutt" --noscrollbar --notoolbar --nomenubar -vt_sz 132x52 --type linux -e mutt. Click on Icon: and select an appropriate one. Click OK.

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

Contents