CentOS インストールしたときにとりあえずやる4つのこと

個人的メモです。

時刻の設定

ntpをインストールして時刻をあわせる。

# yum install ntp
# ntpdate ntpサーバのアドレス

↓ntpサーバ一覧
http://www.venus.dti.ne.jp/~yoshi-o/NTP/NTP-Table.html


cronに設定しておく

# crontab -e
3 6 * * * ntpdate ntpサーバのアドレス >/dev/null > 2>&1
SELinuxを無効化

私は使用しない(理解できていない。。)ので、無効化しときます。
/etc/sysconfig/selinuxをviで開き、次のように修正するか、
SELINUX=disabled


setupコマンドで
# setup
「Firewall configuration」を選択しSELinuxをDisabledにする。


サーバを再起動してgetenforceでDisabledが表示されればOK
# getenforce
Disabled

仮想コンソール数を調整

デフォルト6つだが、リソースを消費するし、私は不要なのでコメントアウト
# vi /etc/inittab


# Run gettys in standard runlevels
1:2345:respawn:/sbin/mingetty tty1
#2:2345:respawn:/sbin/mingetty tty2
#3:2345:respawn:/sbin/mingetty tty3
#4:2345:respawn:/sbin/mingetty tty4
#5:2345:respawn:/sbin/mingetty tty5
#6:2345:respawn:/sbin/mingetty tty6

再起動してプロセスを確認


参考↓
http://www.atmarkit.co.jp/flinux/rensai/linuxtips/310delvcon.html

不要なサービスの停止

setupコマンドで
# setup
「System services」を選択し不要なサービスを停止する。

●APMによる電源管理。サーバーは常時稼働なので必要なし。
apmd

●ブルートゥース
bluetooth
hidd

●プリンタサーバ。
cups

●コンソール用マウスサーバ。マウスを使わないなら不要。
gpm

●Xフォント。Xを使用しないなら不要。
xfs

●yumの自動アップデート
yum-updatesd

●省電力のための休止状態をサポートするデーモン
acpid