#1.1.备份原始源
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
#1.2.下载163的源
wget http://mirrors.163.com/.help/CentOS7-Base-163.repo -O /etc/yum.repos.d/CentOS-Base.repo
#1.3.更新
yum update -y
#2.1.安装
yum -y install httpd
#2.2.开启apache服务
systemctl start httpd.service
#2.3.设置apache服务开机启动
systemctl enable httpd.service
#2.4.允许http和https访问
firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --reload
#2.5.访问测试
curl 127.0.0.1
#3.1.安装
yum -y install php
#3.2.重启apache服务
systemctl restart httpd.service
#3.3.编写php脚本
echo '<?php phpinfo(); ?>' > /var/www/html/info.php
#3.4.访问测试
curl 127.0.0.1/info.php
#4.1.安装
yum -y install mariadb-server mariadb
#4.2.开启MySQL服务
systemctl start mariadb.service
#4.3.设置开机启动MySQL服务
systemctl enable mariadb.service
#4.4.设置root帐户的密码
mysql_secure_installation
#上述安装mariadb存在一定问题,找不到mysql_config文件,所以也可以安装mysqld数据库:
#4.1.安装mysql源
rpm -ivh http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
#4.2.安装mysql
yum install mysql-community-server mysql-devel -y
#4.3.启动mysql
service mysqld start
5.1.安装:
yum -y install php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-snmp php-soap curl curl-devel php-mysql php-devel
5.2.重启apache服务
systemctl restart httpd.service