EC2 ubuntu内でDockerのhttpd(Apache)コンテナを起動してアクセスしても、403 Forbiddenとなる
解決したいこと
kindle unlimitedで読めるさわって学ぶクラウドインフラ docker基礎からのコンテナ構築の第3章にて、書籍通りにEC2 ubuntu上でDockerのhttpd(Apache)コンテナを起動してアクセスしても403 Forbiddenになってしまいます。
同様の問題をこちらの方の記事(【備忘録】EC2 ubuntu内でDockerのhttpd(Apache)コンテナを起動してアクセスしても、403 Forbiddenとなる問題)でも確認しており、解決策を実行すれば一応Apacheが動作するところまでは確認しています。(コンテナ内の権限を変えてssh接続できなるところも確認済みです)
ubuntu上のユーザでコンテナ内の操作ができれば解決できると考えているのですが、そもそもコンテナが立ち上がりません。
dockerに関する知識がないのですが、問題解決できる方法を教えていただけると幸いです。
発生している問題・エラー
実行コマンド
docker run -dit --name my-apache-app2 -p 8081:80 -v /etc/group:/etc/group:ro -v /etc/passwd:/etc/passwd:ro -u $(id -u $USER):$(id -g $USER) -v /home/ubuntu/:/usr/local/apache2/htdocs/ httpd:2.4
docker logs my-appの出力
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 172.17.0.3. Set the 'ServerName' directive globally to suppress this message
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 172.17.0.3. Set the 'ServerName' directive globally to suppress this message
[Sat Aug 05 07:27:29.417400 2023] [core:error] [pid 1:tid 140640644274048] (13)Permission denied: AH00099: could not create /usr/local/apache2/logs/httpd.pid.cxRAWj
[Sat Aug 05 07:27:29.418270 2023] [core:error] [pid 1:tid 140640644274048] AH00100: httpd: could not log pid to file /usr/local/apache2/logs/httpd.pid
0 likes