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
专家
已审核 2 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则

相关内容