HELP ME!! I accidentally gave the command: chown web10:web10 /

Discussion in 'HOWTO-Related Questions' started by Matz Sor, Dec 19, 2020.

  1. Matz Sor

    Matz Sor New Member

    I wanted to change the ownership of a specific folder and I ended up hitting the enter unintentionally when typing, it crashed everything! apache mysql, ispconfig. help me please!!

    Code:
    [email protected]:~# service mysql start
    Job for mariadb.service failed because the control process exited with error cod                 e.
    See "systemctl status mariadb.service" and "journalctl -xe" for details.
    
     
  2. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    Can you 'chown root:root /' now? If not you might have to but off another media, mount your root partition, then run chown.
     
  3. Matz Sor

    Matz Sor New Member

    Thanks for the reply Jesse Norell, I entered Rescue mode
    system offered by vps and mounted the partition, so I managed to redo the 'chown root: root /' command.
    But mysql doesn't run and neither does apache
     
  4. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Messing up ownership of files can cause big issues like this. Some folders have to be owned by Apache, some by ispconfig, etc. Do you have a backup that you can restore? If not, it will take quite some time to restore this correctly by comparing it with a working system...
     
  5. Matz Sor

    Matz Sor New Member

    Th0m, thanks for the reply, I tried to restart, I did everything I knew. a question: if i save the / var / lib / mysql folder with the database and copy it in a new installation, does it work?
     
  6. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Again, do you have a backup (snapshot) of the server that you can go back to?

    You could copy your files to a new installation but it is not a simple copy paste action.
     
  7. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    No.
    The problem is the files have wrong owner and group owner. Copying them to a new installation does not change this.
    If you do not have backups you can restore, only way I can think of is compare with a working similar installation what owners and group owners files have and change accordingly. This is a lot of work. Restoring from backups is preferable.
     
  8. Matz Sor

    Matz Sor New Member

    Thanks for the reply Taleman, I managed to recover the sql files with the command chown -R mysql: mysql /var/lib/mysql + mv /var/lib/mysql/tc.log /var/lib/mysql/tc.log.bkp
    What was blocking mysql from starting was the log.
    Now I'm trying to start Apache
     
  9. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    I would strongly advise you to do a full restore from a snapshot or reinstall as this can cause issues in the future.
     
    Matz Sor likes this.
  10. Matz Sor

    Matz Sor New Member

    the solution was to back up and do a new installation of ispconfig. Thank you very much!
     

Share This Page