2016-04-01 64 views
0

我真的尝试部署与Apache和mod_wsgi的金字塔web应用程序,但我得到错误500的消息DistributionNotFound:多云金字塔部署Web应用程序(阿帕奇/ mod_wsgi的)

任何人有任何想法?项目结构是这样的:

  • cloudyapp
    • 阴天
      • 静态
      • 模板
    • cloudy.egg-信息
    • application.wsgi
    • production.ini

我的文件

Application.wsgi

from pyramid.paster import get_app, setup_logging 
import os, sys 

sys.path.append('/var/www/cloudyapp/') 
os.environ['PYTHON_EGG_CACHE'] = '/var/www/cloudyapp/' 

ini_path = '/var/www/cloudyapp/production.ini' 
setup_logging(ini_path) 
application = get_app(ini_path, 'main') 

Production.ini

### 
# app configuration 
# http://docs.pylonsproject.org/projects/pyramid/en/1.6-branch/narr/environment.html 
### 

[app:main] 
use = egg:cloudy 

pyramid.reload_templates = false 
pyramid.debug_authorization = false 
pyramid.debug_notfound = false 
pyramid.debug_routematch = false 
pyramid.default_locale_name = en 

### 
# wsgi server configuration 
### 

[server:main] 
use = egg:waitress#main 
host = 0.0.0.0 
port = 6543 

### 
# logging configuration 
# http://docs.pylonsproject.org/projects/pyramid/en/1.6-branch/narr/logging.html 
### 

[loggers] 
keys = root, cloudy 

[handlers] 
keys = console 

[formatters] 
keys = generic 

[logger_root] 
level = WARN 
handlers = console 

[logger_cloudy] 
level = WARN 
handlers = 
qualname = cloudy 

[handler_console] 
class = StreamHandler 
args = (sys.stderr,) 
level = NOTSET 
formatter = generic 

[formatter_generic] 
format = %(asctime)s %(levelname)-5.5s [%(name)s:%(lineno)s][%(threadName)s] %(message)s 

的apache的conf

<VirtualHost *:443> 

    SSLEngine on 
    SSLCertificateFile /etc/apache2/ssl/cloudy.crt 
    SSLCertificateKeyFile /etc/apache2/ssl/cloudy.key 

    WSGIScriptAlias//var/www/cloudyapp/application.wsgi 

    DocumentRoot /var/www/cloudyapp/ 
    Options -Indexes 
    # Uncomment the line below if your site uses SSL. 
    SSLProxyEngine On 
</VirtualHost> 
+0

找出来。张贴在这里以防别人想知道的情况。我忘了运行setup.py开发。 – sopor

+0

我有这个相同的问题,并且找不到解决方案。虽然我试图在AWS Elastic Beanstalk上部署我的应用程序。你知道是否重要,你运行'python setup.py develop'而不是'python setup.py install'。 –

回答

0

也许你没有安装你的金字塔应用程序,因为你添加了应用程序路径到sys.path。 通过setup.py安装您的应用程序,并把命令的输出tail -n 30 /var/log/apache/error.log