yumの設定などインストール直後の設定

インストール後に設定しておいたほうが良い項目です。


yum(パッケージ管理システム設定)の設定

プロキシサーバ越しにインターネットに接続している場合は、yumの設定ファイル
/etc/yum.confにプロキシサーバの設定を記載します。

vi /etc/yum.conf

# The proxy server - proxy server:port number
proxy=http://your_proxy.co.jp:8080/
# The account details for yum connections
proxy_username=yum-user
proxy_password=passwd


yumの初期設定を実行します。

#fastestmirrorプラグインをインストールします。
#ダウンロード時の最適ミラーサイトを自動判別します。
yum -y install yum-fastestmirror

#インストール済みパッケージの一括アップデートを実行します。
yum -y update

#yum-cronインストール
#インストール済パッケージを自動更新するように設定します。
yum -y install yum-cron

#インストール済パッケージ自動アップデートスクリプトを起動します。
/etc/rc.d/init.d/yum start
Enabling nightly yum update:                               [  OK  ]

#インストール済パッケージ自動アップデートスクリプト自動起動設定をONに
chkconfig yum on

#インストール済パッケージ自動アップデートスクリプト自動起動設定確認
chkconfig --list yum
yum             0:off   1:off   2:on    3:on    4:on    5:on    6:off

#アップデート通知デーモン停止
#・大量にメモリを消費する(約10MB以上使用)
#・デフォルトで1時間ごとにアップデートチェックを行うようになっており、
#手動によるパッケージインストールと競合するとインストールが失敗する
#だそうです。
/etc/rc.d/init.d/yum-updatesd stop

#アップデート通知デーモン自動起動設定解除
chkconfig yum-updatesd off

root宛メールの転送設定

#旧root宛メール転送設定削除
sed -i '/^root:/d' /etc/aliases

#転送先の設定
echo "root: master@yourhost.jp" >> /etc/aliases

#転送設定反映
newaliases

#テストメール送信
echo test|mail root

SELinuxの無効化設定

#SELinux状態確認
#Enforcing:有効化
#Permissive:無効化
getenforce

#Enforcingと表示されたら無効化する
setenforce 0

#SELinux設定ファイル編集し、起動時にSELinuxを無効化
vi /etc/sysconfig/selinux
SELINUX=enforcing
↓
SELINUX=disabled

時間合わせ

VMWare上に構築したLinuxOSは時間がずれてしまうことが知られています。
※参考http://webos-goodies.jp/archives/50179807.html
/boot/grub/menu.lstを編集して対応します。

vi /boot/grub/menu.lst
kernel /vmlinuz-2.6.18-8.1.8.el5 ro root=/dev/VolGroup00/LogVol00
↓
kernel /vmlinuz-2.6.18-8.1.8.el5 ro root=/dev/VolGroup00/LogVol00 clock=pit nosmp noapic nolapic

#※設定後、システム再起動

続いて、NTPサーバの設定を行います。

#NTPサーバーインストール
yum -y install ntp

#設定ファイルをバックアップ
mv /etc/ntp.conf /etc/ntp.conf.org

#ntp設定ファイルを新規作成
vi /etc/ntp.conf

driftfile /var/lib/ntp/drift
server プロバイダのNTPサーバー名
server ntp.dnsbalance.ring.gr.jp
server ntp.dnsbalance.ring.gr.jp
server ntp.dnsbalance.ring.gr.jp
#ntp.dnsbalance.ring.gr.jpはRing Server Project参加組織のNTPサーバー内で
#一番近いNTPサーバーを自動的にさがしてくれるサーバー 
#プロバイダのNTPサーバー名はなくても良いかも

#一旦、手動で時刻あわせを行います。
ntpdate ntp.dnsbalance.ring.gr.jp
 6 Sep 00:26:31 ntpdate[2296]: step time server 133.243.232.68 offset 553.067001 sec

#ntpサーバを起動します。
etc/rc.d/init.d/ntpd start
ntpd を起動中:                                             [  OK  ]

#システム起動時に自動起動するよう設定します。
chkconfig ntpd on

#自動機動の設定を確認します。
chkconfig --list ntpd
ntpd            0:off   1:off   2:on    3:on    4:on    5:on    6:off



もどる