Results 1 to 7 of 7
Hi all,
I've installed apache and all is working but when I try to extract anything to the /var/www/html/ I get the following error in the browser:
Forbidden
You don't ...
- 02-10-2012 #1Just Joined!
- Join Date
- Feb 2012
- Posts
- 4
Forbidden You don't have permission to access
Hi all,
I've installed apache and all is working but when I try to extract anything to the /var/www/html/ I get the following error in the browser:
Forbidden
You don't have permission to access /Symfony/web/config.php on this server.
However, when I create a my own files, for example, /var/www/html/test_dir/test.html I can view them in the browser.
Thanks!!
- 02-10-2012 #2Just Joined!
- Join Date
- Feb 2011
- Posts
- 19
Permission problem on the file. Most likely owned by root
As root:
chown username:username <file>
For a recursive ownership of a directory and its contents:
chown -R username:username <directory>
- 02-11-2012 #3
By default, the www directory will be owned by root user.
So, if you just want to change some configuration files in it, then you can simply switch user to root and manipulate the files.
But this will not work for GUI apps like filezilla to edit the files under www directory, so in that case you have to change the owner of that folder from root user to your normal user.
- 02-12-2012 #4
You don't have to change ownership of the directory in order to gain access to modify files under it.. What you should do is change the permissions. If memory serves me correctly /var/www/html is 755 <rwxr-xr-x> changing this to 775 <rwxrwxr-x>will give group users access to modify files in that directory.
However it is not a good idea to do it this way. A better way is to modify the group and then users you want to give modify rights to add them to that group. You just need to change the permissions then to 775 <rwxrwxr-x>
Also keep in mind that any directory that doesn't need to be able to execute files should not be set to allow it. 766 <rwxrw-rw-> Especially if it is public facing. And on those public facing directories if you must have execute permissions then you shouldn't allow edit rights to anyone but owner and group 775 <rwxrwxr-x>.
- 02-13-2012 #5Just Joined!
- Join Date
- Feb 2012
- Posts
- 4
Thanks so far.
A related question then: If I unpack a tar in my home directory and then move it to /var/www/html/ why am I unable to view (Forbidden You don't have permission to access on this server) the files in the browser even if I change the owner to root and chmod to 777?
If I unpack under /var/www/html then I have no problems viewing the files on the browser.
Thanks again.
- 02-15-2012 #6
I had the same access problem some time ago,I used the chmod 777 <path to HTML directory> command.
but even after granting all permissions to all people, the files in the html are not accessible from outside(i.e, through filezilla).
so I came to a conclusion that filezilla is started from normal user,but the html file resides inside the root directory and we have to add/change the owner of the irectory to normal user from root user.
here is the thread which I've posted earlier:
http://www.linuxforums.org/forum/red...directory.html
- 02-15-2012 #7
The standard Apache install comes with a lock-down <Directory ...> statement for its html-root directory. You should consider adding new <Directory ...> definitions for each directory you want it to grant access to. There are examples of this in the standard httpd.defs file, and it's a subject that's well documented on t'internet.
Linux user #126863 - see http://linuxcounter.net/


Reply With Quote
