CentOS notes

I still keep forget these things:

Config Tools

Config utilities are called system-config-*, command line variants are suffixed -tui.

To enable or disable services, use ntsysv.

Config Files

Besides resolv.conf one should edit /etc/sysconfig/networking/profiles/default/resolv.conf

Proxy configuration and optimization for yum

The following examples specify a proxy on 192.168.1.8:3128, please adjust to your environment.

In /etc/profile.d/proxy.sh you shoud have something like:
export http_proxy=http://192.168.1.8:3128/
export ftp_proxy=http://192.168.1.8:3128/
export no_proxy=.domain.com
export HTTP_PROXY=http://192.168.1.8:3128/
export FTP_PROXY=http://192.168.1.8:3128/

In /etc/yum.conf should be:
proxy=http://192.168.1.8:3128/

To reliable force all your CentOS installations to use the same repository and to prevent them from killing your proxy's effect, hand-maintain your/etc/yum.repos.d/*.repo files and have each repository section look like this (kill mirrorlist= lines, insert resp. edit the baseurl= line):
[base]
name=CentOS-$releasever - Base
baseurl=http://mirrors.foo.com/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

Mail configuration recommendation for internal hosts

Usually CentOS serves as host system on machines in some kind of DMZ. This prevents cron mails to come through quite reliably ;-((
I propose these steps to come around this problem:

# replace unmanagable sendmail with exim
yum install -y exim
/etc/init.d/sendmail stop
yum remove -y sendmail
# make sure sendmail now points to exim:
sendmail -bV
# make sure /etc/mailname is filled
/bin/hostname -f >/etc/mailname
chmod 0755 /etc/mailname
cat /etc/mailname

# tell exim to use a smart host (see below)
vim /etc/exim/exim.conf

In /etc/exim/exim.conf, just below begin smarthosts, insert something like this:

smarthost:
  driver = manualroute
  domains = foo.com : intra.foo.com
  transport = remote_smtp
  route_data = "mx.dmz.intra.foo.com"

# finally start exim
/etc/init.d/exim start
# check if your /etc/aliases matches your wishes
grep ^root /etc/aliases
# eventually make test
echo '* * * * * root /bin/echo "test from cron" && rm /etc/cron.d/mailtest'  >/etc/cron.d/mailtest
# voila

If your internal MX also runs exim, do not forget to include your DMZ net in /etc/exim4/local_host_whitelist and it's MAIN_RELAY_NETS.



From: IBCL BLog.
Originally posted: 2009-01-02