开发者

Proper way to set permissions with django and apache2?

开发者 https://www.devze.com 2023-03-16 18:42 出处:网络
I\'m using django with wsgi on apache2 I was trying to acess a css file in my site/static/css folder and since the permission was 644, the css file could not be accessed by apache2.

I'm using django with wsgi on apache2

I was trying to acess a css file in my site/static/css folder and since the permission was 644, the css file could not be accessed by apache2.

So I chmod 645 on the site/static/css folder and everything was fine. However, I am worried that granting execution rights开发者_如何学Go to everyone to anything in the css folder could cause security problems. What is the correct way to tackle this problem, perhaps a way to grant certain permissions using the httpd.conf file?

Thanks!


You can use chown to cause the files to be owned by the same group as apache (www-data?) and then set the permission on the group instead everyone.

0

精彩评论

暂无评论...
验证码 换一张
取 消