• Plesk Uservoice will be deprecated by October. Moving forward, all product feature requests and improvement suggestions will be managed through our new platform Plesk Productboard.
    To continue sharing your ideas and feedback, please visit features.plesk.com

Issue HTTP ERROR 500, Plesk and website unaccessable after mistake chown command for root

Robert087

New Pleskian
Hi all,

After a mistake in settings chown command for root, Plesk is not accessible anymore...

Does anyone know how to restore plesk access and via which route?
Thnks a lot!

Best regards,
Robert
 
Last edited:
Permissions can be reset to their defaults using the following commands for CentOS distributions:

# for p in $(rpm -qa); do rpm --setugids $p; done
# for p in $(rpm -qa); do rpm --setperms $p; done
# chown root.psaadm /usr/local/psa/admin/sbin/mod_wrapper

Note, the order in which you execute the commands is important. When changing permissions and ownerships on files, always change the ownerships first, and then the permissions. Otherwise, if the files have a SUID bit set, for example, the bit set may get cleared.
 
Hi Thnks for your help!

I tried your solution but still got these errors:

chgrp: cannot access ‘/etc/systemd/system/runlevel3.target’: No such file or directory
chown: cannot access ‘/etc/systemd/system/runlevel4.target’: No such file or directory
chgrp: cannot access ‘/etc/systemd/system/runlevel4.target’: No such file or directory
chown: cannot access ‘/etc/systemd/system/runlevel5.target’: No such file or directory
chgrp: cannot access ‘/etc/systemd/system/runlevel5.target’: No such file or directory
chown: cannot access ‘/var/lib/systemd/backlight’: No such file or directory
chgrp: cannot access ‘/var/lib/systemd/backlight’: No such file or directory
chown: cannot access ‘/var/lib/systemd/clock’: No such file or directory
chgrp: cannot access ‘/var/lib/systemd/clock’: No such file or directory
....

in
for p in $(rpm -qa); do rpm --setugids $p; done
and
for p in $(rpm -qa); do rpm --setperms $p; done

But still showing:

ERROR: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [2002] Permission denied' in /usr/local/psa/admin/externals/Zend/Db/Adapter/Pdo/Abstract.php:129 Stack trace: #0 /usr/local/psa/admin/externals/Zend/Db/Adapter/Pdo/Abstract.php(129): PDO->__construct('mysql:dbname=ps...', 'admin', '', Array) #1 /usr/local/psa/admin/externals/Zend/Db/Adapter/Pdo/Mysql.php(111): Zend_Db_Adapter_Pdo_Abstract->_connect() #2 /usr/local/psa/admin/externals/Zend/Db/Adapter/Abstract.php(460): Zend_Db_Adapter_Pdo_Mysql->_connect() #3 /usr/local/psa/admin/externals/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('select param, v...', Array) #4 /usr/local/psa/admin/plib/Db/Adapter/Pdo/Mysql.php(30): Zend_Db_Adapter_Pdo_Abstract->query('select param, v...', Array) #5 /usr/local/psa/admin/plib/db.php(36): Db_Adapter_Pdo_Mysql->query('select param, v...') #6 /usr/local/psa/admin/plib/db.php(212): db_query('select param, v...', false) #7 /usr/local/psa/admin/plib/Plesk/Mode.php(439): get_param('disable_pr (Abstract.php:144)
 
Hi !
THnks for all the help, it saved the day!!

The given solutions were working partially:
To help other people with same issues, this is what solved everything:

First:

plesk repair fs
plesk repair db
plesk repair installation


or

plesk repair all

Then reset permissions:

# for p in $(rpm -qa); do rpm --setugids $p; done
# for p in $(rpm -qa); do rpm --setperms $p; done
# chown root.psaadm /usr/local/psa/admin/sbin/mod_wrapper



Then still errors:

ERROR: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [2002] Permission denied' in /usr/local/psa/admin/externals/Zend/Db/Adapter/Pdo/Abstract.php:129 Stack trace: #0 /usr/local/psa/admin/externals/Zend/Db/Adapter/Pdo/Abstract.php(129): PDO->__construct('mysql:dbname=ps...', 'admin', '', Array) #1 /usr/local/psa/admin/externals/Zend/Db/Adapter/Pdo/Mysql.php(111): Zend_Db_Adapter_Pdo_Abstract->_connect() #2 /usr/local/psa/admin/externals/Zend/Db/Adapter/Abstract.php(460): Zend_Db_Adapter_Pdo_Mysql->_connect() #3 /usr/local/psa/admin/externals/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('select param, v...', Array) #4 /usr/local/psa/admin/plib/Db/Adapter/Pdo/Mysql.php(30): Zend_Db_Adapter_Pdo_Abstract->query('select param, v...', Array) #5 /usr/local/psa/admin/plib/db.php(36): Db_Adapter_Pdo_Mysql->query('select param, v...') #6 /usr/local/psa/admin/plib/db.php(212): db_query('select param, v...', false) #7 /usr/local/psa/admin/plib/Plesk/Mode.php(439): get_param('disable_pr (Abstract.php:144)

Then the first step of the solution:

service mariadb restart

Then last error was:

SQLSTATE[HY000] [1045] Access denied for user 'admin'@'localhost' (using password: NO)

Then the second step of the solution:

# plesk bin admin -p -passwd '<password>'

After that Plesk was accessible again!!
Thnks!
 
Back
Top