AlmaLinux8.4にapacheをインストールする

2021年10月3日

1.OSバージョンを確認

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# cat /etc/redhat-release
AlmaLinux release 8.4 (Electric Cheetah)
# cat /etc/redhat-release AlmaLinux release 8.4 (Electric Cheetah)
# cat /etc/redhat-release
AlmaLinux release 8.4 (Electric Cheetah)

2.httpd をインストール

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# sudo dnf -y install httpd
# sudo dnf -y install httpd
# sudo dnf -y install httpd

3.バージョンを確認

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# httpd -v
Server version: Apache/2.4.37 (AlmaLinux)
Server built: Apr 20 2021 10:48:33
# httpd -v Server version: Apache/2.4.37 (AlmaLinux) Server built: Apr 20 2021 10:48:33
# httpd -v
Server version: Apache/2.4.37 (AlmaLinux)
Server built: Apr 20 2021 10:48:33

3.起動
# sudo systemctl start httpd
自動起動を設定
# sudo systemctl enable httpd

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service → /usr/lib/systemd/system/httpd.service.
Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service → /usr/lib/systemd/system/httpd.service.
Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service → /usr/lib/systemd/system/httpd.service.

停止
# sudo systemctl stop httpd

状態確認
# systemctl status httpd

4.ファイアウォールを設定
# sudo firewall-cmd –add-port=80/tcp –zone=public –permanent
success

再起動
# sudo firewall-cmd –reload
success

画面確認
http://192.168.71.133:80/

AlmaLinux

Posted by arkgame