C/C++ FastCGI

Discussion in 'Install/Configuration' started by fryk, Jun 1, 2005.

  1. fryk

    fryk Member


    Is it possible to run such?

    I tried to put "echo" example from http://www.fastcgi.com/dist/fcgi.tar.gz to lsws/DEFAULT/cgi-bin but I have get:

    lscgid: execve(): Exec format error
    So, is it possible and how can I make it?
  2. mistwang

    mistwang LiteSpeed Staff

    File "echo" under examples/ directory is a shell script wrapper, you should looking for real executable binary under examples/.libs/ .
  3. fryk

    fryk Member

    ok I got .libs and "echo". Where should I put it now so it could be lunched as FastCGI.

    I appreciate your help!

    I've put it in cgi-bin but recieved:

    lscgid: execve(): No such file or directory
  4. mistwang

    mistwang LiteSpeed Staff

    Not sure why you get that message, if you overwrote the wrapper script with real binary, it should work.

    Have you tried executing echo from command line?

    If you run the wrapper under examples/ directory, a file called lt-echo will be created under .libs/ dir, maybe you should try that one.

  5. fryk

    fryk Member

    I took echo from fcgi-2.4.0/examples/.libs and put it in lsws/DEFAULT/cgi-bin.

    I've also restarted lsws. Whats wrong? Could you test it at your env? I would appreciate it. I spend whole my working day trying to lunch fastcgi c by lsws...
  6. mistwang

    mistwang LiteSpeed Staff

  7. fryk

    fryk Member

    Ok, I'm lost, can't make it.

    Could you help me and tell how to define External App / Script Handler in Server Configuration panel for fastcgi/examples/.lib/echo script from FastCGI package (www.fastcgi.com)?

    Where to put it and how to configure/run it?

    I'm crushed...
  8. fryk

    fryk Member

    I can run echo as cgi with: localhost/cgi-bin/echo.

    I've found out also that remaining scripts doesn't seem to work: size, log-dump.

    It reports "500 Internal Server Error".

    No matter!

    Just want to know - how to run echo as fcgi???

    I've even tried to set cgi-fcgi handler for .fcgi files and rename echo to echo.fcgi and lunch it from lsws/DEFAULT/html but got: " 503 Service Unavailable"
  9. mistwang

    mistwang LiteSpeed Staff

    Well, maybe you need to read the document throughly.
    Use the phpFCGI external application as an example.

    You can make it. :)
  10. fryk

    fryk Member

    Do I need to set Handler?

    Does it mean that I have to define EACH fcgi script as Externall App???
  11. fryk

    fryk Member

    Just don't get it. :( :( :(
  12. fryk

    fryk Member

    From localhost/cgi-bin/echo runs as CGI - it spowns new pid every new request.

    The goal is to run it as FastCGI - within one pid.

    Can't make it. Pleas help guys...
  13. mistwang

    mistwang LiteSpeed Staff

    Yes, you need to define a external app for each fast cgi application. It is a bad idea to write too many fcgi, which only do one simple task like a CGI, you should combine features as you could.

    In the case of /fcgi-bin/echo, you should not define a script handler, instead, you need to define a FCGI context with URL "fcgi-bin/echo" or what ever URL you want to access the fcgi app.
  14. fryk

    fryk Member

    Big thanks for your answer. How can I make that contex?
  15. mistwang

    mistwang LiteSpeed Staff

    click the name of the virtual host, then "context" tab, then "add"
  16. fryk

    fryk Member

    Thank you for your answer. I have just found your great documentation about context.

    I realised my silly questions was annoying for you. Sory for that. I appreciate your patience.

    You are GREAT guys @ lsws!!
  17. fryk

    fryk Member

    Can't make it work. Check this out guys please - what's wrong?


    External Apps


    EAecho running

    Lunch it - ERROR

  18. fryk

    fryk Member

    Ok, I've solved it!!

    The reason was: lack of header informations in my script ("content...").

    Everything works fine now.

  19. fryk

    fryk Member

    BTW is it possible to have such results:

    lsws (with fastCGI php): ~700req/s
    apache2      (pure php): ~700req/s
    lsws, apache2 (both as fastCGI): ~1600req/s
  20. mistwang

    mistwang LiteSpeed Staff

    It doesn't looks right, I don't think the performance of lsws and Apache is in the same class, especially for the fcgi test.

    Would you mind prividing more detail information about how the test is performed? What is the simple-test_script does? hardware, software used.

Share This Page