Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3332022
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:38:39+00:00 2026-05-17T23:38:39+00:00

I have a website where each webpage is compiled into a binary (I have

  • 0

I have a website where each webpage is compiled into a binary (I have 100 webpages, therefore I have 100 binaries). Apache’s .htaccess contains the line “SetHandler cgi-script” which instructs apache to use CGI when a binary (webpage) is requested.

How can I modify this website to use FastCGI instead of CGI ?

Do I just have to include this header and use this while loop (FastCGI.com) in each of the 100 binaries and modify .htaccess to “SetHandler fastcgi-script” ?

#include "fcgi_stdio.h" // instead of stdio.h  
while(FCGI_Accept() >= 0)  

So how will FastCGI work exactly ? Apache will dispatch webpages using 1 persistent process for the entire website or will there be 1 persistent process for each of the 100 binaries ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T23:38:40+00:00Added an answer on May 17, 2026 at 11:38 pm

    A FastCGI script is a network server that listens for connections in a loop. The web server forward requests to the FCGI server which sends back some dynamically generated content – all over a socket connection. Thus a FCGI script is faster than CGI as it is not re-spawned for each request.

    I don’t understand why you need 100 binaries for 100 pages. A single script is enough to generate content for 100 pages, based on some request parameter. The FCGI server should also scale pretty well for multiple connections as it is usually made to poll on the socket file descriptor. (Look at the code of the implementation to make sure of this).

    To generate 100 pages you don’t necessarily need 100 if statements. Consider this pseudo-code:

    hash_table page_generators; // map page types to function objects (or function pointers)
    page_generators["login_page"] = handle_login_page_fn; 
    page_generators["contact_page"] = handle_contact_page_fn; 
    // ... and so on
    
    // request handler
    page_type = request.get("page_type");
    fn = page_generators[page_type];
    if (fn == NULL)
        return "<html><body>Invalid request</body></html>";
    else
        return fn(request);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a website laid out in tables. (a long mortgage form) in each
We have a website that uses #include file command to roll info into some
I have an ASP.NET website set up using Windows authentication. Each time I open
I have a php function which inserts a searchbar into each page on a
Currently I'm running several websites that have several (branded) duplicates each, in the same
I have a website that plays mp3s in a flash player. If a user
I have a website that I've just uploaded onto the Internet. When I browse
I have a website that is perfectely centered aligned. The CSS code works fine.
I have some website which requires a logon and shows sensitive information. The person
I have a Website that is really slow and feels really bad when using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.