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 CentOS/RHEL-based distributions:

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

    • on Debian/Ubuntu-based distributions:

      # 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 that contains this user:

    • On CentOS/RHEL-based distributions:

      # 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-based distributions:

      # 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/domains was not properly removed.

Resolution

  1. Connect to the Plesk server via SSH.

  2. Find all orphaned files that belong to the nonexistent user:

    • on CentOS/RHEL-based distributions:

      # 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-based distributions:

      # 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:

    • on CentOS/RHEL-based distributions:

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

    • on Debian/Ubuntu-based distributions:

      # 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.