CentOS yum安装LAMP环境
本文适用于所有的vps,测试环境为NordicVPS 256M XEN
非LNMP,非一键安装包
yum -y update
yum -y install gcc gcc-c++ autoconf make automake libtool libevent libevent-devel
yum -y install ncurses ncurses-devel gd gd-devel freetype freetype-devel fontconfig
fontconfig-devel libjpeg libjpeg-devel zlib zlib-devel pcre pcre-devel
yum -y install libmcrypt mhash gmp gmp-devel
yum -y install mysql mysql-server mysql-devel
yum -y install httpd httpd-devel
yum -y install php*
rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY*
yum install -y php-eaccelerator
#启动apache
/etc/init.d/httpd restart
#启动mysql
/etc/init.d/mysqld restart
chkconfig httpd on
chkconfig mysqld on
#生成phpinfo文件
cat>>/var/www/html/info.php< phpinfo();
?>
EOF
现在可以通过http://ip/info.php查看LAMP信息了
附1:mysql配置文件所在位置:/etc/my.cnf
附2:apache配置文件目录所在位置:/etc/httpd/
附3:php配置文件所在位置:/etc/php.ini
原文出自tony1999之手
none