laravel-deploy-on-shared-hosting icon indicating copy to clipboard operation
laravel-deploy-on-shared-hosting copied to clipboard

Sub-domains: Inverse the symlink to point to the public/ dir from public_html for updates

Open nelson6e65 opened this issue 8 years ago • 3 comments

Hi.

I'm using https://servicioshosting.com, and instructions works! :clown_face:

But... When I use git pull I get some issues, since public is a symbolic link and I have to make cp ... mv ... etc each time I update content in my public/ folder in my repo.

For sub-domains, I use a symbolic link as sub-domain "folder" to point to my awesome/public/ folder directly:

ln -s ~/apps/awesome/public ~/public_html/awesome

It's working like a charm; no need to modify the routes in my public/index.php.

My questions are...

There something I'm not considering that will become a trouble later?

It only works in https://servicioshosting.com and may fail in other hosting providers?

nelson6e65 avatar Sep 01 '17 16:09 nelson6e65

I have tested your configuration on a godaddy server, but I have the following error:

"symbolic link not allowed or link target not accessible"

So I imagine that not all the hosting are prepared to support symlinks towards directories outside of public_html / www

Anyway, it is a good setup if the server allows it, more simple to get updated the sources

josevavia avatar Mar 27 '18 11:03 josevavia

This method works on Web Hosting Canada, and it does make updating the project much easier. @josevavia, are you sure it was your server that was causing the error, or could it have been the creation of the symbolic links? I also ran into that issue, but I was able to solve it by making sure permissions were set correctly and that the symbolic link directories did not exist before creating the symbolic link.

I was planning to update this guide for Laravel 5.6 and figured I would invert the symlink as well, since it seems like a nicer way to update projects. If there are any further issues with this method, please let me know - or maybe we could keep the original method as an alternate method in the case that the server doesn't allow this 'inverted' symlink.

macguirerintoul avatar Jul 31 '18 20:07 macguirerintoul

As I experience so far, only minor of shared hosting provides symlink.

And still, we always need to verify if public/index.php is loaded correctly or not.

petehouston avatar Aug 02 '18 13:08 petehouston