前提:
本地仓库的搭建或主机dnf可上网
一、安装httpd
提供此协议的软件: Apache
软件包名称 httpd
共享位置 /var/www/html
安装命令 dnf install httpd -y
[root@node26 mnt]# dnf whatprovides httpd
[root@node26 mnt]# dnf install httpd-2.4.37-30.module_el8.3.0+561+97fdbbcc.x86_64 -y
二、启用共享软件Apache
systemctl stop firewalld
立即停止防火墙
[root@node26 mnt]# systemctl stop firewalld.service
systemctl disable firewalld
开机禁用防火墙
[root@node26 mnt]# systemctl disable firewalld.service
Removed /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@node26 mnt]#
systemctl disable --now firewalld
等于上面两条,开机禁用并立即停用防火墙
systemctl enable --now httpd
开机启动并立即开启httpd
[root@node26 mnt]# systemctl enable --now httpd
Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service → /usr/lib/systemd/system/httpd.service.
三、建立共享目录
mkdir /var/www/html/westos
[root@node26 mnt]# mkdir /var/www/html/westos