Articles in this section

Apache configuration shows error after removing a domain from Plesk: httpd: bad user name

Plesk for Linux kb: technical ABT: Group B FR:PPM-2884

Applicable to:

  • Plesk for Linux

Symptoms

  • Apache configuration shows the error:
    • on AlmaLinux / CloudLinux / RHEL

      # httpd -t
      AH00543: httpd: bad user name john_doe

    • on Debian / Ubuntu

      # apache2 -t
      AH00543: apache2: bad user name john_doe

  • The user from the error (in this example, john_doe) does not exist on the system:

    # grep john_doe /etc/passwd
    #

  • There is an Apache configuration file which contains this user:
    • on AlmaLinux / CloudLinux / RHEL

      # grep -r john_doe /etc/httpd/conf/plesk.conf.d/vhosts/*
      /etc/httpd/conf/plesk.conf.d/vhosts/example.com.conf: SuexecUserGroup "john_doe" "psacln"
      /etc/httpd/conf/plesk.conf.d/vhosts/example.com.conf: SuexecUserGroup "john_doe" "psacln"

    • on Debian / Ubuntu

      # grep -r john_doe /etc/apache2/plesk.conf.d/vhosts/*
      /etc/apache2/plesk.conf.d/vhosts/example.com.conf: SuexecUserGroup "john_doe" "psacln"
      /etc/apache2/plesk.conf.d/vhosts/example.com.conf: SuexecUserGroup "john_doe" "psacln"

  • The domain in the file name (In this example, example.com) does not appear on the Domains page in Plesk.
  • The following error message may appear on the Home page in Plesk:

    PLESK_ERROR: New configuration files for the Apache web server were not created due to the errors in configuration templates: AH00112: Warning: DocumentRoot [/var/www/...] does not exist AH00543: apache2: bad user name example.

Cause

The subscription / domain was not properly removed from the system.

Resolution

AlmaLinux / CloudLinux / RHEL
  1. Connect to your Plesk server via SSH.
  2. Find all orphaned files that belong to the nonexistent user:

    # grep -r john_doe /etc/httpd/conf/plesk.conf.d/vhosts/*
    /etc/httpd/conf/plesk.conf.d/vhosts/example.com.conf: SuexecUserGroup "john_doe" "psacln"
    /etc/httpd/conf/plesk.conf.d/vhosts/example.com.conf: SuexecUserGroup "john_doe" "psacln"

  3. Remove these files:

    # rm -rf /etc/httpd/conf/plesk.conf.d/vhosts/example.com.conf

  4. Regenerate web-server configuration files for all domains:

    Note: If there are 300+ domains on the server, run this command during server maintenance time.

    # plesk repair web -y

Debian / Ubuntu
  1. Connect to your Plesk server via SSH.
  2. Find all orphaned files that belong to the nonexistent user:

    # grep -r john_doe /etc/apache2/plesk.conf.d/vhosts/*
    /etc/apache2/plesk.conf.d/vhosts/example.com.conf: SuexecUserGroup "john_doe" "psacln"
    /etc/apache2/plesk.conf.d/vhosts/example.com.conf: SuexecUserGroup "john_doe" "psacln"

  3. Remove these files:

    # rm -rf /etc/apache2/plesk.conf.d/vhosts/example.com.conf

  4. Regenerate web-server configuration files for all domains:

    Note: If there are 300+ domains on the server, run this command during server maintenance time.

    # plesk repair web -y

Was this article helpful?

Comments

1 comment
Date Votes
  • Checking Apache configuration

    ................................................................[ERROR]

     

     

    0

Please sign in to leave a comment.