PDA

View Full Version : [Apache] Changing user from www-data to....



Pyro.699
September 22nd, 2008, 10:19 PM
Hello,

As some of you may have read in my other post, about running a java application with php (URL (http://ubuntuforums.org/showthread.php?t=922399&goto=newpost)). In the disscussion we came to the conclusion that the reason the scripts were not working properly was that the user www-data was not running under the x display. What i would like to do is completly change over the user stats from www-data to cody. Now, before i get several people telling me the LARGE securety risks, i am well aware of the hole that this will open. This will be on a computer with absolutely no personal data on it at all, if someone hacks it, the most they could do is stop my downloads, or view my current background, so please dont inform me of that. Ive tried seatching all files for the text www-data but that took hours and only found 5 files, 1 of which were relivent. So there must be a loctaion to change the main user. Ive looked in these locations:

/etc/apache2/apache2.conf
/etc/apache2/httpd.conf
/etc/apache2/envvars
/etc/php5/apache2/php.ini

Please tell me where it is that i need to go to change the user from www-data to cody

Thanks
~Cody Woolaver

pe7er
October 13th, 2008, 11:49 PM
Please tell me where it is that i need to go to change the user from www-data to cody

It's located in /etc/apache2/envvars and you can change it with:

sudo gedit /etc/apache2/envvars

Change:

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

to:

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

mnml
December 7th, 2009, 01:58 PM
it worked for me thanks.

Pyro.699
December 7th, 2009, 02:32 PM
Thanks for replying to a topic that is over a year old :P

minhnghivn
October 20th, 2010, 10:56 AM
By the way, how can I set different RUN_USER for each vhost?

Jack Danish
September 28th, 2012, 02:34 PM
I know it's an old post but thank you, exactly what I was looking for, works perfectly!

...dont forget about permissions.


Jack