Reputation: 25
good I am new user in OpenShift, today I read the documentation, but it was not clear yet, how could I configure DocumentRoot. in my case I use cakephp 3 and for take my application into production I need to configure the DocumentRoot, this should be webroot for production, I am very interested in OpenShift, I just need to get through this problem to carry my applications to the cloud. I read that OpenShift set DocumentRoot but not if it applies to my case.
Upvotes: 0
Views: 396
Reputation: 60463
Well, if it's not possible to change DocumentRoot
setting manually (just ask their support), then you could rename your apps webroot
directory so that it conforms with OpenShifts automatic document root detection functionality:
[...]
The DocumentRoot is chosen by the cartridge control script logic depending on conditions in the following order:
IF php/ dir exists THEN DocumentRoot=php/ ELSE IF public/ dir exists THEN DocumentRoot=public/ ELSE IF public_html/ dir exists THEN DocumentRoot=public_html/ ELSE IF web/ dir exists THEN DocumentRoot=web/ ELSE IF www/ dir exists THEN DocumentRoot=www/ ELSE DocumentRoot=/
[...]
https://developers.openshift.com/en/php-getting-started.html#set-document-root
Maybe they'd even consider adding webroot
to their script if you ask them.
To change your applications webroot
directory, you'll need to do two things
Change the directory name as needed (for example to public
)
Adjust the WWW_ROOT
constant in your apps config/paths.php
file accordingly (for example define('WWW_ROOT', ROOT . DS . 'public' . DS);
)
Upvotes: 1