安装Apache yum install httpd
安装MySql yum install mysql mysql-server
安装php yum install php
安装php的mysql模块 yum install php-mysql
启动Apache /etc/init.d/httpd start 重启Apache /etc/init.d/httpd restart
启动MySql服务 /etc/init.d/mysqld start
最后还需要将LAMP组件设置为自动启动: chkconfig --levels 2345 httpd on chkconfig --levels 2345 mysqld on 相关配置与环境 Apache主配置文件:/etc/httpd/conf/httpd.conf Apache主配置目录,可以将不同类型的配置分门别类放入这个目录中:/etc/httpd/conf.d/ Apache网站根目录:/var/www/html/ Apache日志文件目录:/var/log/httpd MySQL的my.cnf配置文件:/etc/my.cnf MySQL数据库文件位置:/usr/lib/mysql