Re: radicale and httpd

2017-01-14 Thread Remi Locherer
On Sat, Jan 14, 2017 at 11:06:29AM +, Stuart Henderson wrote:
> On 2017-01-13, Jan Lambertz  wrote:
> > Hi,
> >
> > having Problems for some time now with the webserver in python2/3 and
> > radicale, i tried to get it working with httpd.
> >
> > installed flup. python is working in the chroot.
> >
> > here's my work so far but i'm not getting any further. anyone got this
> > working ?
> 
> I'm no expert on httpd(8), but it doesn't seem right to be using slowcgi(8)
> for something that can already be made to speak fastcgi.

Few month ago I looked at radicale. I made radical run as fastcgi daemon
and httpd talking to it via a socket. I started with this but used flup
instead of flipflop:
https://github.com/Kozea/Radicale/blob/master/radicale.fcgi

Sorry, I don't have my script anymore. I decided to not use radicale since
it was not able to handle my data.

Remi



Re: radicale and httpd

2017-01-14 Thread Stuart Henderson
On 2017-01-13, Jan Lambertz  wrote:
> Hi,
>
> having Problems for some time now with the webserver in python2/3 and
> radicale, i tried to get it working with httpd.
>
> installed flup. python is working in the chroot.
>
> here's my work so far but i'm not getting any further. anyone got this
> working ?

I'm no expert on httpd(8), but it doesn't seem right to be using slowcgi(8)
for something that can already be made to speak fastcgi.



radicale and httpd

2017-01-13 Thread Jan Lambertz
Hi,

having Problems for some time now with the webserver in python2/3 and
radicale, i tried to get it working with httpd.

installed flup. python is working in the chroot.

here's my work so far but i'm not getting any further. anyone got this
working ?

Jan

# cat /etc/httpd.conf
server "default" {
listen on * tls port 5233
#   authenticate with "/radicale/htpasswd"

location "*radicale.fcgi" {
fastcgi socket "/radicale/run/radicalefcgi.sock"
root "/radicale/cgi-bin"
}

tcp {
nodelay
}


tls {
certificate "/etc/radicale/server.crt"
key "/etc/radicale/private/server.key"
}
}




slowcgi -d -p /var/www/ -s /var/www/radicale/run/radicalefcgi.sock


# cat /var/www/radicale/cgi-bin/radicale.fcgi
#!/usr/local/bin/python
try:
from flup.server.fcgi import WSGIServer
except ImportError:
from flipflop import WSGIServer
import radicale
radicale.log.start()
radicale.log.LOGGER.info("Starting Radicale FastCGI server")
WSGIServer(radicale.Application()).run()
radicale.log.LOGGER.info("Stopping Radicale FastCGI server")



/var/www/log/error.log says

Traceback (most recent call last):
  File "/radicale/cgi-bin/radicale.fcgi", line 9, in 
WSGIServer(radicale.Application()).run()
  File "/usr/local/lib/python2.7/site-packages/flup/server/fcgi.py",
line 113, in run
ret = ThreadedServer.run(self, sock)
  File "/usr/local/lib/python2.7/site-
packages/flup/server/threadedserver.py", line 84, in run
clientSock, addr = sock.accept()
socket
.
error   
:
[Errno 22] Invalid argument




chroot -g daemon -u www /var/www/ /usr/local/bin/python /radicale/cgi-
bin/radicale.fcgi

says 

Status: 200 OK
Content-Length: 54
Content-type: text/html


RadicaleRadicale works!#





slowcgi says 

slowcgi: socket: /var/www/radicale/run/radicalefcgi.sock
slowcgi: slowcgi_user: www  
slowcgi: chroot: /var/www/  
slowcgi: inflight incremented, now 1
slowcgi: version: 1 
slowcgi: type:1  
slowcgi: requestId:   1 
slowcgi: contentLength:   8   
slowcgi: paddingLength:   0 
slowcgi: reserved:0 
slowcgi: role 1 
slowcgi: flags0 
slowcgi: version: 1 
slowcgi: type:4 
slowcgi: requestId:   1 
slowcgi: contentLength:   448  
slowcgi: paddingLength:   0 
slowcgi: reserved:0
slowcgi: env[0], PATH_INFO= 
slowcgi: env[1], SCRIPT_NAME=/radicale.fcgi
slowcgi: env[2], SCRIPT_FILENAME=/radicale/cgi-bin/radicale.fcgi
slowcgi: env[3], QUERY_STRING=  
slowcgi: env[4], DOCUMENT_ROOT=/radicale/cgi-bin
slowcgi: env[5],
DOCUMENT_URI=/radicale.fcgi
slowcgi: env[6], GATEWAY_INTERFACE=CGI/1.1
slowcgi: env[7], HTTP_HOST=127.0.0.1:5233  
slowcgi: env[8], HTTP_USER_AGENT=OpenBSD ftp   
slowcgi: env[9], HTTPS=on  
slowcgi: env[10], REMOTE_ADDR=127.0.0.1
slowcgi: env[11], REMOTE_PORT=22318
slowcgi: env[12], REQUEST_METHOD=GET
slowcgi: env[13], REQUEST_URI=/radicale.fcgi
slowcgi: env[14], SERVER_ADDR=127.0.0.1
slowcgi: env[15], SERVER_PORT=5233 
slowcgi: env[16], SERVER_NAME=default
slowcgi: env[17], SERVER_PROTOCOL=HTTP/1.0  
slowcgi: env[18], SERVER_SOFTWARE=OpenBSD httpd 
slowcgi: version: 1 
slowcgi: type:4 
slowcgi: requestId:   1 
slowcgi: contentLength:   0 
slowcgi: paddingLength:   0  
slowcgi: reserved:0 
slowcgi: fork: /radicale/cgi-bin/radicale.fcgi
slowcgi: version: 1 
slowcgi: type:5 
slowcgi: requestId:   1 
slowcgi: contentLength:   0 
slowcgi: paddingLength:   0 
slowcgi: reserved:0 
slowcgi: resp version: 1
slowcgi: resp type:7   
slowcgi: resp requestId:   1
slowcgi: resp contentLength:   35
slowcgi: resp paddingLength:   5
slowcgi: resp reserved:0   
slowcgi: resp version: 1
slowcgi: resp type:7
slowcgi: resp requestId:   1
slowcgi: resp
contentLength:   62
  
slowcgi: resp paddingLength:   2  
slowcgi: resp reserved:0   
slowcgi: resp version: 1   
slowcgi: resp type:7   
slowcgi: resp requestId:   1   
slowcgi: resp contentLength:   4   
slowcgi: resp paddingLength:   4
slowcgi: resp reserved:0
slowcgi: resp version: 1   
slowcgi: resp type:7   
slowcgi: resp requestId:   1 
slowcgi: resp contentLength:   41