2010年1月1日金曜日

DomU standardをアップデート

コピー量産用のイメージに久々に手を入れる。
ついでに運用を改める。

#繰り返しになりますが、本ブログは個人用メモです

■変更点
・yum updateしておく。
・/kfs_betaもマウントするようにする。
・DNSサーバを追加する。
・Postfix導入&MTAの経路を現行仕様に改める。
・普段から普通に起動できるようにする。

■yum update
ふつうに
# yum update

■/kfs_betaもマウントするようにする
# vi /etc/fstab
alpha.hoge.com:/kfs_alpha /kfs_alpha nfs rw 0 0
beta.hoge.com:/kfs_beta /kfs_beta nfs rw 0 0 ←追記
kfs01.hoge.com:/mnt/kfs01/kfs /kfs nfs rw 0 0

■DNSサーバを追加する
#vi /etc/resolv.conf
search hoge.com
nameserver 192.168.0.6
nameserver 192.168.0.21 ←追加
nameserver 202.224.32.1

■Postfix導入&MTAの経路を現行仕様に改める
# yum -y install postfix
# vi /etc/postfix/main.cf
以下最終行に追記

myhostname = standard.hoge.com
mydomain = hoge.com
myorigin = $mydomain
inet_interfaces = all
#proxy_interfaces =
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
home_mailbox = Maildir/

smtpd_banner = $myhostname ESMTP unknown
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname

smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination

#MailSizeLimitter 100MB
message_size_limit = 104857600

#MailBoxSizeLimitter 500MB
mailbox_size_limit = 512000000

mynetworks = 192.168.0.0/24, 127.0.0.0/8
relay_domains = $mydestination

relayhost = mail01.hoge.com

allow_mail_to_commands = alias,forward,include
allow_mail_to_files = alias,forward,include
disable_vrfy_command = yes
allow_percent_hack = yes
swap_bangpath = yes
forward_path = $home/.forward$recipient_delimiter$extension,$home/.forward
sendmail_path = /usr/sbin/sendmail

# /etc/rc.d/init.d/saslauthd start
# chkconfig saslauthd on
# chkconfig --list saslauthd
# mkdir -p /etc/skel/Maildir/new
# mkdir -p /etc/skel/Maildir/cur
# mkdir -p /etc/skel/Maildir/tmp
# chmod -R 700 /etc/skel/Maildir/
# /etc/rc.d/init.d/sendmail stop
# chkconfig sendmail off
# chkconfig --list sendmail
# alternatives --set mta /usr/sbin/sendmail.postfix
# /etc/rc.d/init.d/postfix start
# chkconfig postfix on
# chkconfig --list postfix

■普段から普通に起動できるようにする
アップデートのたびに設定変更まんどいから。
IPは192.168.0.3を割り当てる。
すると量産時に流し込むコマンドは以下の要領になる。(www01)

○起動後コマンド
sed -i 's/IPADDR=192.168.0.3/IPADDR=192.168.0.31/g' /etc/sysconfig/network-scripts/ifcfg-eth0
sed -i 's/HWADDR=00:16:3E:63:00:03/HWADDR=00:16:3E:63:00:1F/g' /etc/sysconfig/network-scripts/ifcfg-eth0
sed -i 's/HOSTNAME=standard.hoge.com/HOSTNAME=www01.hoge.com/g' /etc/sysconfig/network
sed -i 's/myhostname = standard.hoge.com/myhostname = www01.hoge.com/g' /etc/postfix/main.cf
rm -rf /etc/ssh/ssh_host*
rm -rf /root/.bash_history
reboot

0 件のコメント: