0

我正在尝试建立一个金字塔应用程序。我正在使用 wsgi 和 apache2。

我不断收到内部服务器错误,并且 apache 日志的内容是

 mod_wsgi (pid=11200): Exception occurred processing WSGI script '/home/ubuntu/modwsgi/env/pyramid.wsgi'.
 Traceback (most recent call last):
   File "/home/ubuntu/modwsgi/env/lib/python2.6/site-packages/pyramid-1.3-py2.6.egg/pyramid/router.py", line 191, in __call__
     request._process_response_callbacks(response)
   File "/home/ubuntu/modwsgi/env/lib/python2.6/site-packages/pyramid-1.3-py2.6.egg/pyramid/request.py", line 243, in _process_response_callbacks
     callback(self, response)
   File "/home/ubuntu/modwsgi/env/lib/python2.6/site-packages/pyramid_beaker-0.6.1-py2.6.egg/pyramid_beaker/__init__.py", line 26, in session_callback
     self.persist()
   File "/home/ubuntu/modwsgi/env/lib/python2.6/site-packages/Beaker-1.6.3-py2.6.egg/beaker/session.py", line 706, in persist
     self._session().save()
   File "/home/ubuntu/modwsgi/env/lib/python2.6/site-packages/Beaker-1.6.3-py2.6.egg/beaker/session.py", line 400, in save
     **self.namespace_args)
   File "/home/ubuntu/modwsgi/env/lib/python2.6/site-packages/Beaker-1.6.3-py2.6.egg/beaker/container.py", line 622, in __init__
     util.verify_directory(self.file_dir)
   File "/home/ubuntu/modwsgi/env/lib/python2.6/site-packages/Beaker-1.6.3-py2.6.egg/beaker/util.py", line 85, in verify_directory
     os.makedirs(dir)
   File "/usr/lib/python2.6/os.py", line 150, in makedirs
     makedirs(head, mode)
   File "/usr/lib/python2.6/os.py", line 157, in makedirs
     mkdir(name, mode)
 OSError: [Errno 13] Permission denied: 'beaker_dir'

我可以使用简单的 pserve 来提供页面并wget http://localhost:6543/user/form在终端上运行。它适用于下载表单。但是在浏览器上我得到了 500 错误。

我正在使用 EC2 来托管应用程序。

在 app:main 节中,我使用以下代码:

session.type = file
session.data_dir = beaker_dir
session.key = mvc
session.encrypt_key = mysecretencryptionkey
session.validate_key = mysecretvalidationkey
session.cookie_on_exception = true

非常感谢阅读

4

1 回答 1

3

为以下内容提供绝对路径:

session.data_dir = beaker_dir

当前的工作目录可以是任何东西,通常是'/',所以路径是错误的。

于 2012-04-18T01:07:41.253 回答