FastCGI

Configuration

Configuration Apache 2.4

Packages to install

  • apache2
  • libapache2-mod-fcgid

Steps to do as root

  1. Install software
    1. on Debian
      $ apt-get install apache2 libapache2-mod-fcgid
  2. Enable module
    1. on Debian
      $ a2enmod fcgid
  3. Update configuration (i.e /etc/apache2/sites-enabled/000-default.conf)
    1. For normal usage (Application ends with fcgi)
         Alias /cgi/ <folder>/
         <Directory <folder>/>
              SetHandler fcgid-script
              Options +ExecCGI
              # Customize the next two directives for your requirements.
              Order allow,deny
              Allow from all
          </Directory>
    2. Replace html and ico 
      You need an index.html file in this directory to get it to work
          <Directory <default_dir>/>
             AddHandler fcgid-script .html .ico
             FCGIWrapper <app folder>/<app>.fcgi .html virtual
             FCGIWrapper <app folder>/<app>.fcgi .ico virtual
             Options +ExecCGI
      
             # Customize the next two directives for your requirements.
             Order allow,deny
             Allow from all
         </Directory>
  4. Restart server
    $ /etc/init.d/apache2 restart

Configuration Lighttpd

Package to install

  • lighttpd

Steps to do as root

  1. Install software
    1. On Debian
      $ apt-get install lighttpd
  2. Enable module
    1. on Debian
      $ lighttpd-enable-mod fastcgi ssl
  3. Update configuration lighttpd.conf
    1. For normal usage (Application ends with fcgi)
      fastcgi.debug = 1    # for debugging
      fastcgi.server = (
          ".fcgi" => (
              "<app>.fcgi.handler" => (
                  "socket" => "/tmp/<app>.fcgi.socket",
                  "check-local" => "disable",
                  "bin-path" => "/<app folder>/<app>.fcgi",
                  "max-procs" => 1,
              )
          )
      )
    2. Replace html and ico
      fastcgi.server = (
         ".ico" => (
             "<app>.fcgi.handler" => (
                  "socket" => "/tmp/<ico>.socket",
                  "check-local" => "disable",
                  "bin-path" => "/<app folder>/<app>.fcgi",
                  "max-procs" => 1,
             )
         ),
         ".html" => (
             "<app>.fcgi.handler" => (
                  "socket" => "/tmp/<html>.socket",
                  "check-local" => "disable",
                  "bin-path" => "/<app folder>/<app>.fcgi",
                  "max-procs" => 1,
             )
         )
      )
  4. Restart server
    $ /etc/init.d/lighttpd restart

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.