@实验要求:
搭建两个web网站:
1、在rhel8的系统上搭建网站:该网站ip地址主机位为11,设置documentroot为/www/你的名字拼音的缩写,网页内容为:my name is…
2、在rhel8的系统上搭建网站:该网站ip地址主机位为12,设置documentroot为/www/12,网页内容为:wo shi 你的姓名的拼音
- 手动配置IP
[root@bogon yum.repos.d]# nmcli connection modify ens160 ipv4.method manual +ipv4.addresses 192.168.171.11/24 ipv4.gateway 192.168.171.2 ipv4.dns 192.168.171.2 autoconnect yes
[root@bogon yum.repos.d]# nmcli connection up ens160
- 创建文件
[root@localhost ~]# vi ip11.conf
输入以下内容:
- 递归创建文件:
[root@localhost ~]# mkdir /www/ip/11 -p
- 重启服务:
[root@localhost ~]# systemctl restart httpd
- 书写文本文件
[root@localhost ~]# echo my name is hxy > index.html
- 确保getenforce为permissive,以及防火墙关闭
[root@localhost ~]# getenforce
Permissive
[root@localhost ~]# systemctl disable firewalld.service
Removed /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@localhost ~]# systemctl restart httpd //重启服务
- 第二个配置与第一个完全一样
- 所以直接复制
cp ip11.conf ip12.conf //复制
vi ip12.conf //把所以11的内容替换成12
mkdir /www/ip/12 -p //再创建新目录
echo wo shi hxy > /www/ip/12/index.html //创建新文本
systemctl restart httpd //重启服务即可