UNIX / How to configure Redhat systems

Home | UNIX | Practical

How to configure Redhat systems


Where to get
For a free of charge but as stable version of Redhat, get CentOS
mirror-status.centos.org/#fr
for example,
ftp.free.fr/mirrors/ftp.centos.org/
mirror.in2p3.fr/linux/CentOS/


Network configuration
In brief,
system-network-config-tui
vi /etc/sysconfig/network
vi /etc/hosts
You may force network interfaces' settings,
vi /etc/sysconfig/network-scripts/ifcfg-eth*
# :wn inside vi then, when editing several files
Note you may comment the HWADDR line to replace the network cards easily

Check network interfaces negociation & link,
ethtool eth0 | grep Link

To force network interface's bandwidth,
ethtool -s eth0 speed 1000 duplex full autoneg off
And apply it permanently,
vi /etc/sysconfig/network-scripts/ifcfg-eth0
for example,
ETHTOOL_OPTS="speed 1000 duplex full autoneg off"

As for static routes,
vi /etc/sysconfig/static-routes
or
vi /etc/sysconfig/network-scripts/route-ethX
e.g.,
GATEWAY0=10.10.0.1
NETMASK0=255.0.0.0
ADDRESS0=10.0.0.0

GATEWAY1=10.2.0.1
NETMASK1=255.255.0.0
ADDRESS1=192.168.0.0
Ref. kbase.redhat.com/faq/FAQ_79_2561.shtm

Apply changes,
service network restart

Also check
system-config-securitylevel-tui
chkconfig --list | grep tables

Ref. web.mit.edu/rhel-doc/5/RHEL-5-manual/Deployment_Guide-en-US/pt-network-related-config.html


RPMs and YUM
To easyly deal with dependencies on an isolated network, use your own (nfs,ftp,http) repository or simply your installation DVD (no updates),
mkdir /mnt/cdrom
mount /dev/cdrom /mnt/cdrom

And configure yum,
cd /etc
mv yum.repos.d yum.repos.d.dist
mkdir yum.repos.d
cat > yum.repos.d/centos.repo << EOF
[centos51]
name=centos51
baseurl=file:///mnt/cdrom
gpgcheck=1
gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-CentOS-5
EOF
yum clean all

Then install some package,
yum install screen

Note you can install whole groups of packages in example,
yum groupinstall base-x
To check for available yum groups,
cd /mnt/cdrom/repodata && grep '<id>' comps.xml

