はじめにh2
自宅ラボの Nested ESXi の自動インストールのために利用する WEB サーバを Photon OS 5 で構築した時の作業を備忘のために残しておく。
※本記事は簡易な WEB サーバを構築する手順を記載する
この記事を読んで欲しい人h2
- Photon OS 5 を利用して同様に WEB サーバを構築したいと考えている人
WEB サーバ構築h2
-
Photon OS に root ログインする
-
自宅ラボの動作確認を簡素化するためにファイアウォールを停止
Terminal window systemctl stop iptablesWarning: The unit file, source configuration file or drop-ins of iptables.service changed on disk. Run 'systemctl daemon-reload' to reload units.Terminal window systemctl disable iptablesRemoved "/etc/systemd/system/multi-user.target.wants/iptables.service".
-
Apache HTTP Server 機能のパッケージをインストール
Terminal window tdnf install -y httpd
-
httpd 起動
Terminal window systemctl start httpd
-
httpd の自動起動を設定
Terminal window systemctl enable httpdCreated symlink /etc/systemd/system/multi-user.target.wants/httpd.service → /usr/lib/systemd/system/httpd.service.
-
httpd のステータスを確認
正常に起動していることを確認するTerminal window systemctl status httpd● httpd.service - The Apache HTTP ServerLoaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; preset: disabled)Active: active (running) since Sat 2025-07-19 13:27:05 UTC; 1 day 15h agoProcess: 975 ExecStart=/usr/sbin/httpd -k start (code=exited, status=0/SUCCESS)Main PID: 977 (httpd)Tasks: 109 (limit: 2370)Memory: 12.2MCPU: 17.996sCGroup: /system.slice/httpd.servicetq 977 /usr/sbin/httpd -k starttq 978 /usr/sbin/httpd -k starttq 979 /usr/sbin/httpd -k starttq 980 /usr/sbin/httpd -k startmq1112 /usr/sbin/httpd -k start
-
Apache HTTP Server バージョン確認
いずれかのコマンドでバージョンを確認Terminal window httpd -vTerminal window apachectl -vServer version: Apache/2.4.62 (Unix)Server built: May 27 2025 13:08:25
-
テスト用コンテンツを作成
Terminal window echo '<h1>Test</h1>' > /etc/httpd/html/index.html
-
テスト用コンテンツの取得確認
curl コマンドに Photon OS の IP アドレス(192.168.1.251)を指定WARNINGIP アドレス(192.168.1.251)はご自身の環境にお置き換えください
Terminal window curl 192.168.1.251<h1>Test</h1>
環境h2
- Photon OS 5 (Build:b9d98344d)
- Apache 2.4.62