update
it seems php files placed under /storage/app/thirdpartydirectory
not being executed, instead laravel notfoundhttpexception thrown. simple text files, images, etc accessible via http://example.com/thirdpartydirectory.
original question
i building laravel 5 site using envoyer.io code deployments. way envoyer works, new code pushed site , placed under /releases
directory, symlinked /current
top level (so /current
points latest /releases
subdirectory).
the problem put in site's /public
directory included in envoyer deployments, replicated every single time push new code. trying use third party app must have index.php
, other files/directories directly exposed outside world. when app first loaded, installation process begins , installs additional config files various folders. when deploy next batch of code, /public
pushed again without installation , cache files generated third party app - causing loop of having run installation process on , on again.
i reached out taylor otwell regarding , suggestion place app in /storage/app/thirdpartyapp
, make symlink each release's public
directory before activating each new deployment -
cd {{release}} ln -s /home/eyf/storage/app/thirdpartyapp public/thirdpartyapp
this creates symlink without issues when try access app (http://example.com/thirdpartyapp), stuck on laravel notfoundhttpexception page. app has index.php, if go http://example.com/thirdpartyapp/index.php, laravel site's index page loaded instead - if it's totally ignoring symlink , /thirdpartyapp
in url.
the app ship following .htaccess
, not sure if makes difference in of this:
<ifmodule mod_alias.c> # default disallow access base git folder redirectmatch /\.git(/|$) /404 </ifmodule> # cache images while <ifmodule mod_expires.c> expiresactive on expiresbytype text/css "access plus 1 month" expiresbytype text/javascript "access plus 1 month" expiresbytype image/gif "access plus 1 month" expiresbytype image/jpg "access plus 1 month" expiresbytype image/png "access plus 1 month" </ifmodule> # compress output if can <ifmodule mod_deflate.c> # set output filter zipping content setoutputfilter deflate # netscape 4.x , 4.06-4.08 have issues browsermatch ^mozilla/4 gzip-only-text/html browsermatch ^mozilla/4\.0[678] no-gzip # msie can issue, catch msie browsermatch \bmsie[56] !no-gzip !gzip-only-text/html # exclude file types compression setenvifnocase request_uri \.(?:gif|jpe?g|png|pdf|zip|tar|rar|gz|dmg|mp3|mp4|m4a|m4p|mov|mpe?g|qt|swf)$ no-gzip dont-vary # make sure proxy servers deliver they're given <ifmodule mod_headers.c> header append vary user-agent env=!dont-vary </ifmodule> </ifmodule> <ifmodule mod_rewrite.c> rewriteengine on # set if have installation in subdirectory # rewritebase /openvbx # default use ssl #rewritecond %{https} !=on #rewriterule ^(.*) https://%{server_name}%{request_uri} [l,r] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*) index.php?vbxsite=$1 [e=http_authorization:%{http:authorization},l,qsa] #rewriterule ^(.*) index.php/$1 [l,qsa] errordocument 404 /fallback/rewrite.php </ifmodule>
apparently php code placed under /storage
in laravel app isn't executed. moved third party app's directory parent folder , symlinked that, works.