MacOS +阿帕奇+ mod_wsgi + django:网络应用程序的正确文件夹布局和权限是什么?
我现在正在 Max OS X Snow Leopard 服务器上测试 django。我已经为内置 apache/python 编译了 mog_wsgi,并通过 LoadModule wsgi_module 在 apache 中启用了它。我还通过标准 python setup.py install 命令安装了 django。之后,我在 ~/Documents
中创建了一个名为 webtest
的测试 django 应用程序,并通过 WSGIScriptAlias / /Users/me/Documents/webtest 在 Apache 中启用它/django.wsgi
(django.wsgi 是我手动创建的文件)。
正如预期的那样,对于神秘的“访问/error/HTTP_FORBIDDEN.html.var被拒绝”apache错误没有任何作用。正如谷歌所说,这很可能读起来像“apache 无法读取脚本文件”。好的,我已经更改了 sudo chmod -R 777 /Users
(冷静,这是一台虚拟 PC :) - 一切正常。
所以,问题是:在所描述的配置中,我的 Django 应用程序的推荐文件夹结构是什么以及我需要什么权限? 777 不适用于生产:)
I'm testing django right now on Max OS X Snow Leopard Server. I have compiled mog_wsgi for build-in apache/python and enabled it in apache via LoadModule wsgi_module
. I have also installed django via standard python setup.py install
command. After that, i have created a test django application by named webtest
in ~/Documents
and enabled it in Apache via WSGIScriptAlias / /Users/me/Documents/webtest/django.wsgi
(django.wsgi is a file i have created manually).
As expected, nothing works with cryptic "access to /error/HTTP_FORBIDDEN.html.var denied" apache error. As google says, that is most probably reads like 'apache was not able to read script file'. Ok, i have changed sudo chmod -R 777 /Users
(calm, it's a virtual PC :) - and all works just fine.
So, the question: what is a recommended folder structure for my django apps in described configuration and what permissions i need? 777 is not for production :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
0755(目录)和 0644(文件)应该足够了,但无论如何,在用户的主目录下都不是 Web 应用程序的正常位置。
/srv
是放置它们的新位置,但在标准 OS X 安装中找不到此位置。0755 (directories) and 0644 (files) should be plenty, but under a user's home directory is not the normal place for a web app regardless.
/srv
is the new place to put them, but this isn't found in a standard OS X installation.