To search for available packages,
yum search XXX | grep base
Note "base" being the repo name. Check /etc/yum.d/*

Ref. www.centos.org/docs/5/html/yum/sn-yum-maintenance.html
Ref. wiki.centos.org/AdditionalResources/Repositories?action=show&redirect=Repositories


Create a remote repository
To create a repository from the installation CD by HTTP,
rmdir /var/www/html
mkdir /mnt/cdrom
mount /dev/cdrom /mnt/cdrom
ln -s /mnt/cdrom /var/www/html
service httpd start
or by NFS,
vi /etc/exports
in example,
/mnt/cdrom  *(ro,no_root_squash)
then,
service nfs start

To create an own repository,
yum install createrepo
createrepo <repodir>


Base packages
See pbraun.nethence.com/doc/sysutils_xen/xen_redhat.html


RPM repositories
ftp.redhat.com/
rpm.pbone.net/
centos.karan.org/
dag.wieers.com/rpm/packages/
for example dkms ntfs-3g : dag.wieers.com/rpm/packages/fuse-ntfs-3g/
macromedia.mplug.org/


Log rotation
See pbraun.nethence.com/doc/sysutils/log_rotation.html


Daily mail reports
See pbraun.nethence.com/doc/sysutils/logwatch.html


Miscelaneous
Change users defaults,
mv /etc/skel /etc/skel.dist
mkdir /etc/skel
vi /etc/default/useradd

To change language's locale,
vi /etc/sysconfig/i18n

Prevent ctrl-alt-suppr from restarting the box,
vi /etc/inittab

Possibly add those packages,
screen
rpm-build (rpm-devel depedency)
gallery2-imagemagick


Major Redhat release upgrade
From e.g. RHEL4.4 to RHEL5,

Configure the new GPG key,
wget mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
rpm --import RPM-GPG-KEY-CentOS-5

Install the release RPMs,
wget mirror.centos.org/centos/5/os/i386/CentOS/centos-release-5-0.0.el5.centos.2.i386.rpm
wget mirror.centos.org/centos/5/os/i386/CentOS/centos-release-notes-5.0.0-2.i386.rpm
rpm -Uvh centos-release-5-0.0.el5.centos.2.i386.rpm centos-release-notes-5.0.0-2.i386.rpm

Install the new kernel,
wget mirror.centos.org/centos/5/os/i386/CentOS/initscripts-8.45.14.EL-1.el5.centos.1.i386.rpm
wget mirror.centos.org/centos/5/os/i386/CentOS/kernel-2.6.18-8.el5.i686.rpm
wget mirror.centos.org/centos/5/os/i386/CentOS/SysVinit-2.86-14.i386.rpm
rpm -Uvh --nodeps SysVinit-2.86-14.i386.rpm initscripts-8.45.14.EL-1.el5.centos.1.i386.rpm kernel-2.6.18-8.el5.i686.rpm

Configure /etc/yum.repos.d/* and upgrade,
yum clean all
yum upgrade


Minor Redhat release upgrade
From e.g. 5.1 to 5.2 just configure /etc/yum.repos.d/* and upgrade,
yum cleanall
yum upgrade
Note if you have SAN and are using third-parity tool which changed initrd, you might want to avoid touching the kernel,
yum --exclude=kernel update


Kickstart automated installation
From the the install CD, append this as kernel parameter :
ip=NEW_IP netmask=NEW_NETMASK ks=INSTALL_SERVER/rhel5.ks text
or try just,
ks


RHEL installation numbers
They're supposed to simplify deployments in environments with different subscriptions. However, it's just a pain for non supported Redhats. Here are a few working install numbers as a workaround,
Client,
0000000e0017fc01
Server,
000000e90007fc00
Server with Cluster,
00000065000bfc00
Server with ClusterStorage,
000000ab000ffc00
Server with HPC,
000000e30013fc00
Server with Directory,
000000890017fc00
Server with SMB,
00000052001bfc00
Ref. linuxczar.net/moin/RHEL_Instaltion_Numbers
Ref. www.redhat.com/support/resources/faqs/installation_numbers/


HP Hardware tweeks
DL140G3 : disable 8042 Emulation Support

RHEL4 on Proliants,
(on AMD64/EM64T) BIOS > Advanced options > Enable Linux x86_64 HPET
(x86 and AMD64) With the Redhat install CD and afterwards inside grub.conf, use the "pci=nommconf" kernel parameter
Ref. h18004.www1.hp.com/products/servers/linux/k8-notes.html


Huge memory
RHEL4 had the hugemem kernel but it wasn't recommended to use it even though you had 64Go+ of RAM.
Today RHEL5 is fine with default kernel, althouth HP says it runs with max 64Go in its OS compatibility table.


Critics
- how to fix it afterwards if a fake/temporary install number has been given during installation ?
- the useless "complete log install.log" warning during install
- initrd shouldn't exist. At least the disk drivers should be included into the bare kernel.


References
www.redhat.com/docs/manuals/enterprise/
web.mit.edu/rhel-doc/5/RHEL-5-manual/Deployment_Guide-en-US/
mirror.centos.org/centos/4/os/i386/NOTES/RELEASE-NOTES-U5-fr.html
Init scripts lock files : www.redhat.com/magazine/008jun05/departments/tips_tricks/


Sat Nov 8 12:19:49 CET 2008
       © 2008 Pierre-Philipp Braun