symlinking web dir

Discussion in 'Installation/Configuration' started by tribis, Jun 19, 2023.

  1. tribis

    tribis New Member

    Hi,
    For reasons related to our depoyment we are trying to symlink our ./web directory to ../repo/public/
    Everyting works fine except for when we save a change to the vhost configuration.
    It triggers two:
    WARNING - Action aborted, file is a symlink: <...> client2/web44/web/stats/.htaccess
    This is due to the:
    function chmod($file, $mode, $allow_symlink = false) {...
    and
    function file_put_contents($filename, $data, $allow_symlink = false, $run_as_user = null){...
    I see that they have an argument: $allow_symlink
    Is there a way to configure passing $allow_symlink as true to these functions or get around this in any other way?
    Thx
     
    Last edited: Jun 19, 2023
  2. pyte

    pyte Well-Known Member HowtoForge Supporter

    I don't know why you set it up that way but you need "FollowSymLinks" set and make sure that the access rights to the directory are correct.
     
  3. recin

    recin Active Member

    ahrasis likes this.
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    No, symlinks are not allowed for the web directory for security reasons, and this is not configurable, as it would allow an attacker to damage your system possibly. You can try the suggestion from @recin to use a bind mount.
     
    ahrasis likes this.
  5. tribis

    tribis New Member

    Sorry for the huge delay in my reply. Thank you for all suggestions/comments:
    I tested pyte's suggestion but it does not work and it makes sense after Till's comment.
    However despite having the exact same behavior on a clone, the production server stopped issuing those warnings a few days after my post.
    And different websites on different servers that have been changed the same way have never issued warnings.

    Just to be more specific the file structure we have now is:
    <snip>
    log
    private
    repo
    .ssh
    ssl
    tmp
    web -> /var/www/mydomain.dk/repo/public

    so for now I'm happy

     

Share This Page