私の 'controller.py' スクリプト 'のerror.log' は、Apache2の '例外TypeError:' とエラー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
戻る:私はthis questionsが、読んだ
[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
を答えはうまくいかない。
私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>
mod-wsgiをインストールしましたか? sudo aptitude install libapache2-mod-wsgi –
@PierangeloOrizioはい、 'sudo a2enmod wsgi'で有効 – Trimax
仮想ホスト設定を投稿できますか? domain.conf –