Ich betreibe eine Amazon EC2-Micro-Instanz und ich möchte eine Python-App von ihm mit Flask ausführen.Führen Sie eine Flasche Python-App auf Apache-Server
Hier ist meine app.py
Datei, wo ich eine einfache Datei-Upload zu tun (es funktioniert auf localhost:5000
fein):
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello from Flask!'
if __name__ == '__main__':
app.run()
Hier ist meine Datei adapter.wsgi
benannt ist, es zu Apache verbinden:
import sys
sys.path.insert(0, '/var/www/html/lumos')
from app import app as application
<VirtualHost *>
ServerName http://lumos.website.me
DocumentRoot /var/www/html/lumos
WSGIDaemonProcess lumos threads=5
WSGIScriptAlias//var/www/html/lumos/adapter.wsgi
<Directory "/var/www/html/lumos">
WSGIProcessGroup lumos
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
Allow from all
</Directory>
</VirtualHost>
0123:
schließlich in meiner httpd.conf
Datei, ich habe folgendes getan Dann
, wenn ich den Apache-Server neu starten, und gehen Sie zu http://lumos.website.me/, alles, was ich bekommen, ist eine 503:
Service Temporarily Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
Apache/2.2.31 (Amazon) Server at lumos.website.me Port 80
Alle Ideen, wie ich der Kolben-App auf dem Apache-Server zu arbeiten bekommen kann?
Hinweis: Mein Server läuft.
Update:
Hier ist meine Fehlerlogdatei
[Thu Aug 04 01:34:09 2016] [notice] caught SIGTERM, shutting down
[Thu Aug 04 01:34:09 2016] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Aug 04 01:34:09 2016] [notice] Digest: generating secret for digest authentication ...
[Thu Aug 04 01:34:09 2016] [notice] Digest: done
[Thu Aug 04 01:34:10 2016] [notice] Apache/2.2.31 (Unix) DAV/2 PHP/5.3.29 mod_wsgi/3.2 Python/2.6.9 configured -- resuming normal operations
[Thu Aug 04 01:34:14 2016] [error] [client 72.219.147.5] (13)Permission denied: mod_wsgi (pid=30315): Unable to connect to WSGI daemon process 'lumos' on '/etc/httpd/logs/wsgi.30311.0.1.sock' after multiple attempts.
[Thu Aug 04 01:34:14 2016] [error] [client 72.219.147.5] (13)Permission denied: mod_wsgi (pid=30316): Unable to connect to WSGI daemon process 'lumos' on '/etc/httpd/logs/wsgi.30311.0.1.sock' after multiple attempts., referer: http://lumos.website.me/
[Thu Aug 04 01:34:15 2016] [error] [client 72.219.147.5] (13)Permission denied: mod_wsgi (pid=30317): Unable to connect to WSGI daemon process 'lumos' on '/etc/httpd/logs/wsgi.30311.0.1.sock' after multiple attempts.
Läuft Ihr Server? – error2007s
Ja, ich habe es in meiner Frage aktualisiert –
diese zu Ihrem httpd Datei hinzufügen unter „ MaxConnPerVhost 100 “ und dann Apache neu starten und sehen, ob es funktioniert? –
error2007s