Article ID: 128516, created on Mar 6, 2016, last review on Mar 6, 2016

  • Applies to:
  • Plesk Automation 11.5

Symptoms

  1. Plesk Automation (PA) Administrator is getting email notification like:

    Subject: Unable to configure a web server on the host <pa115apachemysql1.domain.tld>
    
    Unable to generate the web server configuration file on the host <pa115apachemysql1.domain.tld> because of the following errors:
    
    Template_Exception: httpd: bad user name sub139_21
    
    file: /usr/local/psa/admin/plib/Template/Writer/Webserver/Abstract.php
    line: 68
    code: 0
    
    Please resolve the errors in web server configuration templates and generate the file again.
    
  2. Domain reconfiguration using /usr/local/psa/bin/repair --reconfigure-web-site -web-site-name domain.tld fails with error:

    [root@pa115mn ~]# /usr/local/psa/bin/repair --reconfigure-web-site -web-site-name domain.tld
    The web server for the domain.tld website was successfully reconfigured.
    Error occured while sending feedback. HTTP code returned: 502
    Error occured while sending feedback. HTTP code returned: 502
    2016-03-07T04:26:40+06:00 ERR (3)  [panel]: Apache config (14573031950.07736500) generation failed: Template_Exception: httpd: bad user name sub139_21
    
    file: /usr/local/psa/admin/plib/Template/Writer/Webserver/Abstract.php
    line: 68
    code: 0
    
  3. Apache configuration test on service node fails:

    [root@pa115apachemysql1 ~]# apachectl -t
    httpd: bad user name sub139_21
    

The operation fails with the following error:

    ERR (3)  [util_exec]: proc_close() failed

    file: /usr/local/psa/admin/plib/Template/Writer/Webserver/Abstract.php
    line: 68
    code: 0
    Error occured while sending feedback. HTTP code returned: 502
    [warn] module ssl_module is already loaded, skipping

    httpd: bad user name user1

Cause

Subscription user is missing on corresponding Apache web hosting service node. When you check if the user from the error exists, you will get an empty output:

[root@pa115apachemysql1 ~]# grep sub139_21 /etc/passwd
[root@pa115apachemysql1 ~]#

Resolution

Recreate a user using the configuration from the database:

  1. Log to PA Management node via SSH as root, get information about the system user:

    [root@pa115mn ~]# mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa -e "select * from sys_users where login='sub139_21' \G"
    *************************** 1. row ***************************
               id: 116
    serviceNodeId: 3
            login: sub139_21
       account_id: 247
        mapped_to: NULL
             home: /var/www/vhosts/domain.tld
            shell: /bin/false
            quota: 0
    
  2. Login to Apache Service node and create the system user:

    [root@pa115apachemysql1 ~]# /usr/local/psa/admin/bin/usermng --add-user --user=sub139_21 --homedir=/var/www/vhosts/domain.tld --shell=/bin/false
    
    usermng: neither PSA_PASSWD nor PSA_CRYPTED_PASSWD environment variables are set. unable to determine user's password
    System error 17: File exists
    
    usermng: neither PSA_PASSWD nor PSA_CRYPTED_PASSWD environment variables are set. unable to determine user's password
    System error 17: File exists
    
  3. Update user password under Customer Control Panel > Websites > Web Hosting Access

  4. Reconfigure domain using /usr/local/psa/bin/repair --reconfigure-web-site -web-site-name domain.tld utility from PA Management node:

    [root@pa115mn ~]# /usr/local/psa/bin/repair --reconfigure-web-site -web-site-name domain.tld
    The web server for the domain.tld website was successfully reconfigured.
    

Search Words

Error: Web server reconfiguration failed: New configuration was not built.

missing linux user

httpd: bad user name

Unable to make action: Unable to manage service by apache_control_adapter: Service /etc/init.d/httpd failed to start Service /etc/init.d/httpd failed to start

change ftp user for domain apache problem

Unable to generate the web server configuration file on the host

cannot rebuild apache config or access websites

Unable to configure the web server: Execution failed

subscription error reconfiguration

New configuration files for the Apache web server were not created due to the errors in configuration templates: httpd: bad user name

ERROR: Call to a member function getRootPath() on a non-object (Abstract.php:141)

unable to manage subscription

Apache config generation failed: Template_Exception

filemng: opendir failed: Permission denied

33a70544d00d562bbc5b17762c4ed2b3 caea8340e2d186a540518d08602aa065 e0aff7830fa22f92062ee4db78133079

Email subscription for changes to this article
Save as PDF