rhce web作业

1.要求搭建web服务器,能够访问到网页内容为“小胖,你咋这么胖呢!” 

1. 下载httpd

yum install httpd

2.重启httpd

  systemctl restart httpd

3.编辑网页资源文件

cd /var /www/html

vim index.html

4.浏览器访问

http://192.168.137.128/

 2.要求搭建web服务器,创建基于域名的虚拟主机,能够使用www.xiaopang.com和www.dapang.com访问各自的网站网站存放路径分别为/xiaopang和/dapang,内容自定。

1.添加多个ip地址134   100  200
# nmcli connection modify ens160 ipv4.method manual  ipv4.addresses 192.168.10.100/24 +ipv4.addresses 192.168.10.200/24 ipv4.gateway 192.168.10.2 ipv4.dns 114.114.114.114 connection.autoconnect yes
 nmcli connection up ens160
2.关闭防火墙和selinux 
   #systemctl stop firewalld
   #setenforce 0
3.安装对应的服务软件Apache http server
 # mount  /dev/sr0 /mnt
   yum  install httpd
4.更改配置文件实现自定义设置
vim /etc/httpd/conf.d/vhosts.conf
<VirtualHost  192.168.10.134:80>        ServerName 192.168.10.134        DocumentRoot /www/openlab</VirtualHost><Directory /www>        AllowOverride none        Require all granted</Directory><VirtualHost  192.168.10.100:80>        ServerName 192.168.10.100        DocumentRoot /www/xiaopang</VirtualHost><VirtualHost  192.168.10.200:80>        ServerName 192.168.10.200        DocumentRoot /www/dapang</VirtualHost>

5.根据配置创建资源文件
mkdir  -p /www/{openlab,xiopang,dapang} 
echo this is 134 > /www/openlab/index.html
echo this is 100> /www/xiaopang/index.html
echo this is 200 > /www/dapang/index.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

她说戴了就不算给

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值