-2

Hi here I was openshift novice users, where before I used the cpanel for my hosting, and I want to switch to openshift, that I ask is how do I change the document root?, if previously on cpanel is Home/public_html/thelifestylelist.com to Home/public_html/thelifestylelist.com/public on openshift? (my index php is on public directory) Hopefully the picture below can clarify my question. Thank you.

enter image description here Sorry i used external link for my image, need at least 15 reputation to attach image. .

Dharmesh Rupani
  • 1,029
  • 2
  • 12
  • 22
ReallyNOOB77
  • 3
  • 1
  • 2

2 Answers2

5

This is the order OpenShift search for root directory

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=/ 

So you just add the any of this folders.

RamiroRS
  • 461
  • 3
  • 4
  • reference: [openshift#set-document-root](https://developers.openshift.com/languages/php/getting-started.html#set-document-root) – marlo Sep 16 '16 at 01:10
2

According to this blog post, there are multiple document roots you can use for your PHP project (or static html project), you can read it here: https://www.openshift.com/blogs/openshift-online-march-2014-release-blog. Since you are using open shift, it would probably be best to just use the document root they provide you by using git to download/upload your files to your gear. You might review this page to help you get started: https://www.openshift.com/get-started

  • thanks for the revision of my questions and thank you for your reply, I also use git to upload documents and push it, but my script requires the index to be in the public directory, is that possible to change the document root in openshift gear? – ReallyNOOB77 Aug 25 '14 at 02:43
  • Thanks, my question already solved. . it's automaticaly redirected to public directory. :D – ReallyNOOB77 Aug 25 '14 at 05:00
  • Hi developercorey, every i updated my script on openshift and push it with git bash, my old scripts will be transformed into its original state again, a lot of history or an image that was created before I update my script and push it to openshift document has gone, is there any suggestion for this? – ReallyNOOB77 Aug 26 '14 at 02:29