Pike + LSWS ?

Discussion in 'Install/Configuration' started by Jetro, Feb 20, 2006.

  1. Jetro

    Jetro New Member

    Hello, i'm learnig Pike from half year (easy to learn, highly object oriented, faster than php, python or ruby). It would be fantastic to use it with lsws trough ScriptRunner (that uses fastcgi), instead of writing own web daemons or caudium/roxen web servers. Scriptrunner module has been tested with apache and lighttpd with fcgi or scgi.

    Have someone tried to configure Pike + Scriptrunner + lsws?

    I tried and it's not working for me. :( And i completly dont understand how to configure some fastcgi apps to work.

    I installed pike, libfastcgi, Public.Web.FastCGI as they said in tutorial and tested modules correctly, then i installed scriptrunner. And from here i dont now what to do. For apache it must be made this:
    So in server External Applications i added FastCGI App:
    Name: PikeScripts
    Address: UDS://tmp/lshttpd/myfcgi.sock
    Max Connections: 10
    Auto Start: Yes
    Command: /usr/local/scriptrunner/ScriptRunner.fcgi
    etc.
    and Script Handler:
    Suffixes: pike
    Handler Type: Fast CGI
    Handler Name: [SERVER LEVEL]: PikeScript

    I tried also adding fcgi Script Handler and then rewriting pike files to scriptrunner.fcgi, but it is always waiting several seconds and showing 503 Service Unavaible. scriptrunner logfiles shows nothig. :(

    Can somebody help me with this?
  2. xing

    xing LiteSpeed Staff

    Jetro,

    Can you set

    Log Level: Debug
    Debug Level: High

    And run 2 requests with the pike FCGI in place and post the log. Don't need to run more than 2 requests since the debug level generate a lot of data and there is no need for duplcates.
  3. Jetro

    Jetro New Member

  4. mistwang

    mistwang LiteSpeed Staff

    Please try following:

    1. remove script handler for .pike
    2. define a fast cgi context with uri /ScriptRunner.fcgi , or whatever URL you like.
    3. Try a request like http://www.mysite.com/ScriptRunner.fcgi/foo.pike, foo.pike should be under the document root.
    4. If above works, add a matching context, with URI: exp: /(.*\.pike)$, location: /ScriptRunner.fcgi/$1 , this should do the trick described in the document you posted. You can use URL rewrite to do the same thing as well.

    Not sure Pike's fcgi implement support persistent connection or not, you can try flipping "persistent connection" on or off in the ScriptRunner FCGI application.

    Please let us know it works or not. :)
  5. Jetro

    Jetro New Member

    Today i've seen that on official faq there is one point missing! They don't wrote that in ../scriptrunner_install_dir/lib are pike modules that must been copied to the ../pike_install_dir/lib/modules. ;)

    I added context as you said, mistwang, then used URL rewrite and here are the results:
    http://gmclan.org/test.pike :)
    source:
    Code:
    mapping parse(object id)
    {
            string output = "<html><body><h1>Hello World from Pike!</h1></body></html>";
            string mimetype = "text/html";
    
    return ([ "data" : output, "type" : mimetype ]);
    }
    
    Yes, persistent connection is supported. Is this option affect to the performance?
  6. mistwang

    mistwang LiteSpeed Staff

    Yes, leave it on to give you the best FCGI performance.

Share This Page