VirtueMart Forum

VirtueMart 2 + 3 + 4 => Administration & Configuration => Topic started by: Napoleon on August 14, 2016, 14:39:42 PM

Title: Safe Path outside Document Root
Post by: Napoleon on August 14, 2016, 14:39:42 PM
[Ubuntu 14.04, Apache2.4, php5 fastcgi, Joomla 3.4, Virtumart 3]

Hi,

  I am new to Virtumart and am having a little trouble with SAFE PATH.  The best option suggested, and with which I agree, is to have it located outside document root and not accessible through a URL, but I'm having trouble setting this up.  I have already read the post here (http://forum.virtuemart.net/index.php?topic=98633.0) and on gavick (https://www.gavick.com/blog/how-to-fix-safe-path-is-empty-error-in-virtuemart) but they don't answer what I'm trying to do.

  My Joomla installation is in the Document Root folder of my site (not a sub-folder) and I have access to the folders above my document root; e.g. /home/me, /bin, /etc, ...  A more formal way of expressing this is that my server is chrooted using jailkit.  The absolute path to my doc root is /var/www/me/web.
  So I created a folder to use as my Safe path in '/var/www/me/vmfiles' and set its permissions to 777 (for now) with the owner/group being my account (of course).  I then put that path into the Safe Path field in VM with a trailing '/'.  Having done this, I was surprised that VM was still complaining that it can't access that folder.

I can create an alias to that folder in my virtual host config file, but then it becomes accessible from a URL.  So I'm wondering how to set this up so that it can't be accessed through a URL.  Does VM use CGI?

Cheers,
Nap
Title: Re: Safe Path outside Document Root
Post by: GJC Web Design on August 14, 2016, 17:20:36 PM
so your Joomla and VM install are in /var/www/me/web?

then i see no reason why VM couldn't access /var/www/me/vmfiles/

try 755.. some servers hate 777 

but other than that this is where i would put my safe path in this example..

what is e.g. the temp path showing in the joomla config? And I assume it works
Title: Re: Safe Path outside Document Root
Post by: Napoleon on August 14, 2016, 18:07:28 PM
Joomla's Temp folder is /var/www/me/web/tmp, which is inside Doc Root, and my Joomla install is not complaining about it.
I tried 755 and 775 on /var/www/me/vmfiles, but it's still not working.  :(

Title: Re: Safe Path outside Document Root
Post by: GJC Web Design on August 14, 2016, 18:40:49 PM
with that temp should it not be  /var/www/me/web/vmfiles/   ?
Title: Re: Safe Path outside Document Root
Post by: Napoleon on August 15, 2016, 03:35:25 AM
No, because I can access that folder through the URL  mydomain/tmp/<file>, and I would be able to access vmfiles through mydomain/vmfiles/.


Title: Re: Safe Path outside Document Root
Post by: GJC Web Design on August 15, 2016, 10:48:21 AM
so /web contains the site files?

if so /var/www/me/vmfiles/ is correct and you need to sort your strange access problems.. on a typical setup this works..
otherwise follow the instructions for a folder  in the site with obscure path name