How to: Change www-data User to [user] on Raspberry Pi

Step 1: Open envvars File on Raspberry Pi

The file we need to edit is located in /etc/apache2/envvars and you can change it with:

sudo nano /etc/apache2/envvars

Step 2: Change envvars File on Raspberry Pi

Change the following data from

export APACHE_RUN_USER=www-data
export APACHE_RUN_GROUP=www-data


#export APACHE_RUN_USER=www-data
export APACHE_RUN_USER=raspi
#export APACHE_RUN_GROUP=www-data
export APACHE_RUN_GROUP=raspi

Step 3: Chown [user]

sudo chown -R [USER NAME]:[USER NAME] /var/www

Leave a Comment

Your email address will not be published.