messed up file/dir owner:group

Discussion in 'Installation/Configuration' started by traezi, Mar 14, 2025.

  1. traezi

    traezi New Member

    Hey everyone,
    as my Nextcloud needed very much space i was in need to mount a volume with enough space to /var/www

    Here is how i done it:
    1. mounted the volume to /mnt/new-www via fstab (/dev/disk/by-id/scsi-0HC_Volume_1234567890 /mnt/new-www ext4 discard,nofail,defaults 0 0)
    2. cp -R /var/www/* /mnt/new-www
    3. umount /mnt/new-www
    4. edited the fstab to change to destination to /var/www (placed it in front of the ispconfig bind mounts)
    5. systemctl stop {nginx,postfix,mariadb}
    6. mv /var/www /var/www.bak
    7. rebooted the server
    But it messed up my ownerships...everything is owned now by root:root.

    Does someone can tell me what needs which permissions from /var/www beginning?
    Code:
    drwxr-xr-x  6 root root 4,0K Mar 14 11:01 .
    drwxr-xr-x 14 root root 4,0K Mar 14 11:02 ..
    lrwxrwxrwx  1 root root   30 Mar 14 11:00 domain1.de -> /var/www/clients/client1/web3/
    lrwxrwxrwx  1 root root   30 Mar 14 11:00 domain2.de -> /var/www/clients/client2/web7/
    drwxr-xr-x  2 root root 4,0K Mar 14 11:00 apps
    lrwxrwxrwx  1 root root   31 Mar 14 11:00 domain3.de -> /var/www/clients/client1/web10/
    drwxr-xr-x  2 root root 4,0K Mar 14 11:00 awffull
    drwxr-xr-x  4 root root 4,0K Mar 14 11:00 clients
    drwxr-xr-x  2 root root 4,0K Mar 14 11:00 html
    lrwxrwxrwx  1 root root   30 Mar 14 11:00 domain4.net -> /var/www/clients/client1/web1/
    lrwxrwxrwx  1 root root   31 Mar 14 11:00 domain5.net -> /var/www/clients/client1/web11/
    lrwxrwxrwx  1 root root   30 Mar 14 11:00 domain6.de -> /var/www/clients/client2/web6/
    
    Is it this?
    Code:
    chown -R web3:client1 /var/www/clients/client1/web3
    chown -R web10:client1 /var/www/clients/client1/web10
    chown -R web1:client1 /var/www/clients/client1/web1
    chown -R web11:client1 /var/www/clients/client1/web11
    chown -R web7:client2 /var/www/clients/client2/web7
    chown -R web6:client2 /var/www/clients/client2/web6
    
    It fixed the websites but what about the folders within /var/www/clients/client1/ (the webID folders owner:group) and what about the folders inside of the webID folder? For example "backup,cgi-bin,log,private,.ssh,ssl,tmp,web" and when there is a ssh/sftp user additional the folders "bin,dev,etc,home,lib,lib64,usr,var"?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    You missed the 'p' flag when copying the files. If you still have the original partition, copy them again with preserved permissions.
     
  3. traezi

    traezi New Member

    After i got the sites working again, independently from the other folders, i removed it. Actually i'm setting up a similar server and will check how the permissions are set up there and fix it on my actual live server. There's no rush now, as the pages are up and running again for the time being.
     

Share This Page