Results 1 to 10 of 27
I am sure I am doing something stupid, but I cannot figure out what...
I have set up an Apache2 server using SUSE 10.3, and I have uploaded my website. ...
- 07-22-2008 #1Just Joined!
- Join Date
- Jul 2008
- Posts
- 16
Trouble giving read permissions to website pages
I am sure I am doing something stupid, but I cannot figure out what...
I have set up an Apache2 server using SUSE 10.3, and I have uploaded my website. However, the website originally returned an access denied page on internet browsers. This is not surprising, because I did not use the default location for my website, but rather created a folder /home/username/public_html.
So I go into Nautilus and go to the permissions tab of the public_html folder and give read permission to all users, including contents of the folder, and it works, but only initially. Any new files are not readable by users.
A web browser can see all the files that were there when I used Nautilus, but anything added since then, the web browser gets the access denied message.
(I also tried CHMOD -R 744 public_html but that had no effect at all.)
I've gotta be overlooking something here -- no way that every website update can be followed by a manual file permission change.
- 07-22-2008 #2Just Joined!
- Join Date
- Sep 2007
- Location
- Lafayette, IN
- Posts
- 83
What's your umask set to? (You can check this with the `umask` command)
- 07-23-2008 #3Just Joined!
- Join Date
- Aug 2006
- Posts
- 6
It could be that they are inheriting the permissions from that parent directory. Check the permissions on that directory.
drwxrwxr-x 22 nobody web 4096 2008-07-21 00:19 htdocs
That is the permission of my root directory and all new files work fine.
Best of luck
- 07-23-2008 #4Just Joined!
- Join Date
- Jul 2008
- Posts
- 16
Hmmm... I do not know this unmask, but when I type it as a command I get command not found. When I type whereis unmask I get nothing.
- 07-23-2008 #5Just Joined!
- Join Date
- Jul 2008
- Posts
- 16
I'm not sure if I am getting your point, but it seems that the problem is that new files are not inheriting the permissions of the root directory. I can go to my public_html directory, give the correct read permissions and all the current files in the directory then are visible... but if i then add another file to the directory, it is not visible.
- 07-23-2008 #6Linux Guru
- Join Date
- Nov 2007
- Location
- Córdoba (Spain)
- Posts
- 1,513
The simplest thing is always the best: do "ls -l" into the relevant directory, and check that the ownerships and permissions are the same for all the files (remember that directories need also +x to be accesible). Remember that permissions per sé say nothing at all. They are referred to an owner and a group, and that info is equally important.
The files do not "inherit" permissions either. They are created with a given owner (the current one) and the default permissions usually, those that oppose the mask that "umask" will return (note also that it's "umask", and not "unmask").
For example, if umask sais "0022" then the default permissions will be 755 (=rwxr-xr-x).
Hope it helps
- 07-23-2008 #7Just Joined!
- Join Date
- Aug 2006
- Posts
- 6
- 07-23-2008 #8Linux Guru
- Join Date
- Nov 2007
- Location
- Córdoba (Spain)
- Posts
- 1,513
- 07-23-2008 #9Just Joined!
- Join Date
- Jul 2008
- Posts
- 16
Here is what I get for ls -l
files for which I have overridden permissions using Nautilus:
-rw-r--r-- 1 beorn users 551 2008-07-23 09:32 a111.html
-rwxr--r-- 1 beorn users 783 2008-07-21 20:39 archive54.html
-rwxr--r-- 1 beorn users 1639 2008-07-21 20:39 archives.jpeg
file uploaded since overriding permissions with Nautilus (access denied to this using web browser)
-rw------- 1 beorn users 551 2008-07-23 09:32 a111a.html
a folder (has been overriden using Nautilus)
drwxr-xr-x 3 beorn users 4096 2008-07-21 19:52 2006
a folder uploaded since overriding permissions with Nautilus
drwx------ 2 beorn users 4096 2008-07-23 09:42 X folder
umask (thank you for the correct spelling) returns 022
So what do I do? I am far from understanding what I am seeing here. Ownership seems to be the same for all files, so I assume that that is not the issue.
I can see that -rwxr--r-- 1 is working for those files and -rw------- is not (I am not fluent in that terminology, but have the general idea.) Is there something here that tells me what to do to fix the problem, so that files I upload in the future will be readable on the web? (Sorry if I am being dense.)
- 07-23-2008 #10Just Joined!
- Join Date
- Jul 2008
- Posts
- 16
Further efforts have gotten me nowhere, and I really cannot understand what I am seeing.
I googled umask and it sounds like the command that I need, and it seems to "work" but not be effective.
I type umask and it returns 0022.
So I type the command umask 644
Then I type umask and it returns 0644 -- so it worked.
But no new file uploaded and no new folder created not its contents get a 644 permission. I am going nuts here.
I mean, thousands of people set up an Apache server in Linux, and apparently this is not a problem for anyone else, so I must be doing something dumb, but I have no idea what.


Reply With Quote
