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 個月前檢視次數 216 次
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 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南