環境構築

CentOS の ダウンロード
http://www.centos.org/modules/tinycontent/index.php?id=32

言語 Japanese
キーボード ja106
installation method 「FTP
IPv6のオプションは外す 「スペース」キー
FTP setup 入手した先「ftp.riken.jp」directory 「/Linux/centos/5/os/i386」と入力する

ちなみに、
tab で ok or back
スペース でチェックを外す

初期化
基本デフォルト rootパスのみ入力
入れたいツールは自分で入れるので
今すぐカスタマイズ
開発 開発ツール
ベースシステム ベース
言語 日本語
最低限のものだけ入れる
インストールを待つ
再起動が要求されるので、ディスクを抜いてから(設定の「ストレージ」)

root
からパスワード入力

OSの更新
yum -y update

  • y は すべて yesという意味

complete!が出たら終了

macのターミナルから操作する
/sbin/ifconfig

Webサーバーのインストール(sudo yum -y install httpd
MySQLのインストール(sudo yum -y install mysql-server)
PHPのインストール(sudo yum -y install php php-devel php-pear php-mbstring php-gd php-mysql

Selinuxを切る

vi /etc/systemconf/selinux

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=enforcing
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted

SELINUX=enforcingをSELINUX=disabledに変更
Selinuxを無効にする

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted

iptablesの無効化
/sbin/service iptables stop
/sbin/chkconfig iptables off

webサーバーの起動
/sbin/service httpd start
/sbin/service mysqld start

* 再起動時にWebサーバーを起動(chkconfig httpd on)。
* 再起動時にMySQLを起動(chkconfig mysqld on)

webサーバーの確認
http://mizunuma.dev にアクセス

mysqlの確認
mysql -u root
mysqlに入ればok
exit;で抜ける

chown mizunuma /var/www/html というふうにdocument rootの所有者を変更する