①主机访问虚拟机Web服务器
基本步骤(虚拟机上启动httpd):
1、安装httpd:yum install httpd
2、启动httpd:systemctl start httpd.service
3、关闭firewall:systemctl stop firewalld.service
设置虚拟机为NAT连接:
1、点击虚拟机——设置(选择NAT模式(N):用于共享主机的IP地址)
2、 点击编辑——虚拟网络编辑器
3、点击NAT设置
②内容补充:
一、VMware Workstation的三种联网方式:
Brigde——桥接、NAT——网络地址转换、Host-Only——私有网络共享主机
二、虚拟机上启动httpd
1、安装httpd:yum install httpd
2、启动httpd:systemctl start httpd.service
3、停止httpd:systemctl stop httpd.service
4、重启httpd:systemctl restart httpd.service
三、设置开机启动、关闭
1、开机启动:systemctl enable httpd.service
2、开机不启动:systemctl disable httpd.service
四、检查httpd状态
1、systemctl status httpd.service
五、关闭防火墙
1、停止firewall:systemctl stop firewalld.service
2、禁止firewall开机启动:systemctl disable firewalld.service