> Since apache is started by root, it will inherit root's umask. In your
> case 022. Files uploaded will have permissions rw-r---r--
Exactly! thats the reason I checked root's umask. But, in my case it didnt work
as anticipated.
> You can include the umask() function in your php script to change
> this.
Yes. I knew this. In fact I started hunting solution from php and later thought
of setting it up in Apache. I have conveyed to the developer to look for things
he can do. Lets see what pros and cons come up.
>(Altering root's umask is the easier solution, but obviously not
>recommended for security reasons.)
True. Hence not doing any modification at system level. Anyway I tried and it
didnt work!
> There might be better solutions, but this is all I can think of at
>the moment. + envars isn't present on RH/Centos. It's for
>Ubuntu/Debian.
I realised later that envvars is available in debian. Moreover, the env
variables it speaks of is not related to underlying OS env variables.
As for redhat based, one can set umask in /etc/sysconfig/httpd. I tried it.
Apahce gives no errors when initialising. But file permission is not as per the
set umask.
I can think of two reasons for which this is happening. The issue could be
combination of the two things.
1. Path in which apache stores file is not its home dir or docroot. It belongs
to another application.
2. The permission of apache on that dir is set using FACL (setfacl -m
u:apache:rwx)
Very IMP to get to the tail of the issue. Else it will haunt the entire team
when we move storage to a DFS (Distributed File System)
Since I am not able to access the test servers from home. I will try a few
checks and let you know how it did.. one check is to let apache upload to its
own directory or docroot and see what permissions the file gains. That will
give a clue!