ubuntu www-data user should be apache

28 01 2009

or something sane:

usermod -l apache www-data
groupmod -n apache www-data

I wonder is there are any other hidden snags — like file user and group permissions?


Actions

Information

5 responses

28 01 2009
fijiaaron

also fixed the ordering in /etc/passwd so that it is sorted by UID by default
and /etc/group

unbelievable!

28 01 2009
fijiaaron

repercussion:

#/etc/init.d/apache2 reload

apache2: bad user name www-data
…fail

edit /usr/sbin/apache2ctl and change this line:

install -d -o ${APACHE_RUN_USER:-apache} ${APACHE_LOCK_DIR:-/var/lock/apache2}

28 01 2009
fijiaaron

next, edit/etc/apache2/envvars:

export APACHE_RUN_USER=apache
export APACHE_RUN_GROUP=apache

also, need to install lynx???

#apt-get install lynx

22 03 2009
Jean-Philippe

In fact you could keep the default value www-data of $APACHE2_RUN_USER inside the expression ${APACHE2_RUN_USER:-www-data}.
The problem in that the variable $APACHE2_RUN_USER is not defined in the file /etc/apache2/envvars, so you have to rename this variable to $APACHE_RUN_USER.
After having created the apache user and group, the following line will also work : ${APACHE2_RUN_USER:-www-data}, because the default value will not be used.
Nevertheless, as the www-data user does not exist anymore, it is far better to replace the default value by apache, as you said.

And Lynx (or Links) is needed by apache2ctl to display the status of Apache ;-)

Many thanks for your entry.

23 03 2009
fijiaaron

Jean-Philippe

Thanks. You are right. I’ve forgot about those details.

Leave a comment