Minimal Services Set-Up For a CentOS Server

This is a list for a minimal install of CentOS 5 (but applies equally to RHEL or other RHEL derivatives).
Disabling unneeded services makes your system more secure as well as reducing server load.

After performing a minimal install run the following command to see which services are already running

chkconfig --list |grep "3:on" |awk '{print $1}'

and to check the amount of memory used by each of those services

ps aux | awk '{print $4"\t"$11}' | sort | uniq -c | awk '{print $2" "$1" "$3}' | sort -nr

Disable as many of the services we don't (generall) need

chkconfig anacron off
chkconfig apmd off
chkconfig atd off
chkconfig autofs off
chkconfig cpuspeed off
chkconfig cups off
chkconfig cups-config-daemon off
chkconfig gpm off
chkconfig isdn off
chkconfig netfs off
chkconfig nfslock off
chkconfig openibd off
chkconfig pcmcia off
chkconfig portmap off
chkconfig rawdevices off
chkconfig readahead_early off
chkconfig rpcgssd off
chkconfig rpcidmapd off
chkconfig smartd off
chkconfig xfs off
chkconfig ip6tables off
chkconfig avahi-daemon off
chkconfig firstboot off
chkconfig yum-updatesd off
chkconfig mcstrans off
chkconfig pcscd off
chkconfig bluetooth off
chkconfig hidd off

You might also disable the follow services depending on your needs:

  • acpid
    Needed for gentle shut-down using the power button
  • mdmonitor
    Needed only if you are using SoftwareRAID
  • haldaemon and messagebus
    Needed for plug&play devices
  • sendmail
    Needed if you expect to receive mail through logwatch or another service
  • microcode_ctl
    Not needed if you are using an AMD CPU
  • setroubleshoot & restorecond
    Not needed unless running SELinux

You can find a rather comprehensive list of RHEL daemons here
After we have shutdown all the appropriate services we reboot the machine.
After the reboot we can check the amount of memory usage using :

free -m