Change Document Root for existing site

Discussion in 'Installation/Configuration' started by Gary H, Jun 24, 2020.

Tags:
  1. Gary H

    Gary H New Member

    I don't find a solution for the following problem.

    I have lot of website into /var/www folder, now i want change the webpath for /home/sites folder.

    I change into IspConfig Server Config : see attached file.

    But it's didn't work, can you help me with a real instruction for move all existing site.

    Thanks
     

    Attached Files:

  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    ahrasis likes this.
  3. nhybgtvfr

    nhybgtvfr Active Member

    probably more useful for a specific site, or if you only have a few sites, but if you're trying to change the docroot to a subfolder of the standard docroot, eg public, try something like this in the apache directives section of the websites options:
    DocumentRoot "{DOCROOT}/public"
    if you're trying to change the whole docroot folder path, just give it the full path instead:
    DocumentRoot "/home/sites/clients/<clientid>/<webid>/<domainname.tld>/web"

    i don't recommend trying to change the basedir, i remember seeing somewhere, on here or in the manual, that changing that could cause all sorts of problems, although that could have been the php open basedir setting, my memory isn't what it used to be. :(
     
  4. Gary H

    Gary H New Member

    Then, i can't move all website from /var/www to /home/sites easier ?
     
  5. nhybgtvfr

    nhybgtvfr Active Member

    as @Taleman suggested, you could bind mount /home/sites to /var/www in /etc/fstab.

    i have another drive/partition mounted at /mnt/extdrive1 which contains the folders www and mysql which are bind mounted to /var/www and /var/lib/mysql and didn't change any basedir settings. works perfectly fine.
     
    ahrasis likes this.

Share This Page