Following problem:
I have an ubuntu 12.04 server I made a virtual host with
DocumentRoot /var/www/
Everything is fine, I see the correct index.html when I point with webrowser to the website of this virtual host. When I look to the owner of the www folder I see:
ls -l
drwxr-xr-x 2 root root 4096 Jul 10 09:07 www
Now I change the DocumentRoot to
DocumentRoot /root/testFolder/
I copy my index.html in this folder, point with webrowser to my domain, then I get the message "You don't have the permission..."
Ok, I check the owner of testFolder
ls -l
drwxr-xr-x 2 root root 4096 Jul 11 08:18 testFolder
It is the same as www folder.
Ok my next try to change the group owner of testFolder
chown -R www-data:www-data /root/testFolder/
But I get the same result in my browser: "You don't have permission to access / on this server."
Usually this user is named apache or www-data . So, in order to make a directory writable by the webserver we have to set the directory's owner or group to Apache's owner or group and enable the write permission for it.
Well if you to want to allow /thumbs/ directories, it depends how they are being blocked in the first place. If they're blocked with normal Apache access permissions, then something like this will do it, but must go in the main server config at root level or in a <VirtualHost> and not in a . htaccess file.
Try:
chown -R apache:apache /root/testFolder/
and
chmod +r /root/testFolder
UPDATE
The solution in this specific case was to move apache from under /root into a folder that doesn't require root privileges.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With