vote up 0 vote down star

hi,

Any idea how to get around the problem of :

aditya@aditya-desktop:/usr/sbin$ sudo ./apache2 -k restart apache2: bad user name ${APACHE_RUN_USER}

Basically, not able to restart/stop my apache server; with the above err message.

Any ideas ?

Thanks, Aditya

flag
Belongs to Server Fault. – RaYell Aug 27 at 6:38
what operating system? – theotherreceive Aug 27 at 7:34

migrated from stackoverflow.com

3 Answers

vote up 1 vote down

an error in the wrapper script - either user apache2ctl as instructed below, or search the script for the APACHE_RUN_USER variable and see what's wrong

link|flag
I think he is nothing using any wrapper, but tries to start the daemon directly running the apache2 bin directly, thus obviously not having any env been set – AlberT Aug 27 at 7:11
vote up 1 vote down

You don't say what system you're running, but,

% egrep '(User|Group)' /etc/apache2/apache2.conf 
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}

This is the standard ubuntu setup. The user/group that apache runs at aren't set in the config file, but in /etc/apache2/envvars, which is sourced by the init script.

You should use the init script to restart apache, /etc/init.d/apache2 restart or if for some reason you can't, set your own envrionment variables and use apachectl.

link|flag
+1 would also be my answer.. – rkthkr Aug 27 at 9:30
vote up 1 vote down

First of all I'd try to use the apache2ctl command for the job.

sudo apache2ctl restart

EDIT after petre comment:

I think you are not using any wrapper, but trying to start the daemon running the apache2 bin directly, thus obviously not having any ENV variable being set

link|flag

Your Answer

Get an OpenID
or
never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.