Apache fails to start: bad user name ${APACHE_RUN_USER}

Created:

2016-11-16 12:57:00 UTC

Modified:

2017-08-16 16:46:16 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Apache fails to start: bad user name ${APACHE_RUN_USER}

Applicable to:

  • Plesk 12.5 for Linux
  • Plesk 11.x for Linux
  • Plesk 12.0 for Linux

Symptoms

On Debian-based OS changing of any settings for the domain fails with the following error:

New configuration files for the Apache web server were not created due to the errors in configuration templates: apache2: bad user name ${APACHE_RUN_USER}. The error message containing the detailed error descriptions was sent to you by e-mail. Please resolve the issues and click here to generate broken configuration files once again or here to generate all configuration files.

Apache fails to start with the following error:

# service apache2 start
The apache2 configtest failed.
Output of config test was:
apache2: bad user name ${APACHE_RUN_USER}
Action 'configtest' failed.

and/or shows the following error:

# apache2 -S
apache2: bad user name ${APACHE_RUN_USER}

Cause

Environment variable ${APACHE_RUN_USER} is incorrect or undefined.

Resolution

  1. Make sure that User and Group in configuration file /etc/apache2/apache2.conf are defined as below:

    # grep "APACHE_RUN_USER" /etc/apache2/apache2.conf ;  grep "APACHE_RUN_GROUP" /etc/apache2/apache2.conf
    User ${APACHE_RUN_USER}
    Group ${APACHE_RUN_GROUP}
  2. Define environment variables in /etc/apache2/envvars file as below:

    # grep "APACHE_RUN_USER" /etc/apache2/envvars ;  grep "APACHE_RUN_GROUP" /etc/apache2/envvars
    export APACHE_RUN_USER=www-data
    export APACHE_RUN_GROUP=www-data
  3. Start apache:

    # service apache2 start
  4. Re-create apache configuration files if needed:

    # /usr/local/psa/admin/bin/httpdmng --reconfigure-all
Have more questions? Submit a request
Please sign in to leave a comment.