When I create a new website, the website user is not being created in /etc/passwd. The site is created including the directories under /var/www/clients/client##/ but all the chown commands fail as there is no user web### created by the useradd command. The Apache restart fails with: Sep 28 13:51:05 servername apachectl[16035]: AH00543: apache2: bad user name web162 Some clues as to how to fix this would be appreciated System: Debian 8.9 running apache ISPConfig DEBUG Output 28.09.2019-13:51 - DEBUG - Calling function 'ssl' from plugin 'apache2_plugin' raised by event 'web_domain_insert'. 28.09.2019-13:51 - DEBUG - Calling function 'insert' from plugin 'apache2_plugin' raised by event 'web_domain_insert'. 28.09.2019-13:51 - DEBUG - safe_exec cmd: useradd -d '/var/www/clients/client26/web162' -g 'client26' -G sshusers 'web162' -s /bin/false - return code: 10 28.09.2019-13:51 - DEBUG - Adding the user: web162 28.09.2019-13:51 - DEBUG - safe_exec cmd: chattr -i '/var/www/clients/client26/web162' - return code: 0 28.09.2019-13:51 - DEBUG - chown failed: /var/www/clients/client26/web162/.ssh : web162 28.09.2019-13:51 - DEBUG - chown failed: /var/www/clients/client26/web162/private : web162 28.09.2019-13:51 - DEBUG - safe_exec cmd: mkdir -p '/var/log/ispconfig/httpd/test.DOMAIN.NAME.COM' - return code: 0 28.09.2019-13:51 - DEBUG - safe_exec cmd: mount --bind '/var/log/ispconfig/httpd/test.DOMAIN.NAME.COM' '/var/www/clients/client26/web162/log' - return code: 0 28.09.2019-13:51 - DEBUG - safe_exec cmd: chattr +i '/var/www/clients/client26/web162' - return code: 0 28.09.2019-13:51 - DEBUG - safe_exec cmd: ln -s '/var/www/clients/client26/web162/' '/var/www/test.DOMAIN.NAME.COM' - return code: 0 28.09.2019-13:51 - DEBUG - Creating symlink: ln -s /var/www/clients/client26/web162/ /var/www/test.DOMAIN.NAME.COM 28.09.2019-13:51 - DEBUG - safe_exec cmd: ln -s '/var/www/clients/client26/web162/' '/var/www/clients/client26/test.DOMAIN.NAME.COM' - return code: 0 28.09.2019-13:51 - DEBUG - Creating symlink: ln -s /var/www/clients/client26/web162/ /var/www/clients/client26/test.DOMAIN.NAME.COM 28.09.2019-13:51 - DEBUG - safe_exec cmd: cp '/usr/local/ispconfig/server/conf/error/en/'* '/var/www/clients/client26/web162/web/error/' - return code: 0 28.09.2019-13:51 - DEBUG - safe_exec cmd: chmod -R a+r '/var/www/clients/client26/web162/web/error/' - return code: 0 28.09.2019-13:51 - DEBUG - safe_exec cmd: cp '/usr/local/ispconfig/server/conf/index/standard_index.html_en' '/var/www/clients/client26/web162/web/index.html' - return code: 0 28.09.2019-13:51 - DEBUG - safe_exec cmd: cp '/usr/local/ispconfig/server/conf/index/favicon.ico' '/var/www/clients/client26/web162/web/' - return code: 0 28.09.2019-13:51 - DEBUG - safe_exec cmd: cp '/usr/local/ispconfig/server/conf/index/robots.txt' '/var/www/clients/client26/web162/web/' - return code: 0 28.09.2019-13:51 - DEBUG - safe_exec cmd: chmod -R a+r '/var/www/clients/client26/web162/web/' - return code: 0 28.09.2019-13:51 - DEBUG - safe_exec cmd: chown -R 'web162':'client26' '/var/www/clients/client26/web162/web' - return code: 1 28.09.2019-13:51 - DEBUG - safe_exec cmd: chown root:root '/var/www/clients/client26/web162/web' - return code: 0 28.09.2019-13:51 - DEBUG - safe_exec cmd: chattr -i '/var/www/clients/client26/web162' - return code: 0 28.09.2019-13:51 - DEBUG - chown failed: /var/www/clients/client26/web162/cgi-bin : web162 28.09.2019-13:51 - DEBUG - chown failed: /var/www/clients/client26/web162/tmp : web162 28.09.2019-13:51 - DEBUG - chown failed: /var/www/clients/client26/web162/web : web162 28.09.2019-13:51 - DEBUG - chown failed: /var/www/clients/client26/web162/web/error : web162 28.09.2019-13:51 - DEBUG - chown failed: /var/www/clients/client26/web162/web/stats : web162
Try executing those chown commands yourself in terminal as root. Then examine if the directories and files maybe exist already, and check with chattr if they are protected from modification.
The commands fail because the user web162 hasn't been created. I could try running the useradd line manually, chattr -i the directory and then the chown commands but I'm not sure of the consequences of the useradd command being run out of sequence.
That should be ok, does the useradd command work when you run it manually now? useradd -d '/var/www/clients/client26/web162' -g 'client26' -G sshusers 'web162' -s /bin/false
No, it didn't work but it did give me enough information to fix the issue. Duplicate entries for sshusers in the groups file. Don't know how that happened but removing the empty line has fixed the issue.