现在,我们可以快速全自动搞定LNMP 的安装了

先新建一个 repo
# vi /etc/yum.repos.d/alt.ru.repo

 [CentALT] 
name=CentALT Packages for Enterprise Linux 5 - $basearch baseurl=http://centos.alt.ru/repository/centos/5/$basearch/ 
enabled=1
gpgcheck=0
protect=1

启用 EPEL repo
i386
rpm -ihv http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
x86_64
rpm -ihv http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-3.noarch.rpm
好了,一键安装

# yum install nginx php-fpm mysql mysql-server

更完整的安装
yum -y update
yum -y mysql mysql-server
mysqladmin -u root password root
yum -y install nginx php-fpm php-cli php-pdo php-mysql php-mcrypt php-mbstring php-gd php-tidy php-xml php-xmlrpc php-pear php-pecl-memcache php-eaccelerator

# APC 和 eAccelerator 有冲突,2选1
yum -y install php-pecl-apc

看下我的完整安装,只要一句
yum -y install nginx mysql mysql-server php-fpm php-cli php-pdo php-mysql php-mcrypt php-mbstring php-gd php-tidy php-xml php-xmlrpc php-pear php-pecl-memcache php-eaccelerator