Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Outside directory #96

Closed
Sydney-o9 opened this issue Aug 2, 2012 · 8 comments
Closed

Outside directory #96

Sydney-o9 opened this issue Aug 2, 2012 · 8 comments

Comments

@Sydney-o9
Copy link
Contributor

Hi,

I can't manage to keep my pictures outside the web root. As explained in the doc, I overrided the DataLoader service and defined a custom path: %kernel.root_dir%/data/uploads

I changed the config file accordingly, is this correct?

liip_imagine:
driver: gd
web_root: %kernel.root_dir%/data/uploads
data_root: %kernel.root_dir%/data/uploads
cache_prefix: /media/cache
cache: web_path
data_loader: filesystem
controller_action: liip_imagine.controller:filterAction
formats: []

Many thanks for this amazing bundle.

@lsmith77
Copy link
Contributor

lsmith77 commented Aug 6, 2012

i will try to get to this during this week .. i have never tried to configure the Bundle like this myself before, so i will first need to setup something like this myself .. that being said .. have you tried debugging this yourself? there are just a couple classes you need to step through in the Imagine dir of this Bundle

@Sydney-o9
Copy link
Contributor Author

Thanks @lsmith77 Yes, I tried ro debug it myself and haven't managed to get it right so far. I'll definitely give it an other shot asap. Thanks.

@nass600
Copy link
Contributor

nass600 commented Nov 16, 2012

I can't get it work also. Any update on this?

@nass600
Copy link
Contributor

nass600 commented Nov 17, 2012

Ok. I get it work. Just a dismissal. Thank you for this amazing bundle

@Sydney-o9
Copy link
Contributor Author

Thanks for your comments @nass600 I am so glad you managed to do this as I still can't... Would you mind giving a few tips on how to do this? That would be awesome.

@nass600
Copy link
Contributor

nass600 commented Nov 17, 2012

Of course @Sydney-o9.

First of all you need to set in config.yml the parameter data_root as you did but pointing to the source directory instead of the target one, in this example /home/user/.

Create the web/media/cache directories to generate the thumbnails in case you didn't. Remember the permissions.

Finally, you need to tell Apache which directory outside the web root you want to access. For Symfony2 I usually place an apache.xml file inside app/config where I define where is located my foreign directory and afterwards you should set an Include "/path/to/this/apache.xml" directive in the project's vhost.
Doing this I do not have to change again and again the vhost if I modify the directory where I want to access from this particular project

The apache.xml would look like:

Alias /Photos /home/user/Photos
<Directory "/home/user/photos">
AllowOverride All
Allow from All

Following this location means your photo's relative path must be /Photos/subdirs/file

Hope it helps

@Sydney-o9
Copy link
Contributor Author

You're a legend @nass600. Many thanks :)

@lsmith77
Copy link
Contributor

would be great if you could see how to integrate those instructions into the README.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants