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之手

posted on   cn三少<script></script>  阅读(322)  评论(0编辑  收藏  举报

导航

< 2012年8月 >
29 30 31 1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31 1
2 3 4 5 6 7 8
点击右上角即可分享
微信分享提示