DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Packages and Ports

OpenBSD Packages and Ports Installation and upgrading of packages and ports on OpenBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 1st January 2017
22decembre 22decembre is offline
Port Guard
 
Join Date: Dec 2014
Posts: 40
Default isso and fastcgi

I am trying to setup isso (python comment system) on OpenBSD/httpd. It is installed fine (all dependencies installed in a virtualenv inside the httpd chroot). My problem comes with the link between httpd and isso.

Here is what I get if isso get an unix socket in /var/www/tmp/isso.sock with this httpd conf':

Code:
location "/isso/*" {
                #root /isso strip 1
                log style combined
                log error isso-error.log
                log access isso-access.log
                fastcgi socket "/tmp/isso.sock"
                }
I load a webpage with something in isso : https://.../isso/js/embed.min.js

Code:
stephane@blackblock:/var/www/isso doas -u www env LANG=C.UTF-8 bin/isso -c isso.cfg run
----------------------------------------
Exception happened during processing of request from
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/SocketServer.py", line 290, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/usr/local/lib/python2.7/SocketServer.py", line 318, in process_request
    self.finish_request(request, client_address)
  File "/usr/local/lib/python2.7/SocketServer.py", line 331, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/local/lib/python2.7/SocketServer.py", line 652, in __init__
    self.handle()
  File "/var/www/isso/lib/python2.7/site-packages/werkzeug/serving.py", line 228, in handle
    rv = BaseHTTPRequestHandler.handle(self)
  File "/usr/local/lib/python2.7/BaseHTTPServer.py", line 340, in handle
    self.handle_one_request()
  File "/var/www/isso/lib/python2.7/site-packages/werkzeug/serving.py", line 262, in handle_one_request
    elif self.parse_request():
  File "/usr/local/lib/python2.7/BaseHTTPServer.py", line 286, in parse_request
    self.send_error(400, "Bad request syntax (%r)" % requestline)
  File "/usr/local/lib/python2.7/BaseHTTPServer.py", line 364, in send_error
    self.log_error("code %d, message %s", code, message)
  File "/var/www/isso/lib/python2.7/site-packages/werkzeug/serving.py", line 287, in log_error
    self.log('error', *args)
  File "/var/www/isso/lib/python2.7/site-packages/werkzeug/serving.py", line 293, in log
    _log(type, '%s - - [%s] %s\n' % (self.address_string(),
  File "/var/www/isso/lib/python2.7/site-packages/werkzeug/serving.py", line 278, in address_string
    return self.client_address[0]
IndexError: string index out of range
----------------------------------------
Starting httpd on debug mode shows nothing now. Other sockets (php) are not affected and running fine.

----------------------

Now I launch isso with a network socket, I don't see anything while loading pages :

Code:
 location "/isso/*" {
                #root /isso strip 1
                log style combined
                log error isso-error.log
                log access isso-access.log
                fastcgi socket ":1234"
                #fastcgi socket "/tmp/isso.sock"
                }
But if I wget the same javascript from the localhost directly from isso, I indeed get the file :

Code:
stephane@blackblock:/tmp wget http://localhost:1234/js/embed.min.js
--2017-01-01 20:35:27--  http://localhost:1234/js/embed.min.js
Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:1234... failed: Connection refused.
Connecting to localhost (localhost)|127.0.0.1|:1234... connected.
HTTP request sent, awaiting response... 200 OK
Length: 55941 (55K) [application/javascript]
Saving to: 'embed.min.js'

embed.min.js       100%[===============>]  54.63K  --.-KB/s    in 0.01s

2017-01-01 20:35:27 (4.22 MB/s) - 'embed.min.js' saved [55941/55941]
Sorry for it being quite messy (to my own taste !).

I cannot figure it out : isso seems to run fine when running as a small webapp, but then httpd does not seem to forward requests. But when isso is running as a file socket, we can see httpd forward something to isso, just it does not work fine.

Someone has a suggestion ?
Reply With Quote
  #2   (View Single Post)  
Old 1st January 2017
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 5,520
Default

I found the quickstart guide for your application. It indicates the webserver is configured via proxy, and not via FastCGI.

If this were my application, I'd install nginx and follow the quickstart guide.
Reply With Quote
  #3   (View Single Post)  
Old 1st January 2017
22decembre 22decembre is offline
Port Guard
 
Join Date: Dec 2014
Posts: 40
Default

It says also about other deployement methods, like uwsgi, fastcgi with apache...

https://posativ.org/isso/docs/extras/deployment/

I have tried to use the uwsgi method with low result, so I came back to this one I present upside, which was the closest to an actual result.

(NB : I must admit I am not really up to web dev' and deploy, so I might say stupid things here, reason why I love pelican static html system. But having some commets would be great)

Can't I use some more basic stuff rather than having Nginx ? Thanks for the answer.
Reply With Quote
  #4   (View Single Post)  
Old 1st January 2017
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 5,520
Default

It appears to me that you reported the problem to isso developers in September. They recommended you use loopback rather than a Unix socket, since loopback worked.

These examples of OpenBSD's httpd(8) with uWSGI use loopback, rather than Unix sockets.

As I perceive the problem, you have two possible circumventions to your problem.
  • Use loopback with httpd(8).
  • Use www/nginx as proxy webserver.
I do not understand why neither circumvention is an acceptable solution to the problem you have had for more than 3 months.
Reply With Quote
  #5   (View Single Post)  
Old 2nd January 2017
22decembre 22decembre is offline
Port Guard
 
Join Date: Dec 2014
Posts: 40
Default

Quote:
Originally Posted by jggimi View Post
I do not understand why neither circumvention is an acceptable solution to the problem you have had for more than 3 months.
I have just now made a lot of cleaning on the server. So I could try again to setup this properly. Thanks.
Reply With Quote
  #6   (View Single Post)  
Old 7th January 2017
22decembre 22decembre is offline
Port Guard
 
Join Date: Dec 2014
Posts: 40
Default

I managed to get it to work, with a file socket !

It looks like I needed to change a bit some system settings (semaphores) and be extra carefull with which type of socket (fastcgi, not http !) I ask. I use now uwsgi + isso, managed by supervisor.
Reply With Quote
  #7   (View Single Post)  
Old 7th January 2017
22decembre 22decembre is offline
Port Guard
 
Join Date: Dec 2014
Posts: 40
Default

This semaphore thing is yet quite annoying. What would be some sane defaults if anyone knows ?
Reply With Quote
  #8   (View Single Post)  
Old 7th January 2017
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 5,520
Default

Quote:
Originally Posted by 22decembre View Post
...It looks like I needed to change a bit some system settings (semaphores) ...
Quote:
Originally Posted by 22decembre View Post
This semaphore thing is yet quite annoying. What would be some sane defaults if anyone knows ?
Generally, the OpenBSD developers select "sane" defaults for configurable settings. However, you may have found an application where the default needs to be set to something else.

Your question is not answerable with the information posted. You have not posted what settings you altered, nor what they were "before" and "after."
Reply With Quote
Reply

Tags
httpd fastcgi, httpd.conf, python

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
httpd fastcgi configuration and programming hanzer OpenBSD General 11 27th February 2015 01:45 PM
php 5.3 fastcgi Fekete OpenBSD Packages and Ports 5 16th July 2013 11:59 PM


All times are GMT. The time now is 12:14 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick