Linux – Change folder permission for apache on VPS

apache-2.2linuxpermissionsUbuntu

Symfony 2 config keeps saying

Major problems have been detected and must be fixed before continuing
: Change the permissions of the "app/cache/" directory so that the web
server can write into it. Change the permissions of the "app/logs/"
directory so that the web server can write into it.

My steps:

rm -rf app/cache/*
rm -rf app/logs/*

chown -R www-data:www-data app/cache
chown -R www-data:www-data app/logs

Via ftp I change permisson on this folders to 777. Apache is runnung as www-data with www-data as group.

But the folders are still not writable and symfony 2 still prints this messages. Any ideas why?

I am running Ubuntu 10.04 Server, Apache 2 and PHP 5.3.x. And since I am on VPS I cannot add acl to mount options.

ls -al app/cache

gives

total 8
drwxrwxrwx 2 www-data www-data 4096 May 25 00:10 .
drwxrwxr-x 6 www-data www-data 4096 May 25 00:10 ..

ls -al app/cache

gives

total 64
drwxrwxrwx 2 www-data www-data  4096 May 25 00:10 .
drwxrwxr-x 6 www-data www-data  4096 May 25 00:10 ..
-rwxrwxrwx 1 www-data www-data 40235 May 23 06:33 dev.log
-rwxrwxrwx 1 www-data www-data 15029 May 23 06:14 prod.log

Command

ps aux | grep apache

gives

root     12012  0.0  0.8 257952 18356 ?        Ss   20:32   0:00 /usr/sbin/apache2 -k start
www-data 12013  0.0  0.2 154324  4836 ?        S    20:32   0:00 /usr/sbin/apache2 -k start
www-data 12019  0.0  1.5 278124 32924 ?        S    20:32   0:00 /usr/sbin/apache2 -k start
www-data 12020  0.2  1.5 278116 33348 ?        S    20:32   0:02 /usr/sbin/apache2 -k start
www-data 12171  0.0  1.5 278380 33172 ?        S    20:37   0:00 /usr/sbin/apache2 -k start
www-data 12173  0.2  1.5 277568 32740 ?        S    20:37   0:01 /usr/sbin/apache2 -k start
www-data 12175  0.0  1.5 278392 33396 ?        S    20:38   0:00 /usr/sbin/apache2 -k start
www-data 12178  0.3  1.5 277604 32816 ?        S    20:38   0:01 /usr/sbin/apache2 -k start
www-data 12204  0.2  1.5 277832 33048 ?        S    20:39   0:00 /usr/sbin/apache2 -k start
www-data 12210  0.5  1.8 283748 38960 ?        S    20:40   0:01 /usr/sbin/apache2 -k start
www-data 12212  0.3  1.5 277832 33088 ?        S    20:40   0:00 /usr/sbin/apache2 -k start
www-data 12214  0.2  1.5 278132 33352 ?        S    20:40   0:00 /usr/sbin/apache2 -k start
www-data 12215  0.0  0.5 258216 10780 ?        S    20:40   0:00 /usr/sbin/apache2 -k start
www-data 12223  0.0  0.5 258084 10676 ?        S    20:42   0:00 /usr/sbin/apache2 -k start
root     12227  0.0  0.0   6164   664 pts/0    S+   20:44   0:00 grep apache

Any ideas how to deal with this problem?

Best Answer

What are the permissions on /var/www/mysite? It needs to be at least executable by the www-data user for that user to access its contents:

$ chmod o+x /var/www/mysite
Related Topic