Results 1 to 9 of 9

Thread: FastCGI installation

  1. #1
    Secret Agent
    Guest

    Default FastCGI installation

    Could someone please provide simple steps to install FastCGI? I've searched the forums and found nothing.

    The official page is http://www.fastcgi.com/dist/mod_fastcgi-2.4.2.tar.gz and still others tell me that is only "apache part". I'm a bit lost on this.

    I want to enable it and compile it with Apache.

    Any help would be appreciated.

    How can I test it and see that it was offically installed? Would it appear in phpinfo.php ?

  2. #2
    Registered Member
    Join Date
    Sep 2004
    Posts
    422

    Default

    Did you download the .tar.gz and read the INSTALL file?

    http://www.fastcgi.com/mod_fastcgi/d...d_fastcgi.html

    Summary
    For information about building and installing the module, see the INSTALL document that came with the distribution.
    That would be a good place to start with, as like most applicatons, they come with great documentation covering installation and usually usage too. Look also for README files.

    Good luck with the installation.

  3. #3
    Secret Agent
    Guest

    Default

    Its a little confusing to be honest. There is so much this and that, that it drives me dizzy a bit between this method, that method and what have you.

    I hope someone has a simple straightforward method to install/enable this module.

  4. #4
    Secret Agent
    Guest

    Default

    Found a site that simplified it but I'm getting errors

    http://www.renegadeinternet.com/kb/f...id=33&q_id=123

    gunzip mod_fastcgi.tar.gz
    tar -xvf mod_fastcgi.tar
    cd mod_fastcgi_2.2.10
    /usr/sbin/apxs -o mod_fastcgi.so -c *.c
    /usr/sbin/apxs -i -a -n fastcgi mod_fastcgi.so

    this command is from above
    root@server [~/mod_fastcgi-2.4.2]# /usr/sbin/apxs -o mod_fastcgi.so -c *.c
    -bash: /usr/sbin/apxs: No such file or directory

    this one is from fastcgi's install instructions
    root@server [~/mod_fastcgi-2.4.2]# apxs -o mod_fastcgi.so -c *.c
    -bash: apxs: command not found

    root@server [~/mod_fastcgi-2.4.2]# ls
    ./ docs/ fcgi_protocol.c Makefile.AP2 modules.mk
    ../ fcgi_buf.c fcgi_protocol.h Makefile.libdir README
    CHANGES fcgi_config.c fcgi_util.c Makefile.tmpl Win32/
    debian/ fcgi.h INSTALL mod_fastcgi.c
    .deps fcgi_pm.c INSTALL.AP2 mod_fastcgi.h


    Any ideas?

  5. #5
    Registered Member
    Join Date
    Sep 2004
    Posts
    422

    Default

    hmm.. ok

    It's really not that hard, see how you go with this, INSTALL step 3.

    # wget http://www.fastcgi.com/dist/mod_fastcgi-2.4.2.tar.gz

    # tar xvzf mod_fastcgi-2.4.2.tar.gz

    # cd mod_fastcgi-2.4.2

    # /usr/local/apache/bin/apxs -o mod_fastcgi.so -c *.c

    # /usr/local/apache/bin/apxs -i -a -n fastcgi mod_fastcgi.so

    This should create an entry in httpd.conf that looks like this:

    LoadModule fastcgi_module <some_path>/mod_fastcgi.so

    Note that if there's a ClearModuleList directive after new entry,
    you'll have to either move the LoadModule after the ClearModuleList
    or add (have a look at how the other modules are handled):

    AddModule mod_fastcgi.c

    3. Edit the httpd configuration file(s) to enable your FastCGI
    application(s). See docs/mod_fastcgi.html for details.

    If you want to wrap the mod_fastcgi directives, use:

    <IfModule mod_fastcgi.c>
    .
    .
    </IfModule>

    4. Stop and start the server.

    # /etc/init.d/httpd stop
    # /etc/init.d/httpd startssl


    Your apxs won't be in /usr/sbin unless you are running apache from rpm distribution as a rule. Simple way to find any file, apxs in this instance (you should use the one that your apache is using)

    # locate apxs
    Last edited by DigitalN; 03-08-2005 at 02:32 PM.

  6. #6
    Secret Agent
    Guest

    Default

    Ok it seemed to go well this time with no errors. Thanks for your help

    Just to clarify something

    root@server [~/mod_fastcgi-2.4.2]# locate apxs

    /usr/share/man/fr/man1/apxs.1.gz
    /usr/local/apache/bin/apxs
    /usr/local/apache/man/man8/apxs.8
    /usr/local/apache/htdocs/manual/programs/apxs.html
    /home/cpins/installd/buildapache/apache_1.3.33/htdocs/manual/programs/apxs.html
    /home/cpins/installd/buildapache/apache_1.3.33/src/support/apxs.8
    /home/cpins/installd/buildapache/apache_1.3.33/src/support/apxs.pl
    /home/cpins/installd/buildapache/apache_1.3.33/src/support/apxs
    /home/cpapachebuild/buildapache/apache_1.3.33/htdocs/manual/programs/apxs.html
    /home/cpapachebuild/buildapache/apache_1.3.33/src/support/apxs.8
    /home/cpapachebuild/buildapache/apache_1.3.33/src/support/apxs.pl
    /home/cpapachebuild/buildapache/apache_1.3.33/src/support/apxs
    /home/virtfs/ekostest/usr/share/man/fr/man1/apxs.1.gz

    httpd.conf looks good as well...but what is the wrap around for /usage? I left it as is without wrap.

    Is there a way to immediatley test this now?

  7. #7
    Registered Member
    Join Date
    Sep 2004
    Posts
    422

    Default

    The locate apxs was just to make you aware that you need to find the correct apxs binary in order to install the application - Your apache installation being cPanel installed, /usr/local/apache/bin/apxs is the default location and as you found works.

    The

    <IfModule ....>

    </IfModule ....>

    Is just like any other wrapper, it will only load the config if the module exists, say you removed the module at some time from /usr/local/apache/libexec - your apache won't fail if you have the <IfModule .. > wrapper, as it wil only load if the module is installed and can be found in /usr/local/apache/libexec - as per the LoadModule directive you have.

    Whether you use it is up to your personal preference, but I would, as I find it's good practice.

    Its now time to read

    docs/mod_fastcgi.html

    from within the mod_fastcgi-2.4.2 directory, to set it up how you want it.

  8. #8
    Secret Agent
    Guest

    Default

    About 3 weeks ago I installed FastCGI on my server. I have yet to run an fcgi script sucessfully. So I pulled together a test.fcgi file I could call directly which consists of the following code:

    #!/usr/local/bin/ruby
    require 'fcgi'

    FCGI.each do |request|
    request.out.print "Content-type: text/plain\r\n\r\n"
    request.out.print "This is a test."
    request.finish
    end


    It stalls for 30 seconds and then coughs up an "Error 500".

    This is the apache error_log resulting form a clean httpd restart immediately followed by calling the above url (the test.fgi page)

    [Wed Mar 30 14:28:45 2005] [warn] NameVirtualHost xx.x1.35.139:80 has no VirtualHosts
    [Wed Mar 30 14:28:45 2005] [notice] FastCGI: process manager initialized (pid 1441)
    [Wed Mar 30 14:28:46 2005] [notice] Apache configured -- resuming normal operations
    [Wed Mar 30 14:28:46 2005] [notice] suEXEC mechanism enabled (wrapper: /usr/local/apache/bin/suexec)
    [Wed Mar 30 14:28:46 2005] [notice] Accept mutex: sysvsem (Default: sysvsem)
    FastCGI: can't start server "/home/temple/public_html/test.fcgi" (pid 1457), execle() failed: No such file or directory
    [Wed Mar 30 14:29:01 2005] [warn] FastCGI: (dynamic) server "/home/temple/public_html/test.fcgi" started (pid 1457)
    [Wed Mar 30 14:29:01 2005] [warn] FastCGI: (dynamic) server "/home/temple/public_html/test.fcgi" (pid 1457) terminated by calling exit with status '255'
    FastCGI: can't start server "/home/temple/public_html/test.fcgi" (pid 1459), execle() failed: No such file or directory
    [Wed Mar 30 14:29:06 2005] [warn] FastCGI: (dynamic) server "/home/temple/public_html/test.fcgi" restarted (pid 1459)
    [Wed Mar 30 14:29:06 2005] [warn] FastCGI: (dynamic) server "/home/temple/public_html/test.fcgi" (pid 1459) terminated by calling exit with status '255'
    FastCGI: can't start server "/home/temple/public_html/test.fcgi" (pid 1460), execle() failed: No such file or directory
    [Wed Mar 30 14:29:11 2005] [warn] FastCGI: (dynamic) server "/home/temple/public_html/test.fcgi" restarted (pid 1460)
    [Wed Mar 30 14:29:11 2005] [warn] FastCGI: (dynamic) server "/home/temple/public_html/test.fcgi" (pid 1460) terminated by calling exit with status '255'
    FastCGI: can't start server "/home/temple/public_html/test.fcgi" (pid 1461), execle() failed: No such file or directory
    [Wed Mar 30 14:29:16 2005] [warn] FastCGI: (dynamic) server "/home/temple/public_html/test.fcgi" restarted (pid 1461)
    [Wed Mar 30 14:29:16 2005] [warn] FastCGI: (dynamic) server "/home/temple/public_html/test.fcgi" (pid 1461) terminated by calling exit with status '255'
    [Wed Mar 30 14:29:16 2005] [warn] FastCGI: (dynamic) server "/home/temple/public_html/test.fcgi" has failed to remain running for 30 seconds given 3 attempts, its restart interval has been backed off to 600 seconds
    [Wed Mar 30 14:29:16 2005] [warn] FastCGI: (dynamic) server "/home/temple/public_html/test.fcgi" has failed to remain running for 30 seconds given 3 attempts, its restart interval has been backed off to 600 seconds
    [Wed Mar 30 14:29:19 2005] [warn] FastCGI: (dynamic) server "/home/temple/public_html/test.fcgi" has failed to remain running for 30 seconds given 3 attempts, its restart interval has been backed off to 600 seconds
    [Wed Mar 30 14:29:22 2005] [warn] FastCGI: (dynamic) server "/home/temple/public_html/test.fcgi" has failed to remain running for 30 seconds given 3 attempts, its restart interval has been backed off to 600 seconds
    [Wed Mar 30 14:29:25 2005] [warn] FastCGI: (dynamic) server "/home/temple/public_html/test.fcgi" has failed to remain running for 30 seconds given 3 attempts, its restart interval has been backed off to 600 seconds
    [Wed Mar 30 14:29:28 2005] [warn] FastCGI: (dynamic) server "/home/temple/public_html/test.fcgi" has failed to remain running for 30 seconds given 3 attempts, its restart interval has been backed off to 600 seconds
    [Wed Mar 30 14:29:31 2005] [warn] FastCGI: (dynamic) server "/home/temple/public_html/test.fcgi" has failed to remain running for 30 seconds given 3 attempts, its restart interval has been backed off to 600 seconds
    [Wed Mar 30 14:29:34 2005] [error] [client xx.x69.85.248] FastCGI: comm with (dynamic) server "/home/temple/public_html/test.fcgi" aborted: (first read) idle timeout (30 sec)
    [Wed Mar 30 14:29:34 2005] [error] [client xx.x69.85.248] FastCGI: incomplete headers (0 bytes) received from server "/home/temple/public_html/test.fcgi"
    [Wed Mar 30 14:29:34 2005] [error] [client xx.x69.85.248] File does not exist: /home/temple/public_html/500.shtml
    [Wed Mar 30 14:29:34 2005] [warn] FastCGI: (dynamic) server "/home/temple/public_html/test.fcgi" has failed to remain running for 30 seconds given 3 attempts, its restart interval has been backed off to 600 seconds

    Lots of

    terminated by calling exit with status '255'"

    Before the FastCGI install, any *.fcgi file would simply return its source code as plain text, so the server has picked up the fcgi extension. I have tried putting "AddHandler fastcgi-script .fcgi" in httpd.conf in the virtual host, but taht seemed to have no effect.
    Permissions on the *.fcgi files are set to execute for all, same as *.cgi files that all work fine.

    It would appear that something is not correct. Any help with this is greatly appreciated

    Note: I used DigitalN's install / config method above

  9. #9
    Registered Member
    Join Date
    Apr 2005
    Posts
    246

    Default

    Quote Originally Posted by DigitalN View Post
    Its now time to read
    docs/mod_fastcgi.html
    from within the mod_fastcgi-2.4.2 directory, to set it up how you want it.
    The problem with that guide is that there are no sample setups, no recommended setups, nothing. They expect someone non-geeky to read all the stuff in there and comprehend. Heck, I read through it all, and still don't understand what to do. I tried some things suggested there, but it croaks Apache. Any possibility of sharing what settings you have? I am looking for associating FastCGI with all my *.cgi stuff. So it is for Perl, not for Ruby.

Similar Threads

  1. What's better FastCGI+XCache or FastCGI|+EAccelator or FastCGI+MemCache?
    By rlshosting in forum Workarounds and Optimization
    Replies: 0
    Last Post: 09-06-2011, 10:07 PM
  2. configuring FastCGI
    By sehh in forum General Discussion
    Replies: 3
    Last Post: 09-29-2008, 09:17 AM
  3. FastCGI Installation -- Will It Survive After Upgrades?
    By orty in forum General Discussion
    Replies: 5
    Last Post: 02-13-2007, 01:24 AM
  4. FastCGI
    By dgitman in forum General Discussion
    Replies: 1
    Last Post: 08-24-2003, 02:37 PM
  5. FastCGI
    By Andy03 in forum General Discussion
    Replies: 1
    Last Post: 03-04-2003, 07:38 AM

Members who have read this thread: 2

bargain