【CentOS5】lighttpd/PHP/MySQL/FastCGIの一括インストール・設定

毎回いろんなサイトを見て設定するのがめんどくさいのでメモっておきます。
流れとしてはリポジトリの追加からlighttpd/FastCGI/PHP/MySQLのインストール・設定です。
今後、設定の変更などあれば追記していきます。

■remiリポジトリの追加

# wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
# wget http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
# sudo rpm -Uvh remi-release-5.rpm epel-release-5-3.noarch.rpm


■lighttpd/PHP5.3/MySQL/FastCGIの一括インストール

# yum –enablerepo=remi install lighttpd lighttpd-fastcgi php mysql-server


■lighttpdのPHP有効設定

# vim /etc/lighttpd/lighttpd.conf
server.modules = (
“mod_access”,
“mod_fastcgi”,
“mod_accesslog”)
fastcgi.server = (“.php” =>
(“localhost” =>
(
“socket” => “/tmp/php-fastcgi.socket”,
“bin-path” => “/usr/bin/php-cgi”
)
)
)


■lighttpdのバーチャルホスト設定

# vim /etc/lighttpd/conf.d/vhosts.conf
$HTTP[“host”] == “www.exsample.com” {
server.document-root = “/home/vhosts/exsample.com/www/htdocs/”
}


■MySQLのinnodb追加設定

# vim /etc/my.cnf
default-character-set = utf8
default-table-type = InnoDB
innodb_data_file_path = ibdata1:128M:autoextend
innodb_additional_mem_pool_size = 20M
innodb_buffer_pool_size = 256M
innodb_log_buffer_size = 8M
innodb_log_file_size = 64M
innodb_flush_method = O_DIRECT
innodb_flush_log_at_trx_commit = 1


■SELINUX/iptableの無効(VirtualBoxのローカルマシンのみ)

# vim /etc/sysconfig/selinux
SELINUX=disabled
# /etc/init.d/iptables stop


0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x