docs‎ > ‎

CentOS Postfix Cyrus Email Server


Installed CentOS 5.5 on VMware via netinstall cd.  



Change this line
Also change the number of terminals available in the same file
# Run gettys in standard runlevels
1:2345:respawn:/sbin/mingetty tty1
2:2345:respawn:/sbin/mingetty tty2
#3:2345:respawn:/sbin/mingetty tty3
#4:2345:respawn:/sbin/mingetty tty4
#5:2345:respawn:/sbin/mingetty tty5
#6:2345:respawn:/sbin/mingetty tty6


Comment out some lines in this file.  I like to have colors in my vi file edits.  This is purely personal preference and is optional

Change this to this :

if [ -n "$BASH_VERSION" -o -n "$KSH_VERSION" -o -n "$ZSH_VERSION" ]; then

  [ -x /usr/bin/id ] || return

  tmpid=$(/usr/bin/id -u)

  [ "$tmpid" = "" ] && tmpid=0

  [ $tmpid -le 100 ] && return

  # for bash and zsh, only if no alias is already set

  alias vi >/dev/null 2>&1 || alias vi=vim


To this:

if [ -n "$BASH_VERSION" -o -n "$KSH_VERSION" -o -n "$ZSH_VERSION" ]; then

  #[ -x /usr/bin/id ] || return

  #tmpid=$(/usr/bin/id -u)

  #[ "$tmpid" = "" ] && tmpid=0

  #[ $tmpid -le 100 ] && return

  # for bash and zsh, only if no alias is already set

  alias vi >/dev/null 2>&1 || alias vi=vim



Editing this file is optional. 

Add some lines to make your life easier.  At about the 4th or 5th line down add the following lines.

 # Makes chkconfig easier to type

  alias cc='chkconfig'

 # For checking which services are enabled for run level 3

  alias cc3='chkconfig --list | grep 3:on'

 # Unesscessary for this setup.  Used for email servers

  alias ama='chown -R amavis:amavis /var/amavis'

 # Adds color to the terminal

  alias ls='ls -la --color=tty'

 # Makes disk usage human readable

  alias du='du -hs'

At this point log off and log back on to use the changes made

Configure Unneeded Daemons

Take a look and see which daemons are running on your machine.  This is the default list.  Too many are enabled.  Lets trim it down

[root@centos ~]# cc3

acpid           0:off   1:off   2:on    3:on    4:on    5:on    6:off

anacron         0:off   1:off   2:on    3:on    4:on    5:on    6:off

apmd            0:off   1:off   2:on    3:on    4:on    5:on    6:off

atd             0:off   1:off   2:off   3:on    4:on    5:on    6:off

auditd          0:off   1:off   2:on    3:on    4:on    5:on    6:off

autofs          0:off   1:off   2:off   3:on    4:on    5:on    6:off

avahi-daemon    0:off   1:off   2:off   3:on    4:on    5:on    6:off

bluetooth       0:off   1:off   2:on    3:on    4:on    5:on    6:off

cpuspeed        0:off   1:on    2:on    3:on    4:on    5:on    6:off

crond           0:off   1:off   2:on    3:on    4:on    5:on    6:off

cups            0:off   1:off   2:on    3:on    4:on    5:on    6:off

firstboot       0:off   1:off   2:off   3:on    4:off   5:on    6:off

gpm             0:off   1:off   2:on    3:on    4:on    5:on    6:off

haldaemon       0:off   1:off   2:off   3:on    4:on    5:on    6:off

hidd            0:off   1:off   2:on    3:on    4:on    5:on    6:off

ip6tables       0:off   1:off   2:on    3:on    4:on    5:on    6:off

iptables        0:off   1:off   2:on    3:on    4:on    5:on    6:off

irqbalance      0:off   1:off   2:on    3:on    4:on    5:on    6:off

kudzu           0:off   1:off   2:off   3:on    4:on    5:on    6:off

lvm2-monitor    0:off   1:on    2:on    3:on    4:on    5:on    6:off

mcstrans        0:off   1:off   2:on    3:on    4:on    5:on    6:off

mdmonitor       0:off   1:off   2:on    3:on    4:on    5:on    6:off

messagebus      0:off   1:off   2:off   3:on    4:on    5:on    6:off

microcode_ctl   0:off   1:off   2:on    3:on    4:on    5:on    6:off

netfs           0:off   1:off   2:off   3:on    4:on    5:on    6:off

network         0:off   1:off   2:on    3:on    4:on    5:on    6:off

nfslock         0:off   1:off   2:off   3:on    4:on    5:on    6:off

pcscd           0:off   1:off   2:on    3:on    4:on    5:on    6:off

portmap         0:off   1:off   2:off   3:on    4:on    5:on    6:off

rawdevices      0:off   1:off   2:off   3:on    4:on    5:on    6:off

readahead_early 0:off   1:off   2:on    3:on    4:on    5:on    6:off

restorecond     0:off   1:off   2:on    3:on    4:on    5:on    6:off

rpcgssd         0:off   1:off   2:off   3:on    4:on    5:on    6:off

rpcidmapd       0:off   1:off   2:off   3:on    4:on    5:on    6:off

sendmail        0:off   1:off   2:on    3:on    4:on    5:on    6:off

smartd          0:off   1:off   2:on    3:on    4:on    5:on    6:off

sshd            0:off   1:off   2:on    3:on    4:on    5:on    6:off

syslog          0:off   1:off   2:on    3:on    4:on    5:on    6:off

xfs             0:off   1:off   2:on    3:on    4:on    5:on    6:off

yum-updatesd    0:off   1:off   2:on    3:on    4:on    5:on    6:off

Turn off daemons to your taste.  I did the following:

[root@centos ~]# 

cc apmd off

cc autofs off

cc avahi-daemon off

cc cups off

cc firstboot off

cc hidd off

cc ip6tables off

cc kudzu off

cc lvm2-monitor off

cc mdmonitor off

cc mcstrans off

cc microcode_ctl off

cc netfs off

cc nfslock off

cc pcscd off

cc portmap off

cc bluetooth off

cc acpid off

cc auditd off

cc cpuspeed off

cc haldaemon off

cc iptables off

cc rawdevices off

cc readahead_early off

cc restorecond off

cc rpcgssd off

cc rpcidmapd off

cc sendmail off

cc smartd off


If you want to use VNC for your terminal, do the following
yum -y install vncserver

Start the vncserver to set the password

vncserver start

Set the vncserver to start at boot time if you wish

cc vncserver on
To Get this to startup correctly, you need to modify the /etc/init.d/vncserver file
Goto approximatley line 17 and find this line
Change it to look like the following.  I use root.  If you want the vnc terminal come up as different user, be sure to set the password for that user and substitute root for a username

Update Core Packages

At this point you can update the core packages of your installation
yum -y update

Remove uneeded packages

yum -y erase sendmail fetchmail mdadm mutt redhat-lsb 

Initial Package Installation

 yum -y groupinstall "Development Tools"
 yum -y install openssl openssl-devel mysql mysql-server mysql-devel httpd httpd-devel mod_ssl cyrus-imapd \
 cyrus-sasl cyrus-sasl-plain cyrus-sasl-md5 cyrus-sasl-gssapi cyrus-imapd-utils cyrus-sasl-devel\
 cyrus-imapd-devel perl-Cyrus db4 db4-devel pam pam-devel perl-Date-Calc mailman\
 spamassassin openldap openldap-servers geoip-devel\
 file-devel pcre-devel pam_mysql