LAMP环境yum懒人安装

1.安装Apache、MySQL、PHP及其相关组件

yum -y install httpd mysql mysql-server php php-mysql postgresql postgresql-server php-postgresql php-pgsql php-devel

2.启动程序

#启动Apache:
/etc/init.d/httpd start
#检测启动结果:
ps aux | grep httpd
#启动MySQL: 
 /etc/init.d/mysqld start
#检查启动结果:  
netstat -tulnp | grep :3306

3.修改MySQL密码

修改MySQL配置文件

vi /etc/my.cnf

在[mysqld]下面添加
skip-grant-tables

修改root密码:

mysqladmin -u root password "123456"
注:本环境适用于初学者,实战部署可能用到高版本和更多拓展组件。

你可能感兴趣的:(LAMP环境yum懒人安装)