简体   繁体   English

部署金字塔Web应用(apache / mod_wsgi)

[英]Deploy pyramid web app (apache/mod_wsgi)

I`m trying to deploy a pyramid web application with apache and mod_wsgi, but I get error 500 with the message DistributionNotFound: cloudy 我正在尝试使用apache和mod_wsgi部署金字塔式Web应用程序,但出现消息DistributionNotFound时出现错误500 :多云

Anyone has any ideas? 有人有什么想法吗? The project structure is something like this: 项目结构是这样的:

  • cloudyapp 云应用
    • cloudy 多云的
      • static 静态的
      • templates 范本
    • cloudy.egg-info cloud.egg-info
    • application.wsgi application.wsgi
    • production.ini production.ini

My Files 我的文件

Application.wsgi 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 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>

perhaps you dont installed your pyramid app as for this you added app path to sys.path . 也许您没有安装金字塔应用程序,因为您为此向sys.path添加了应用程序路径。 install your app via setup.py and put output of command tail -n 30 /var/log/apache/error.log 通过setup.py安装您的应用程序,并输出命令tail -n 30 /var/log/apache/error.log

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM