How to make Apache run as current user

Edit the following file as root: /etc/apache2/envvars

using the command:

sudo nano /etc/apache2/envvars

change the user and group to yourself if there is only one user and you will never have permissions problems again.

I.E., if you are only logging in and running the server as user 'big_dog':

export APACHE_RUN_USER=big_dog
export APACHE_RUN_GROUP=big_dog

Heck, for that matter you could change that user to the current user I'm sure somehow. Then, install user_dir you all have webs only you can have full control of (unless you modify this).

Restart the server (if unsure, just reboot or goole) and you are good to go.


I myself would add the user to the www-data group with...

sudo adduser {username} www-data

Simple and effective. No messing with config files or permissions.