#网络设置相关
查看网络状态:
cd /etc/sysconfig/network-scripts
cat ifcfg-eno1677736
检查BOOTPROTO, 代表IP分配方式
route 查看路由列表
route -n 查看IP分配
systemctl status network.service 检查网络状态
systemctl start?stop?restart network.service 使用start或stop指令开启或关闭网络服务,使用 restart重启
ifdowm +interface号关闭interfce
ipconfig 查看IP状态
cat /etc/resolv.conf查看域名与IP映射
cat /etc/hosts 查看本机IP映射
#安装Apache Web Server
sudo dnf install httpd
sudo enable httpd.service启用HTPP服务
sudo systemctl start heepd.service启用apache服务
sudo firewall-cmd --permanent --add-service=http 防火墙允许通过HTTP协议访问本机网页
sudo firewall-cmd --permanent --add-service=https 防火墙允许通过HTTPS协议访问本机网页
sudo firewall-cmd --add-service=http
sudo firewall-cmd --add-service=https立即开放防火墙,此时通过浏览器在地址栏输入虚拟机地址应该可以访问到apache测试页
cd /var/www/html
vi index.html 定位并编辑主页
#管理多个站点
ifconfig eno16777736:0 192.168.232.140 netmask 255.255.255.0
ifconfig eno16777736:1 192.168.232.150 netmask 255.255.255.0
把eno16777736接口配置在140和150两个地址
vi /etc/httpd/conf/httpd.conf 打开配置文件
/Listen 查看监听端口
Listen 192.168.232.140:80 添加一个对于140:80的监听
O 返回插入模式