在EC2实例中创建Apache服务器
操作系统:亚马逊 Linux 2023
首先更新包装。
dnf install

安装httpd
dnf install httpd

移动到html目录。
cd /var/www/html

nano index.html
请键入以下内容
<html><h1>hallo world!</h1><html>

systemctl start httpd
使其自動啟動
systemctl enable httpd

确认网页是否已创建成功,复制EC2实例的公共IP地址,在Web上进行访问。如果能够显示,则表示成功。如果无法显示并且加载仍在继续,可能是安全组未允许HTTP访问的原因。