Symptoms
-
Apache web server cannot be started with the following error:
AH00543: httpd: bad user name john_doe
-
Websites are failing with error 503.
-
The following occurs in Plesk UI:
Erro: Unable to create system user: vhostmng-structure failed: Fatal error: std::runtime_error(cannot find user with name john_doe: Success)
New configuration files for the Apache web server were not created due to the errors in configuration templates: mkdir: cannot create directory `/var/www/vhosts/system/example.com/conf': No such file or directory mktemp: failed to create file via template `/var/www/vhosts/system/example.com/conf/httpd.conf.XXXXXX': No such file or directory Can not create temporary file . Detailed error descriptions were sent to you by email. Please resolve the issues and click here to generate broken configuration files once again or here to generate all configuration files.
Cause
The subscription user is missing in /etc/passwd
.
Resolution
-
Connect to the server via SSH.
-
Re-create
httpdocs
directory for the domains mentioned in the error:# mkdir /var/www/vhosts/example.com/httpdocs
-
Re-create the system users:
# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin -Dpsa -Ns -e"select s.login, a.password, s.home, s.shell from sys_users s, accounts a where a.id = s.account_id" | awk '{ print "PSA_PASSWD=x27" $2 "x27 /usr/local/psa/admin/sbin/usermng --add-user --user=" $1 " --homedir=" $3 " --shell=" ($4?$4:"/bin/false")}' | sh -x
-
Recreate the directories and configuration files with the following command:
# plesk bin repair --update-vhosts-structure
-
Repair permisisons for the domain from step 2:
# plesk repair fs -v example.com
Additional information
Apache configuration shows error after removing a domain from Plesk: httpd: bad user name