View Single Post

   
  #7 (permalink)  
Old 02-21-2008, 10:59 AM
Aidan
 
Posts: n/a
Default Re: Apache webroot & webapp-config security

Wim Cossement wrote:
> Wim Cossement wrote:
>
>> Hi,
>>
>> After installing phplmyadmin and adding it with webapp-config to the
>> default vhost, located in /var/www/localhost/htdocs, I noticed that
>> the permissions from /var/www were root:root 0755.
>>
>> This means that for example
>> /var/www/localhost/htdocs/phpmyadmin/config.default.php is readable by
>> world, and since this contain a password used to connect as the pma
>> user to MySQL, and is potentially dangerous.
>>
>> So I made apache:apache the recursive owner of /var/www and also
>> chmodded it with -R 2700.
>>
>> Is this the standard way or are there better ways?
>>
>> Thanks,
>>
>> Wimmy

>
>
> Thanks for both tips, I aready took the x from all my PHP files, but the
> second suggestion about changing the all files in /var/www/ to
> root:apache 0640 does not do the trick, I always get a 403 error when I
> tried this.
>
> This seems unlogical too me, since apache runs as apache:apache so it
> shoud be able to get me the files since the group can read them.
>
> What am I missing?
>
> Regards,
>
> Wimmy


If you did a recursive ch{own,grp,mod} -R root:apache 640, then the
folders inside wont have the 'x' access flag, fix the folders and the
scripts should function.
Reply With Quote