一、安装Apache
1.执行安装命令Apache及其扩展包
yum install -y httpd httpd-manual mod_SSL mod_perl mod_auth_mysql
如果显示如下图所示,则安装成功
2.启动Apache并设置自启动
systemctl start httpd
systemctl enable httpd
这里我就不设置自启动了
3.查看Apache是否启动
systemctl status httpd
服务启动成功
二、安装MySQL
1.下载MySQL命令
wget http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
yum install -y mysql57-community-release-el7-10.noarch.rpm
yum install -y mysql-community-server --nogpgcheck
2.启动MySQL服务
systemctl start mysqld.service
3.查看MySQL运行状态
systemctl status mysqld.service
4.查看MySQL数据库的初始密码
grep "password" /var/log/mysqld.log
以下步骤可不做
5.登录数据库
mysql -u root -p
6.修改数据库密码
ALTER USER 'root'@'localhost' IDENTIFIED BY '<新密码>';
三、安装PHP
1.安装PHP以及相关的库
yum install -y php70w-devel php70w.x86_64 php70w-cli.x86_64 php70w-common.x86_64 php70w-gd.x86_64 php70w-ldap.x86_64 php70w-mbstring.x86_64 php70w-mcrypt.x86_64 php70w-pdo.x86_64 php70w-mysqlnd php70w-fpm php70w-opcache php70w-pecl-redis php70w-pecl-mongodb
2.测试PHP是否安装成功
echo "<?php phpinfo(); ?>" > /var/www/html/phpinfo.php
3.重启Apache服务
systemctl restart httpd
4.访问http://IP/phpinfo.php
标签:httpd,教程,x86,CentOS7,LAMP,systemctl,64,php70w,MySQL From: https://www.cnblogs.com/puz2le/p/17688710.html