vagrant-lamp icon indicating copy to clipboard operation
vagrant-lamp copied to clipboard

Using Symlinks in /public

Open thehashrocket opened this issue 11 years ago • 3 comments

I'd like to use symlinks (or something better?) to map paths from /public to my projects in my projects folder.

I thought I could just place a symlink in there and i'd be ok since FollowSymLinks is in Options in the virtualhost file. However, this doesn't seem to be the case. I made sure to do chmod o+x on the folder also.

Anyway, I've tried googling but really haven't found anyone whose doing that so maybe you have an idea?

Here's a copy of the error i'm seeing in the log:

[client 192.168.33.1] Symbolic link not allowed or link target not accessible: /vagrant/public/homewood.dev

thehashrocket avatar Jan 22 '14 18:01 thehashrocket

This might be a 'problem' (there's a good reason for it) with VirtualBox itself; https://coderwall.com/p/qklo9w

I don't think allowing symlinks by default would be a good option though. This would introduce the mentioned security vulnerability to the vagrant-lamp project where users might modify files outside of the public directory without knowing.

When I first provisioned this box I ran into the same thing, so I'd love to see a discussion started here on what would be the 'right way' or 'lesser evil'.

My workflow now is to checkout the project to the 'public' directory and set the docroot in the databag.

Martin1982 avatar Feb 25 '14 13:02 Martin1982

@jshultz in your vagrantfile you can map the directory as a synced folder. I completely deleted the public folder from the vagrant and then added this to my vagrant file. Now my Projects dir is the Public dir without any symlinking.

config.vm.synced_folder "../../Projects", "/vagrant/public", mount_options: ['dmode=777','fmode=666']

pmgarman avatar Feb 28 '14 16:02 pmgarman

thank you! :)

Jason Shultz

Tel: 801-784-0224 url: www.JasonShultz.com

On Fri, Feb 28, 2014 at 9:39 AM, Patrick Garman [email protected]:

@jshultz https://github.com/jshultz in your vagrantfile you can map the directory as a synced folder. I completely deleted the public folder from the vagrant and then added this to my vagrant file. Now my Projects dir is the Public dir without any symlinking.

config.vm.synced_folder "../../Projects", "/vagrant/public", mount_options: ['dmode=777','fmode=666']

Reply to this email directly or view it on GitHubhttps://github.com/r8/vagrant-lamp/issues/77#issuecomment-36369228 .

thehashrocket avatar Feb 28 '14 16:02 thehashrocket