主机访问虚拟机Web服务器

①主机访问虚拟机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

  • 0
    点赞
  • 47
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值