I know CentOS is still in beta but, like others, I want to become familiar with it as soon as I can. So I'm going through the process of setting up a master server image. When CentOS 7 is officially released, I'll create the real master server image from these steps.
I want to start with a clean system. Just the basics. After the OS is installed, I'll add a few specific packages and customize the configuration of various parts of the server to get it just the way I need it for my environment. Everyone's environment is different and some steps below could be changed or eliminated altogether depending on what you need. (This doc will be updated as needed.)
*This server will be installed as a VM running on a VMware ESX 5.5 host.
Installation
1) Download the CentOS 7 ISO.
2) Create the VM in vCenter
- 1 vCPU
- 4 Gb memory
- 30 Gb disk
- enable Memory and CPU Hot Add
- 4 Gb memory
- 30 Gb disk
- enable Memory and CPU Hot Add
3) Install the OS
- Configure Network
- Set root password
- Reboot after installation completes
- set static IP4 address, netmask, gateway
- set IPV6 to 'ignore'
- enable interface
- Configure Time
- set time zone
- enable NTP
- configure corporate time servers
- Custom Disk Partitioning
- /boot, 500Mb on a standard partition
- /, 10Gb, logical volume lv_root in volume group vg00
- /var, 5Gb, lv_var in vg00
- /home, 2Gb, lv_home in vg00
- /tmp, 2Gb, lv_tmp in vg00
- swap, 4Gb, lv_swap in vg00
- /opt, <remaining disk>, lv_opt in vg00
- Software
- infrastructure server
- Begin installation- Set root password
- Reboot after installation completes
4) Configure Network
- uninstall NetworkManager rpm
- edit /etc/hosts
- set hostname
- edit /etc/hosts
- add line with server IP address, hostname and FQDN
- edit /etc/sysconfig/network
- delete line with comment, "#Created by anaconda"
- add line "NETWORKING=yes"
- add line with "HOSTNAME=<server name>"
- edit /etc/sysconfig/network-scripts/ifcfg-ens160
- add line with DEVICE="ens160" (device name has to match the device in /sys/class/net)
- add line with BROADCAST="<broadcast address>"
- add line with NETMASK="<netmask>"
- comment out lines with UUID, HWADDR and PREFIX0
- remove zero from GATEWAY0 and IPADDR0 parameters
- edit /etc/resolv.conf
- delete line with comment, "#Generated by NetworkManager"
- add line with "options timeout:1"
- disable firewalld.service
# systemctl disable firewalld.service
- edit /etc/sysconfig/selinux and set selinux to disabled- set hostname
# hostnamectl set-hostname <host name>
- reboot
5) Setup Login Environment and SysAdmin Accounts
- edit /etc/bashrc
- add a few custom aliases for common commands
- set the custom default prompt
- add "HISTFILESIZE=10000"
- add "PROMPT_COMMAND='history -a'
- add "export HISTFILESIZE"
- setup accounts for the system administrators
- add sysadmin user accounts
- set the correct UID
- chage -M -1 to never expire
- setup sudo
6) Setup Mail
- verify postfixd is enabled
- edit /etc/aliases and add mail forward address for root
- reinitialize the alias database
- edit /etc/aliases and add mail forward address for root
- reinitialize the alias database
# newaliases
7) Setup SSH
- edit /etc/ssh/sshd_config
- restart sshd
- uncomment line with "Protocol 2"
- set/add banner with "Banner /etc/issue"
- scp the custom /etc/issue file from the CentOS 6 master image server - restart sshd
# systemctl restart sshd.service
8) Setup Repositories
- add epel and rpmforge repos
- for each
- for each
- google for the URL to the correct version of the repo setup rpm
# wget <URL to rpm>
# rpm -ivh <rpm>
- set new repos to not be enabled by default by editing the corresponding /etc/yum.repos.d/*.repo file9) Setup Root Crontab
- scp custom scripts from /usr/local/bin on the CentOS 6 master image server
- verify the scripts run correctly on CentOS 7
- scp /var/spool/cron/root file from CentOS 6 master image server as a starting point
- edit root's crontab
- verify the scripts run correctly on CentOS 7
- scp /var/spool/cron/root file from CentOS 6 master image server as a starting point
- edit root's crontab
- adjust cron job run times and commands as needed
10) Install Various Software and RPMs
- install RPMs via Yum
- pam_krb5 (for kerberos authentication)
- ntp (for time; didn't come with infrastructure server installation)
- ncompress (contains compress utility that is used by several custom scripts)
- sg3_utils (for scsi-rescan utility)
- lsscsi (for lsscsi utility)
- nagios-nrpe (for Nagios monitoring)
- nagios-plugins (Nagios)
- nagios-common (Nagios)
- htop (great, top-like utility)
- iotop (top-like utility for io)
- iptraf (for watching network traffic)
- dstat (another top-like, information gathering utility)
- haveged (for better random number generation in a virtual machine)
- install VMware Tools
- follow normal procedures
- install Toptracker (a custom app for trending system performance data)
- follow normal procedures
- install backup software
- follow normal procedures
- update everything
# yum update
- reboot
11) Setup Kerberos Authentication to AD
- pam_krb5 was installed in previous section
- scp /etc/krb5.conf (has custom configuration) from CentOS 6 master image server
- enable kerberos authentication
- scp /etc/krb5.conf (has custom configuration) from CentOS 6 master image server
- enable kerberos authentication
# authconfig --enablekrb5 --krb5kdc=<kdc> --krb5realm=<realm> --update
- verify login with AD credentials works
12) Setup Docker
- install docker
# yum install docker
- start docker
# systemctl start docker.service
- set docker to start on boot
# systemctl enable docker.service