Create an Elasticbeanstalk environment (php) with a documentRoot /web. Got DocumentRoot '/var/www/html/web' is not a directory, or is not readable

0

Hello

I tried to create a new Environment (php) manually through UI. The environment is just have as "Sample application" with Apache server. I then entered "DocumentRoot" as /web (instead of empty). However, the environment was not created successfully:

I ssh to that server and ran the command:

systemctl status httpd.service

Mar 07 22:30:28 ip-10-1xxxxxxxxxxx.compute.internal httpd[2539]: DocumentRoot '/var/www/html/web' is not a directory, or is not readable

I checked and found that the folder /var/www/html/web is not created automatically.

Could you please help - to fix this error

Thanks

son
質問済み 2ヶ月前217ビュー
1回答
0
承認された回答

Hello.

The content of Elasticbeanstalk's php sample application is placed in "/var/www/html", so setting the document root to "/web" will result in an error.
Even if you set the "DocumentRoot" value, ElasticBeanstalk should not automatically create the directory, so that error will occur.
For example, if your custom application has content in a directory called "/web", the value of "DocumentRoot" should be "/web".

ls -la /var/www/html/
total 20
drwxr-xr-x. 2 webapp webapp  107 Mar  8 00:49 .
drwxr-xr-x. 3 root   root     21 Mar  8 00:49 ..
-rw-r--r--. 1 webapp webapp   90 Sep 29 19:02 cron.yaml
-rw-r--r--. 1 webapp webapp 2769 Sep 29 19:02 index.php
-rw-r--r--. 1 webapp webapp  189 Sep 29 19:02 logo_aws_reduced.gif
-rw-r--r--. 1 webapp webapp  367 Sep 29 19:02 scheduled.php
-rw-r--r--. 1 webapp webapp 3490 Sep 29 19:02 styles.css

https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_PHP.container.html#php-console

Document root – The folder that contains your site's default page. If your welcome page is not at the root of your source bundle, specify the folder that contains it relative to the root path. For example, /public if the welcome page is in a folder named public.

profile picture
エキスパート
回答済み 2ヶ月前
profile picture
エキスパート
レビュー済み 1ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