apache not reading updated symlink

Discussion in 'General' started by vgttt, Nov 15, 2018.

  1. vgttt

    vgttt New Member

    I have a symlink at /var/www/domain.example/web/MY_SYMLINK pointing to /var/www/domain.example/web/SOME_FOLDER. This is defined as my document root for the website.

    Then I run ln -sfn to change the symlink to something like /var/www/domain.example/web/NEW_FOLDER.
    So far, so good. If I run ls -a it's possible to see that the change was applied.

    If I hit the server at http://domain.example, the website still pointing to the old folder. I know that apache needs to be restarted, so I run service apache2 restart but the change isn't performed. I've tried with apache2 stop/start, reload or graceful. None of them works.

    The symlink update is only applied if I go to ISPConfig's control panel and hit Resync.

    I wanna be able to perform this from the command line. Anyone know how to do it?
  2. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    Just speculating, ispconfig appears to determine the doc root is a symlink and must right the link target in the vhost file; you could to a quick test and verify that, and assuming that's the case, you could just update the vhost file yourself after changing the symlink.
  3. vgttt

    vgttt New Member

    Makes sense.. I'll search in filesystem and verify this behavior... thanks for sharing your thoughts...
  4. vgttt

    vgttt New Member

    The vhost file seems ok. The document root defined by ISPConfig is right. I have a custom document root provided by the "options" tab on site configuration. It's pointing to those symlinks I said. Take a look:

    That's the vhost file:

    <Directory /var/www/domain.example.com>
    AllowOverride None
    Require all denied​

    <VirtualHost *:80>
    DocumentRoot /var/www/clients/client4/web29/web
    And that's the custom document root I provide pointing to the symlink, it's appended at the same vhost file, just before the closing VirtualHost tag. ("dev" is the symlink)

    DocumentRoot "/var/www/domain.example.com/web/dev"
    Header set X-Robots-Tag "noindex, nofollow"​

Share This Page