Moved www directory and messed up ownerships

Discussion in 'Installation/Configuration' started by tjbcham, Mar 8, 2017.

  1. tjbcham

    tjbcham Member

    Hi,
    Just had to move a data disk and create a Symlink, but in doing so all the ownerships of the sites got messed up trhowing a 500 error for each php script and not allowing login by ssh.

    suexec.log gives
    uid: (5017/web15) gid: (5006/client2) cmd: .php-fcgi-starter
    [2017-03-08 15:50:01]: target uid/gid (5017/5006) mismatch with directory (0/0) or program (0/0)
    [2017-03-08 15:50:04]: uid: (5003/ispconfig) gid: (5004/ispconfig) cmd: .php-fcgi-starter
    [2017-03-08 15:50:04]: target uid/gid (5003/5004) mismatch with directory (0/0) or program (0/0)

    This fixed ISPconfig:
    chown -R ispconfig:ispconfig /var/www/php-fcgi-scripts/ispconfig

    Any tips or suggestions on how to repair the ownership of all the web sites on the server or do I have to chown them one by one?

    Thanks....
     
  2. ahrasis

    ahrasis Active Member

    Try resync all services first. Read the error log too.
     
  3. florian030

    florian030 ISPConfig Developer ISPConfig Developer

    find . -user old_user -group old_group -print0 | xargs -0 chown -v -h new_user:new_group
     
  4. tjbcham

    tjbcham Member

    Thanks for the quick responses.
    I get the php sites back up with chown -R webID:clientID /var/www/php-fcgi-scripts/webID
    However all the site directories are owned by root:root
    I get access back for web directories by: chown -R webID:clientID /var/www/clients/clientID/webID/

    However...
    when I wanted to check the structure of the Client directories as I believe some directories should remain owned by root:root (such as home, log, sll etc) I created a new website from ISPconfig control panel which created no problem, only when I try to access the directory (which I can see)
    with ls -l
    lrwxrwxrwx 1 root root 31 Mar 8 17:06 testing.com -> /var/www/clients/client1/web37/
    However no directory or files are written to the site ?web37? directory only contains the SSH or FTP user directories and no home, web, ssl directories etc.
     
  5. ahrasis

    ahrasis Active Member

    ISPC may take some times before the default directories are created.
     
  6. tjbcham

    tjbcham Member

    Thanks, but I think it is a permissions, ownership or Symlink issue.

    I have given enough time for the sites to be created, and previously it was pretty much instant. ISPConfig creates the site directory, I can create SSH and FTP users, but no site directories are created.

    The Resync did not repair any of the group ownership issues.
     
  7. tjbcham

    tjbcham Member

    This is the only error doc
    WARNING: Could not open file /var/www/clients/client1/web37/home/amtest/.ssh/authorized_keys1
     
  8. tjbcham

    tjbcham Member

    Just did some updates for ISPconfig and now only have Debian Default page and all sll except for ISPconfig broken....
     
  9. tjbcham

    tjbcham Member

    Upgraded to latest ispconfig, however cannot create a domain with any files despite saying it is OK
    domains going to the debian default page and no errors written to domain log.
    The domin vhost file does not mention symlinks. should it?
     
  10. ahrasis

    ahrasis Active Member

    What did you actually move to the new disk, the whole server system?
     
  11. tjbcham

    tjbcham Member

    The www directory, but the server is now dead as it has not come up after reboot. Looking at recovery now :-(
     
  12. ahrasis

    ahrasis Active Member

    Sorry to hear that. I hope you'll recover your server soonest.
     
  13. tjbcham

    tjbcham Member

    Got server back from a network error, brought back all the sites.

    Manually reset the ownership issues as trying to bulk change them with a script created more problems that is was worth.
    Reest with chown -R all the the sites in php-fcgi-scripts
    chown -R 5020:5005 /var/www/php-fcgi-scripts/web18​
    (to find a list of owner IDs checked /etc/passwd)
    And also in the actual client directories /var/www/clinets/client1 etc. for all the sub directories other than home, log and ssl
    example:
    chown -R 5020:5005 /var/www/clients/client1/web18/web
    that can also be written like
    chown -R web18:client1 /var/www/clients/client1/web18/
    So sites are back even if it was a long process.

    However the secondary issue of no new sites being created continues after this data move and Symlink plus ISPconfig upgrades. ISPconfig no longer creates actual site folders or and site docs (index.html) when adding a new site although the site is created in the control panel no problem.
    Not sure how to debug this issue?
    ISPconfig is not giving any error logs.
    ISpconfig shows site with null disk quota:
    xxxxxxxxxxxxxxx.eu 20 KB unlimited unlimited
    testing.net unlimited unlimited
     

Share This Page