Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Tips/Tricks/Mods

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 25th October 2010, 23:58
kennethlmartin kennethlmartin is offline
Junior Member
 
Join Date: Oct 2010
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default cakephp and ispconfig

I'm trying to move my cake core folder and app folders outside of my web root directory. Everything works fine when I place all my files in the "web" directory but when I move them outside of this directory I can't access them using the absolute paths to where I want these directories located. In cakephp you can edit these settings in the config file to do what I want and they work on my my local machine and on another server not running ispconfig. Am I getting the paths wrong or is there permissions issues resulting from ispconfig. Any help would be great because leaving all these folders in the web root directory is not ideal.

from cakephp's index.php file in web root.

Code:
/**
 * These defines should only be edited if you have cake installed in
 * a directory layout other than the way it is distributed.
 * When using custom settings be sure to use the DS and do not add a trailing DS.
 */

/**
 * The full path to the directory which holds "app", WITHOUT a trailing DS.
 *
 */
	if (!defined('ROOT')) {
		define('ROOT', DS . 'var' . DS . 'www' . DS . 'clients' . DS . 'client0' . DS . 'web5');
	}
/**
 * The actual directory name for the "app".
 *
 */
	if (!defined('APP_DIR')) {
		define('APP_DIR', 'app');
	}
/**
 * The absolute path to the "cake" directory, WITHOUT a trailing DS.
 *
 */
	if (!defined('CAKE_CORE_INCLUDE_PATH')) {
		define('CAKE_CORE_INCLUDE_PATH', DS . 'var' . DS . 'www' . DS . 'clients' . DS . 'client0' . DS . 'web5');
	}
Reply With Quote
Sponsored Links
  #2  
Old 26th October 2010, 10:07
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 35,981
Thanks: 825
Thanked 5,371 Times in 4,218 Posts
Default

PHP files are only allowed in the web folder for security reasons. If you want to have files outside of the web dir, then you have to add the path that you want to use to the open basedir path on the options tab of the website settings.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 26th October 2010, 10:21
kennethlmartin kennethlmartin is offline
Junior Member
 
Join Date: Oct 2010
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I ended up just adding
Code:
DocumentRoot /var/www/clients/client0/web5/web/app/webroot
to my Apache directives settings under the websites options tab. Seems to work fine and now my app and cake core directories are inside the /web directory so they're accessible to php and outside the document root directory.

Although now document root is declared twice but I don't know if that is going to be a problem at all...
Reply With Quote
  #4  
Old 26th October 2010, 10:26
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 35,981
Thanks: 825
Thanked 5,371 Times in 4,218 Posts
Default

Quote:
Although now document root is declared twice but I don't know if that is going to be a problem at all...
Thats hosuld not be a problem as declarations that come later in the file simply override the first one. But you will not ba eable to access statistics anymore. Adding your path to the open_basedir will be the cleaner solution.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #5  
Old 26th October 2010, 21:25
kennethlmartin kennethlmartin is offline
Junior Member
 
Join Date: Oct 2010
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It appears that the open_basedir text box only allows so many characters. Is there another place I can input this information for longer file paths that may not fit here or can I remove subdirectories like ./domain.com/web and just have ./domain.com here
Reply With Quote
  #6  
Old 2nd November 2010, 01:01
astewart astewart is offline
Member
 
Join Date: Feb 2007
Posts: 95
Thanks: 1
Thanked 7 Times in 7 Posts
Default

It's true
The php open_base dir field is limited by characters
Reply With Quote
  #7  
Old 2nd November 2010, 09:15
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 35,981
Thanks: 825
Thanked 5,371 Times in 4,218 Posts
Default

Install the 3.0.3.1 RC1, the field has been extended there. But I really dont know how you could have reached the limit in the current ispconfig 3.0.3 as it is already 64 000 chars.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #8  
Old 2nd November 2010, 14:44
kennethlmartin kennethlmartin is offline
Junior Member
 
Join Date: Oct 2010
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

255 characters actually...
Reply With Quote
  #9  
Old 2nd November 2010, 17:25
Turbanator Turbanator is offline
Senior Member
 
Join Date: Jun 2008
Posts: 218
Thanks: 22
Thanked 16 Times in 16 Posts
Default

I'm curious why you need to make any changes at all. I have cakephp sites running and didn't make any changes at all. Using the standard cake layout of web/app/webroot/ with the .htaccess handling the redirect.

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
</IfModule>
Reply With Quote
  #10  
Old 2nd November 2010, 18:12
kennethlmartin kennethlmartin is offline
Junior Member
 
Join Date: Oct 2010
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

It's true you can just plop the whole thing in the web directory but for a production site you should remove both your app and cake core directories from your document root and you can tell your application where you've placed directories in the index.php file located in your webroot. I also like to have one cake core directory serving multiple applications as well.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 18:02.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.