Sentora Support Forums
change web root - Printable Version

+- Sentora Support Forums (https://senforums.mach-hosting.com)
+-- Forum: Sentora Forum Archives (https://senforums.mach-hosting.com/forumdisplay.php?fid=5)
+--- Forum: Sentora Public Support Forums v1.0.x (https://senforums.mach-hosting.com/forumdisplay.php?fid=32)
+---- Forum: General Support Forum v1.0.x (https://senforums.mach-hosting.com/forumdisplay.php?fid=36)
+---- Thread: change web root (/showthread.php?tid=1594)



change web root - tecx20 - 05-18-2015

how change web root of a domain
from
sentora/hostdata/[user]/public_html/[domain]/
to
sentora/hostdata/[user]/public_html/[domain]/www
Huh Huh

this solution seem not to work for me as i'm able to choose subfolder
http://forums.sentora.org/showthread.php?tid=1495&pid=9581


RE: change web root - apinto - 05-18-2015

Hello @[tecx20],
The solution you provided is the easy way and if you read it carefully it will work (100% sure of this);

However it all depends on what you need to do, is it to install a framework like Laravel that will have php scripts outsidee the www folder?
If yes, then you need a different approach.

  1. Add the Domain the normal way, so it creates a DOMAIN_TLD folder.
  2. Wait 5 minutes for the Daemon to Run.
  3. Go to Admin > Module Admin (on Sentora CP).
  4. Select Apache Config (it's the very first option).
  5. Scroll Down to the end of the page and under the Override a Virtual Host Setting choose the website you want.
  6. Now on the text area input: Custom Entry you need to enter the following  :
    Code:
    DocumentRoot "/var/sentora/hostdata/ACCOUNT/public_html/DOMAIN_TLD/www"
  7. (do not forget to click Save when you are done)

With this way you will be able to have a different openbase_dir than your DocumentRoot, allowing you to access the files under public_html and www via your php scripts (this is NEEDED by almost all modern frameworks @[TGates] @[Me.B] Wink )


RE: change web root - tecx20 - 05-18-2015

thanks that works for i'm using yii framework here.
One more question where to edit php.ini without using putty


RE: change web root - Me.B - 05-18-2015

.htacces can translate paths in the easy way and do the magic, so you map / to www/.

Don't like using override for this change and think we should remove such feature from sentora panel ( once we provide SSL support).

M B


RE: change web root - apinto - 05-18-2015

(05-18-2015, 06:57 PM)Me.B Wrote: .htacces can translate paths in the easy way and do the magic, so you map / to www/.

Don't like using override for this change and think we should remove such feature from sentora panel ( once we provide SSL support).

M B

I do agree that the overwrite might not be the best solution, however I think .htaccess is not a clean way to do it.
Source 1: https://coderwall.com/p/erbaig/laravel-s-htaccess-to-remove-public-from-url
Source 2: My experience as a web developer.

The better solution would be to add a way to change/edit the document root for every domain, this should be standard


RE: change web root - apinto - 05-18-2015

(05-18-2015, 06:53 PM)tecx20 Wrote: thanks that works for i'm using yii framework here.
One more question where to edit php.ini without using putty

@[tecx20] you can't edit php.ini without using SSH.

Give a try at http://winscp.net/ as it lets you browse the filesystem with a GUI, also you can edit files using oyur local text editor (for example Sublime Text or NotePad++).


RE: change web root - tecx20 - 05-18-2015

okay then will go with winscp for now.
thanks for the fast reply