2016-04-01 11 views
0

I`m versucht, eine Pyramide Web-Anwendung mit Apache und mod_wsgi zu implementieren, aber ich bekomme Fehler 500 mit der Meldung DistributionNotFound: bewölktBereitstellen Pyramide Web-App (Apache/mod_wsgi)

Wer irgendwelche Ideen hat? Die Projektstruktur ist so etwas wie dieses:

  • cloudyapp
    • bewölkt
      • statische
      • Vorlagen
    • cloudy.egg-info
    • application.wsgi
    • production.ini

My Files

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

Es herausgefunden. Sie können es hier veröffentlichen, falls sich jemand anderes fragt. Ich habe vergessen, setup.py zu entwickeln. – sopor

+0

Ich habe das gleiche Problem und kann keine Lösung finden. Obwohl ich versuche, meine Anwendung auf AWS Elastic Beanstalk bereitzustellen. Wissen Sie, ob es wichtig ist, dass Sie 'python setup.py develop' im Gegensatz zu' python setup.py install' ausführen. –

Antwort

0

vielleicht haben Sie Ihre Pyramiden-App nicht installiert, da Sie den App-Pfad zu sys.path hinzugefügt haben. installieren Sie Ihre App über setup.py und setzen Sie die Ausgabe des Befehls tail -n 30 /var/log/apache/error.log