Please help: I think I chmod /var/lib/ folder and my server "crash"

Discussion in 'General' started by Ole Vangen, Jul 25, 2022.

  1. Ole Vangen

    Ole Vangen Member

    I am running Ispconfig3 on a debian server

    Hi I did a huge mistake I am afraid. I rund a script to install a wordpress site on a domain on my server. . I foudn it in forum :D it ask for webdirectory client and web id.. and i think I did a huge mistake in first question when I wrote web (I guess I should have written full path)
    Therefore all files and directories in the /var/lib/ folder now has a client and a website owner ..

    I think I can restore it al but Chmod it to roo:root

    I did a. chown -R root:root ./*
    And restarted apache, still it crash in apache.
    I also runned a systemctl list-units --type=service --state=running

    And for sure apache2 dont run.

    I then run this command.

    sudo systemctl status apache2.service -l --no-pager

    and get this output , so surley some accees or ownership is wrong. please help :D

    Jul 25 21:45:34 www systemd[1]: Starting The Apache HTTP Server...

    Jul 25 21:45:35 www apachectl[4537]: AH00526: Syntax error on line 4 of /etc/apache2/mods-enabled/fastcgi.conf:

    Jul 25 21:45:35 www apachectl[4537]: FastCgiIpcDir /var/lib/apache2/fastcgi: access for server (uid 33, gid 33) failed: write not allowed

    Jul 25 21:45:35 www apachectl[4537]: Action 'start' failed.

    Jul 25 21:45:35 www apachectl[4537]: The Apache error log may have more information.

    Jul 25 21:45:35 www systemd[1]: apache2.service: Control process exited, code=exited status=1

    Jul 25 21:45:35 www systemd[1]: Failed to start The Apache HTTP Server.

    Jul 25 21:45:35 www systemd[1]: apache2.service: Unit entered failed state.

    Jul 25 21:45:35 www systemd[1]: apache2.service: Failed with result 'exit-code'.

    Could someone please take the time and log into their Ispconfig3 installation and check..

    THX
     
    Last edited: Jul 25, 2022
  2. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    chown and chmod are both two distinct linux commands so I think you actually use the former, not the latter.

    Did you do this on server root because unless you activated shell access for your website's folder this will only be available in server root?

    The easiest way, you have proper snapshot / backup, is to restore them back.

    If this ownership changes were done in your website's folder using its shell access, you may want to try to the resync tool in ISPConfig UI to restore ownership.
     
  3. Steini86

    Steini86 Active Member

    You might be able to recover the /var/lib/ folder. /var would have been worse ;)
    This should bring back apache:
    Code:
    chown www-data:www-data /var/lib/apache2/fcgid -R
    chown root:root /var/lib/apache2/fcgid/shm
    You might need to set these, too (if these folders exist, otherwise you will get an error message):
    Code:
    chown clamav:clamav /var/lib/clamav -R
    chown munin:munin /var/lib/munin -R
    chown mysql:mysql /var/lib/mysql -R
    chown postfix:postfix /var/lib/postfix -R
    chown _rspamd:_rspamd /var/lib/rspamd -R
    chown unbound:unbound /var/lib/unbound -R
    
    In general, you can use apt reinstall to recover permissions:
    https://wiki.debian.org/Permissions/ResetPackagePermissions
     
    Ole Vangen and Th0m like this.
  4. Ole Vangen

    Ole Vangen Member

     
  5. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    That is what the Wiki article claims. I have not tried it. But Option 2 reinstalls all packages, not just libraries. So it may take 2 hours to run.
    No.
     

Share This Page