[Stretch] Changing apache document root, php-fpm stops working

Discussion in 'Installation/Configuration' started by SergiX44, Jul 5, 2017.

  1. SergiX44

    SergiX44 Member

    Also, maybe @till can give a better explaination why FPM with mod_proxy_fcgi on stretch, breaks with symlink DocumentRoot.
     
  2. ztk.me

    ztk.me Well-Known Member HowtoForge Supporter

    yep, I was kinda blindfolded b/c of my hate on frameworks ... I appologize if any feelings were hurt ;)

    proxy_fpm indeed seems not to support symlinks, well it's not an ispconfig issue really - it's not meant to replace the actual documentroot but to easy custom <Directory> configurations.
    I'd still suggest to properly configure your framework though, to put sensitive data out of /web - for security reasons ;)

    Edit: would vote to change the docroot var not to be the symlinked placeholder - one just needs to take care he doesn't migrate by readding clients/webs leading to different numbers for the same web since symlinks adding extra "load" to the server
     
  3. SergiX44

    SergiX44 Member

    Yep, but simply overriding the docroot, it's the easiest way (if it works, obv) to expose only the frontcontroller.
    The fix it's quite easy, the docroot placeholder should put the real path and not the symlinked. It will be ensure backward compatibility, because I see that on Jessie if the DocumentRoot is real or sym doesn't make any difference for mod_fcgi. For migrations should not be a problem, because database-folders will match anyway.
     
  4. ztk.me

    ztk.me Well-Known Member HowtoForge Supporter

    depends, if you have other users on the server.
    /private folder doesn't have executeable bit set for "others" which is needed for www-data to access the files if you're not running mpm_itk for example.
     
  5. ztk.me

    ztk.me Well-Known Member HowtoForge Supporter

    no wait, /web actually does work with 710 hmm I wonder why it still has +x for others ... uhm well I tend to put stuff not meant for public outside the web-accessible folder, always, think of a mistake at some upgrade or vhost conf issue


    edit: well, nothing I have time for right now nor need for
     
    Last edited: Oct 7, 2017
  6. SergiX44

    SergiX44 Member

  7. Messi89

    Messi89 New Member

    For my laravel project I just add this on my Directives Apache:
    DocumentRoot "{DOCROOT_CLIENT}/public"

    No need to rename or change the Laravel folder structure
     
    ahrasis, Hbod and till like this.
  8. Hbod

    Hbod Member

    I can confirm, that this works for me aswell on my Project (while using DOCROOT didn't work, DOCROOT_CLIENT worked)

     
    ahrasis likes this.
  9. 4selin

    4selin New Member

    I have all time two DocumentRoots

    <VirtualHost *:80>

    DocumentRoot /var/www/clients/client3/web8/web

    # other directives

    DocumentRoot /var/www/clients/client3/web8/web/public

    </VirtualHost>
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    That's perfectly fine, the line that's later in the config file overrides the first line.
     

Share This Page