Results 1 to 9 of 9
Thread: apache umask
-
09-01-2007, 07:19 AM #1Web Hosting Master
- Join Date
- Apr 2005
- Posts
- 697
apache umask
Hi guys,
Here's the issue i'm currently having:
I have 2 servers, both servers have apache... I have my apache on my 2nd server create a few images into a folder... and that folder is shared with server 1... however, those images are not viewable by server 1... not sure what the umask is, but I would like it to be 0022/644 when server 2 output images into that folder...
Is there anyway we can do this? thank you so much in advance.
-
09-01-2007, 07:26 AM #2Web Hosting Master
- Join Date
- Apr 2005
- Posts
- 697
after some googling... I guess my question comes down to us... how do I set a default permission on any files/folder output from server 2 to be 644 instead of 600...
-
09-01-2007, 07:49 AM #3Web Hosting Master
- Join Date
- Apr 2002
- Location
- Auckland - New Zealand
- Posts
- 1,575
Usually, the user that starts the apache server (root) needs their .profile setting with the correct PATH settings - common thing I found on Debian after installing apache/php.
Try adding this to /root/.profile
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11
export PATH
Then logout, login and restart apache. test with a simple php script that writes files once you have made the change.
-
09-01-2007, 07:50 AM #4Web Hosting Master
- Join Date
- Apr 2005
- Posts
- 697
my server doesn't have that for some reason: /root/.profile
-
09-01-2007, 07:54 AM #5Web Hosting Master
- Join Date
- Apr 2002
- Location
- Auckland - New Zealand
- Posts
- 1,575
Ok, well create one with this in, see if that helps
# ~/.profile: executed by Bourne-compatible login shells.
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11
export PATH
mesg n
umask 022
-
09-01-2007, 07:58 AM #6Web Hosting Master
- Join Date
- Apr 2005
- Posts
- 697
im really confuse now... I don't even know where to begin with this... thanks for your help anyway... is there a setting in apache conf that I can just change?
-
09-01-2007, 08:05 AM #7Web Hosting Master
- Join Date
- Apr 2002
- Location
- Auckland - New Zealand
- Posts
- 1,575
Not that I know of, just go ahead and create the /root/.profile file with what I posted within it.
Also check /root/.bashrc and make sure that
umask 022 is there, if not , add it.
Then logout - login and restart apache.
Other than that, hire a server admin to sort it out, wouldn't take long.
-
09-01-2007, 08:09 AM #8Web Hosting Master
- Join Date
- Apr 2005
- Posts
- 697
ok, this is what i did:
nano /root/.profile
I pasted this in there:
Code:# ~/.profile: executed by Bourne-compatible login shells. if [ -f ~/.bashrc ]; then . ~/.bashrc fi PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11 export PATH mesg n
then I restart apache...
so this would get my apache to output 022 file permission?
-
09-01-2007, 08:16 AM #9Web Hosting Master
- Join Date
- Apr 2002
- Location
- Auckland - New Zealand
- Posts
- 1,575
You missed the bit where you logged out, then logged back in again and then restarted apache - if you do that does it work now how you expected? If not, then you may need to get some help by contracting someone to do it for you.