APACHE2 Premature end of script headers: handler.py
Hello, i'm using Ubuntu 12.04 i want make a SOAP web service, this is what i've done:
PYTHON3 INSTALL
$ sudo apt-get install python-
$ sudo add-apt-repository ppa:fkrull/
$ sudo apt-get update
$ sudo apt-get install python3.3
DISTRIBUTE-0.7.3 INSTALL
$ cd /home/user/
$ sudo python3.3 setup.py install
JURKO-SUDS-
$ cd /home/user/
$ sudo python3.3 setup.py install
LADON-0.8.9 INSTALL
$ cd /home/user/
$ sudo python3.3 setup.py install
THIS IS THE SOAP CLIENT
#!/usr/
# -*- coding: UTF-8 -*-
from suds.client import Client
try:
# client = Client("http://
# client = Client("http://
client = Client("http://
# Calculate 34+56
result = client.
print(
print(result)
except Exception as e:
print(
print(e)
THIS IS THE SOAP SERVER (ecows.py)
#!/usr/
from ladon.ladonizer import ladonize
class Calculator(object):
"""
Questo servizio esegue la somma algebrica di due interi.
"""
@ladonize(int, int, rtype=int)
def add(self, a, b):
"""
Somma il valore di due interi e restituisce il valore risultante sotto forma di intero
@param a: 1° intero
@param b: 2° intero
@rtype: Risultato dell'addizione'
"""
return a + b
If i test everything with "ladon-ctl testserve /var/www/
Everything runs ok!
The problem is with apache2
This is my configuration:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www
WSGIScriptAlias /ws/ /var/www/
<Directory />
Options Indexes FollowSymLinks Includes ExecCGI
#Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks Includes ExecCGI
#Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
AddHandler cgi-script .py
AddHandler default-handler .html .htm
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwne
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
And this is my handler.py
#!/usr/bin/env python3.3
from ladon.server.wsgi import LadonWSGIApplic
from os.path import abspath, dirname
application = LadonWSGIApplic
['ecows'], [dirname(
catalog_
catalog_
So i have restartted my apache webserver and if i try
"http://
There is a 500 Internal server error and the apache log says only "Premature end of script headers: handler.py"
With ladon-ctl and http://
What am i doing wrong???
Tank you very much!!
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- ladon Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- User
- Solved:
- Last query:
- Last reply: