Mein 'controller.py' SkriptApache2 whith mod_wsgi python3 'Typeerror: und zurück Fehler 500
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
def application(environ, start_response):
# the ouput string to respuesta var
respuesta = "<p>Página web construida con <strong>Python!!!</strong></p>"
# generating the response OK
start_response('200 OK', [('Content-Type', 'text/html; charset=utf-8')])
return respuesta
In 'error.log':
[Mon Mar 13 12:36:32.656669 2017] [wsgi:error] [pid 28767:tid 139926041507584] [client 127.0.0.1:56382] mod_wsgi (pid=28767): Exception occurred processing WSGI script '/var/www/python/app/controller.py'. [Mon Mar 13 12:36:32.656761 2017]
[wsgi:error] [pid 28767:tid 139926041507584] [client 127.0.0.1:56382] TypeError: sequence of byte string values expected, value of type str found [email protected]---:/var/www/python/logs$ TypeError: sequence of byte string values expected, value of type str found
Ich habe this questions lesen, aber die Antwort funktioniert nicht.
mein site.conf
<VirtualHost *:80>
ServerName app.salvaj.es
ServerAdmin [email protected]
DocumentRoot /var/www/python/static
WSGIScriptAlias//var/www/python/app/controller.py
ErrorLog /var/www/python/logs/error.log
CustomLog /var/www/python/logs/access.log combined
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/python/static>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
</VirtualHost>
Hast du den mod-wsgi installiert? sudo aptitude installieren libapache2-mod-wsgi –
@PierangeloOrizio ja, und aktiviert mit 'sudo a2enmod wsgi' – Trimax
Können Sie die virtuelle Host-Konfiguration? domain.conf –