Very Big Problem with ownership

Discussion in 'Installation/Configuration' started by smartcall, May 27, 2008.

  1. smartcall

    smartcall New Member

    Hello,

    Just 15 minutes ago I created a new client and web. After that all the webs in the server are owned by apache:web1921.
    I noticed a root process running chown, but this is normal. I understood what happened after getting Internal Server Error-s.
    I run suPHP.

    This is a production server and I can't possibly solve this by myself.
    I am in PANIC there are about 300 production sites in the server and I don't know how to restore their ownership.

    Please - a script or something?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Please check if there is anything unusual in the domain name of the site that you created in the isp_isp_wen database table. If possible, correct the domain or hostname with phpmyadmin. Then execute this sql staement:

    UPDATE isp_isp_web set status = 'u' where status = '';

    then edit one site in the ispconfig interafce, change e.g. quota and then click save. ISPConfig will restore the permissions then.
     
  3. smartcall

    smartcall New Member

    I deleted the domain already. There was nothing unusual, I guess. Because named wouldn't start if there was.
    I already did UPDATE isp_isp_web set status = 'u' where status = ''; and it is updating only the user, but not the group permissions. With the exception of phptmp folder.
    So I added similar lines to
    /root/ispconfig/scripts/lib/config.lib.php
    for web and for the root of the web, but still the rest is group of that web. And maybe userdirs will be inaccessible by ftp.

    This was very unexpected behaviour. As you can see from the web1921 group name, there are web1921 webs in this server.
    Most of them are free testing subdomains, but untill today I didn't have similar issues.

    Thanks for the quick answer. If you can think of a solution for the other dirs besides web and phptmp, please advice.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Try this additionally:

    UPDATE isp_isp_user set status = 'u' where status = '';

    to update all users.
     
  5. smartcall

    smartcall New Member

    I will try it.
    Actually I created small shell script:
    Code:
    for x in $( /usr/bin/find /var/www/ -maxdepth 1 -name "web*" -type d -print0 | xargs -0)
    do
     chgrp -R $(basename $x) $x
     for y in $( find /var/www/$(basename $x)/user -maxdepth 1 -name "web*" -type d -print0 | xargs -0)
      do
        chown -R $(basename $y).$(basename $x) $y
      done;
    done;
    Didn't run it yes. Will try your suggested solution first.
     
  6. smartcall

    smartcall New Member

    Just to let you know - the same thing happend again.
    I created 4-5 new users with new webs and I ended up with all webs owned by apache:last_user, where last_user is the last one I created.

    In addition all the files were chmod-et to -rwxrwxr-x which was also very bad, because I run suPHP. And even after I fixed the ownership, I had to chmod all .php files to 644.

    Should I wait between creating the next user when I create new users and webs?
    Maybe ISPConfig can't handle the creation of many users and webs one after another in a high loaded environment?
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    Please create a new user in each web were the "administrator" checkbox is activated. Then all files of the website belong to this user and also php files are executed under this user.
     
  8. smartcall

    smartcall New Member

    This is not applicable. I have 100-s of webs.
    I fixed all with the above script and the suggestions from you.
    My problem is that this will happen again sooner or later and I'm looking for a fix to prevent such ISPConfig behaviour. But I can't think of one.

    Thanks.
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    This has nothing to do with the number of sites. If you use suphp, you will have to create a administrator user for each site.
     
  10. smartcall

    smartcall New Member

    Thanks. I don't think that you read what I write
    All the sites have administrators. They wouldn't work if they didn't have.
     

Share This Page