一.yum的搭配
1.实现光盘镜像挂载
mkdir -p /repo/cos7dvd
mount /dev/cdrom /repo/cos7dvd
ls /repo/cos7dvd
2.禁用无效的yum源
ls /etc/yum.repos.d/
rm -rf /etc/yum.repos.d/*.repo
3.设置有效的yum
yum-config-manager --add file:///repo/cos7dvd
4.允许未知来源软件
vim /etc/yum.conf(进入文件后将gpqcheck=1改为0)
5.结果验证
yum clean all
yum repolist
二.利用yum安装LAMP平台
1.快速安装LAMP平台组件
yum -y install httpd mariadb-server.x86_64 mariadb php php-mysql.x86_64
2.确认安装情况
yum list httpd mariadb-server.x86_64 mariadb php php-mysql.x86_64
3..启动LAMP服务、查看状态
systemctl restart httpd mariadb
systemctl status httpd mariadb
4. 开启虚拟网卡
vim /etc/sysconfig/network-scripts/ifcfg-ens33(进入文件把ONBOOT=no改为yes)
systemctl restart network(重启网卡)
ifconfig(查看ip地址)
三.编写网页,关闭防火墙,实现访问
cd /var/www/html
vim test1.php
<?php
phpinfo();
?>
systemctl stop firewalld.service(关闭防火墙)
四. 在火狐浏览器输入ip地址,访问网页
http://192.168.159.131/test1.php