RHEL8 Apacheをインストールする方法

環境
CentOS 8
RHEL 8

操作方法
1.OSバージョンを確認する
# cat /etc/redhat-release
# uname -r

2.パッケージhttpdをインストールする
# dnf -y install httpd

3.サービスの起動

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# systemctl enable --now httpd.service
# systemctl enable --now httpd.service
# systemctl enable --now httpd.service

確認

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# systemctl status --no-pager httpd.service
# systemctl status --no-pager httpd.service
# systemctl status --no-pager httpd.service

4.firewalldが有効になっている場合は、HTTP通信を許可する設定を行います。デフォルトのゾーン(public)以外を使用している場合は、publicの箇所に任意のゾーン名を指定します。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# firewall-cmd --permanent --zone=public --add-service=http
# firewall-cmd --reload
# firewall-cmd --permanent --zone=public --add-service=http # firewall-cmd --reload
# firewall-cmd --permanent --zone=public --add-service=http
# firewall-cmd --reload

 

CentOS Stream 8

Posted by arkgame