You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Tom Laramee <to...@newsvine.com> on 2006/10/10 02:47:18 UTC

[users@httpd] Apache 2.0.58 on Debian Linux

Greetings:

my apache daemon runs as user "www-data".

i need to have this users umask be 002 (it's currently 022)... meaning,
for each of the 25 processes that apache forks off when it begins
to run, the umask for these processes must be 002.

i thought i could just update the users .bashrc file to set this, but
then i found out that the users shell, in /etc/passwd, is "sh", which
is just a sym link to bash ... which means that none of the following
scripts execute when a process is forked using the "www-data" user:

  ~/.bashrc
  ~/.bash_login
  ~/.bash_profile
  /etc/bash.baschrc

so then i thought i could just put a ".shrc", ".login", or a ".profile"
into ~ for the user and set the new umask that way ... this
doesn't work either - presumably because the shell that the
apache processes run as aren't interactive.

so, now i'm not sure what to do.

how can i set the umask for the apache processes that run
as user "www-data"?

thanks for any/all info.
--toml











---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache 2.0.58 on Debian Linux

Posted by Sander Temme <sc...@apache.org>.
Tom,

On Oct 9, 2006, at 7:47 PM, Tom Laramee wrote:

> i need to have this users umask be 002 (it's currently 022)...  
> meaning,
> for each of the 25 processes that apache forks off when it begins
> to run, the umask for these processes must be 002.
>
> i thought i could just update the users .bashrc file to set this, but

In the usual configuration, the Apache HTTP Server is started from an  
init.d script at system boot. This script runs as the root user. The  
server itself then changes the uid of its children to www-data.

This means that the www-data user does not start a shell, and will  
not execute any of its init files.

> how can i set the umask for the apache processes that run
> as user "www-data"?

Try editing the init.d/apache2 script (it may have a slightly  
different name) and put an 'umask 022' statement before the server  
actually gets started. I assume that the server inherits this.

Please let us know if that solves your problem.

S.

-- 
sctemme@apache.org            http://www.temme.net/sander/
PGP FP: 51B4 8727 466A 0BC3 69F4  B7B8 B2BE BC40 1529 24AF