Plesk

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

Symptoms

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