http://tanaka.sakura.ad.jp/2011/05/centos-linux-apache-php-perl-mysql-lamp.html
これはマスターしたほうがよさそう。
yumのリポジトリを追加するとかなり便利なんだ。
1.CentOS5.5→CentOS5.6へバージョンアップ
rpm -qa | grep centos-release #現行バージョンの確認
yum upgrade #アップグレード
rpm -qa | grep centos-release #バージョンアップ確認
2.yumリポジトリの追加
Fedora EPELとremiとRPMForgeの追加
2.1 Fedora EPELのダウンロード
wget http://donwload.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
2.2 remiのダウンロード
http://rpms.famillecollet.com/el5.x86_64/remi-release-5-8.el5.remi.noarch.rpm
2.3 RPMForgeのダウンロード
wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm
2.4 3つのリポジトリの追加
rpm -Uvh epel-release-5-4.noarch.rpm remi-release-5-8.el5.remi.noarch.rpm rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm
2.5 yum実行時以外にリポジトリが利用されることを防ぐ
(remiは初期設定でそうなっているので、FedoraEPELとRPMForgeを設定する)
vi /etc/yum.repos.d/epel.repo
enabled=1を0に変更
vi /etc/yum.repos.d/rpmforge.repo
enabled=1を0に変更
2.6 パッケージのインストール
LAMP関連のソフトが一発でインストールできる
yum --enablerepo=remi,epel,rpmforge install httpd-devel php-devel php-pear mysql-server phpmyadmin
2.7Apacheの不要モジュールのコメントアウト
不要モジュール
mod_auth_digest
mod_authn_file
mod_authn_anon
mod_authn_dbm
mod_authn_default
mod_authz_owner
mod_authz_groupfile
mod_authz_dbm
mod_authz_default
mod_ldap
mod_authnz_ldap
mod_logio
mod_ext_filter
mod_mine_magic
mod_expires
mod_deflate
mod_usertrack
mod_dav
mod_dav_fs
mod_vhost_alias
mod_actions
mod_speling
mod_proxy_ftp
mod_proxy_connct
mod_disk_chache
mod_file_chache
mod_mem_chache
3.Apacheの同時接続数設定
1GB 2コア(さくらVPS 1Gプラン)
httpd.conf
</IfModule prefork.c>
StartServers 10
MinSpareServers 5
MaxSpareServers 15
ServerLimit 256
MaxClients 40
MaxRequestsPerChild 1000
</IfModule>
4.各サービス起動
4.1 Apache起動
service httpd starat
4.2 MySQL起動
service mysqld starat
/user/bin/mysql_secure_installation #mysqlの設定用スクリプト
4.3 phpmyadminの設定
vi /user/share/phpmyadmin/conig.inc.php
5.再起動時の自動起動設定
chkconfig --list | grep -E "httpd|mysql"
chkconfig httpd on
chkconfig mysqld on
chkconfig --list | grep -E "httpd|mysql"
6.可能であれば再起動
可能であれば再起動してサービスの状況を確認したほうがよい
これはマスターしたほうがよさそう。
yumのリポジトリを追加するとかなり便利なんだ。
1.CentOS5.5→CentOS5.6へバージョンアップ
rpm -qa | grep centos-release #現行バージョンの確認
yum upgrade #アップグレード
rpm -qa | grep centos-release #バージョンアップ確認
2.yumリポジトリの追加
Fedora EPELとremiとRPMForgeの追加
2.1 Fedora EPELのダウンロード
wget http://donwload.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
2.2 remiのダウンロード
http://rpms.famillecollet.com/el5.x86_64/remi-release-5-8.el5.remi.noarch.rpm
2.3 RPMForgeのダウンロード
wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm
2.4 3つのリポジトリの追加
rpm -Uvh epel-release-5-4.noarch.rpm remi-release-5-8.el5.remi.noarch.rpm rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm
2.5 yum実行時以外にリポジトリが利用されることを防ぐ
(remiは初期設定でそうなっているので、FedoraEPELとRPMForgeを設定する)
vi /etc/yum.repos.d/epel.repo
enabled=1を0に変更
vi /etc/yum.repos.d/rpmforge.repo
enabled=1を0に変更
2.6 パッケージのインストール
LAMP関連のソフトが一発でインストールできる
yum --enablerepo=remi,epel,rpmforge install httpd-devel php-devel php-pear mysql-server phpmyadmin
2.7Apacheの不要モジュールのコメントアウト
不要モジュール
mod_auth_digest
mod_authn_file
mod_authn_anon
mod_authn_dbm
mod_authn_default
mod_authz_owner
mod_authz_groupfile
mod_authz_dbm
mod_authz_default
mod_ldap
mod_authnz_ldap
mod_logio
mod_ext_filter
mod_mine_magic
mod_expires
mod_deflate
mod_usertrack
mod_dav
mod_dav_fs
mod_vhost_alias
mod_actions
mod_speling
mod_proxy_ftp
mod_proxy_connct
mod_disk_chache
mod_file_chache
mod_mem_chache
3.Apacheの同時接続数設定
1GB 2コア(さくらVPS 1Gプラン)
httpd.conf
</IfModule prefork.c>
StartServers 10
MinSpareServers 5
MaxSpareServers 15
ServerLimit 256
MaxClients 40
MaxRequestsPerChild 1000
</IfModule>
4.各サービス起動
4.1 Apache起動
service httpd starat
4.2 MySQL起動
service mysqld starat
/user/bin/mysql_secure_installation #mysqlの設定用スクリプト
4.3 phpmyadminの設定
vi /user/share/phpmyadmin/conig.inc.php
5.再起動時の自動起動設定
chkconfig --list | grep -E "httpd|mysql"
chkconfig httpd on
chkconfig mysqld on
chkconfig --list | grep -E "httpd|mysql"
6.可能であれば再起動
可能であれば再起動してサービスの状況を確認したほうがよい