| Home | Windows | MAC/iOS | Linux | PHP | HTML/CSS | ハードウェア | 資料 |
HOME > Linux

CentOS 6.7 インストール手順

ダウンロード

サーバー用に最小構成のものCentOS-6.7-x86_64-minimal.isoを以下でダウンロードします。

6.764bithttp://ftp.iij.ad.jp/pub/linux/centos/6.7/isos/x86_64/
6.732bithttp://ftp.iij.ad.jp/pub/linux/centos/6.7/isos/i386/

過去のバージョンは以下のサイトでダウンロードできます。

6.664bithttp://vault.centos.org/6.6/isos/x86_64/
6.632bithttp://vault.centos.org/6.6/isos/i386/

インストール開始

  1. CDでブートさせるとDisc Foundがでますが、Skip
  2. セットアップ初期画面がでますが、Next
  3. 表示言語の選択画面がでますが、それぞれお好みですがEnglishNext
  4. キーボードの選択画面がでますが、それぞれ使用してるものを選択してNext
  5. Basic Storage Devicesを選択してNext
  6. The Storage device below may contain data.ディスクの中をすべて消してもいいのでYes,discard any data
  7. ホスト名を設定test.memogaki.net入力し終わったら、Configure Network
  8. リストからeth0を選択してConnect Automaticallyにチェックを入れて起動時に自動で立ち上がるようにする
  9. Applyを押しCloseで元の画面に戻りNext
  10. Asia/Tokyoを選択し、System clock uses UTCのチェックを外しNext
  11. rootのパスワードを入力しNext
  12. ディスク全領域を使うのでUse All Spaceを選択しNext
  13. ディスクに書き込んでいいのでWrite changes to disk
  14. Rebootを押し再起動

Hyper-Vにインストール時のコンソールの解像度

Hyper-Vにインストールした場合解像度が高い状態で表示されて不都合がある場合があります。

$ vi /etc/grub.conf

kernel欄の行に以下を追記

video=hyperv_fb:800x600

ユーザーの追加

rootでログインしてコマンドで以下のようにユーザーを追加

$ useradd [name]	// ユーザーの追加
$ passwd [name]		// 追加したユーザーのパスワードを設定
*****

iptables

iptablesに使うポートの開放を記述します。

ポートの一覧はこちら

$ vi /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT

OpenSSHのインストール

CentOSでは標準でインストールされてるので必要ない。

SSHでrootログインできるようにする

$ vi /etc/ssh/sshd_config
PermitRootLogin yes
#PermitEmptyPassword yes	# パスワード無しのログインを禁止
#PasswordAuthentication yes	# パスワードログイン禁止、秘密鍵でログインさせる
$ service sshd restart

NTPのインストール 時刻合わせ

$ date
$ hwclock -r	// ハードウェアクロックの時刻を確認
$ ntpdate ntp.nict.jp	// 手動で時刻合わせ
$ yum install ntp
$ vi /etc/ntp.conf
server 0.centos.pool.ntp.org iburst
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst
server ntp.nict.jp
server ntp.nict.jp
server ntp.nict.jp
server ntp.nict.jp

同じNTPサーバーを指定してるが、DNSラウンドロビンによる負荷分散を利用して別々のNTPサーバへ接続されてるため

$ service ntpd start
$ ntpq -p		// 確認
$ chkconfig ntpd on
$ hwclock -w	// ハードウェアクロックを設定
6247
Last updated: 2015/09/10 ▲PAGE TOP