Skip to content

Commit

Permalink
Item13883: Clean up some old stale links in FastCGIEngine
Browse files Browse the repository at this point in the history
Also explain a bit more on customizing the init scripts.
  • Loading branch information
gac410 committed Dec 8, 2017
1 parent a7cc567 commit 57c3179
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions FastCGIEngineContrib/data/System/FastCGIEngineContrib.txt
Expand Up @@ -51,7 +51,7 @@ See SystemRequirements (Foswiki:System.SystemRequirements) for a detailed requir
</noautolink>
---+++ Apache

---++++ Apache Module
---++++!! Apache Module

There are two options that basicly do the same thing

Expand All @@ -66,10 +66,7 @@ mod_fcgid resources
* Sources - http://httpd.apache.org/mod_fcgid/
* Debian - http://packages.debian.org/search?searchon=names&keywords=libapache2-mod-fcgid

mod_fastcgi resources
* !RedHat/Centos - http://rugmonster.org/2009/03/building-mod_fastcgi-on-rhel5/ and http://www.nagare.org/trac/blog/apache_mod_fastcgi

---++++ Apache Configuration
---++++!! Apache Configuration

<div class="foswikiHelp">
%X% It is strongly recommended that users work from
Expand Down Expand Up @@ -128,7 +125,7 @@ In contrast to Apache or Lighttpd, Nginx does not control the life time of the =
have to start it yourself using the system's init process. The FCGI::ProcManager class will then take care of (re-)spawning
enough child processes as required.

First, let's configure nginx to contact a =foswiki.fcgi= process on some socket on the localhost:
---++++!! Configure nginx to contact a =foswiki.fcgi= process on some socket on the localhost:

<div class="foswikiHelp">
Edit the file system paths (=/var/www/foswiki=, =/var/log/nginx=) below as appropriate for your system. This configuration
Expand Down Expand Up @@ -185,11 +182,12 @@ server {
}
</pre>

Next, to integrate the =foswiki.fgi= process into the system's init process use the two helper scripts in the =tools= directory:
---++++!! Add the =foswiki.fcgi= process into the system init.
Integrate the =foswiki.fgi= process into the system's init process use the two helper scripts in the =tools= directory:

* Conventional init scripts (Should also work with systemd)
* =tools/foswiki.init-script=: copy this to =/etc/init.d/foswiki=; make the file executable using =chmod +x /etc/init.d/foswiki=, and ensure that it is assigned to user/group root.
* =tools/foswiki.defaults=: copy this to =/etc/default/foswiki= and make appropriate adjustmenst;
* =tools/foswiki.defaults=: copy this to =/etc/default/foswiki= and make appropriate adjustments;
* make sure the process uses the same socket as configured in nginx (see above, defaults to =127.0.0.1:9000=)
* verify that the =FOSWIKI_ROOT= setting points to your foswiki installation.

Expand All @@ -213,6 +211,19 @@ You should now be able to control the backend processes using either:

Finally, add the service to the runlevels using =update-rc.d foswiki defaults= to make sure the service is started on system startup time.

---+++++!! Customizing the fcgi process

* Changing the name of the process / init script
* Copy =/etc/init.d/foswiki=, =/etc/defaults/foswiki= and if used, =/etc/systemd/system/foswiki.service=, to a new name (ex. myfoswiki)
* Edit the init script to use the new name internally. (The =foswiki.service= file would need similar changes not detailed here.) <verbatim>
# Provides: myfoswiki
# Short-Description: Start the myfoswiki backend server.
NAME=myfoswiki <== Should match script name
# The following defaults are overridden in etc/default/foswiki
FOSWIKI_PNAME=myfoswiki <== Process name displayed in =ps aux=
</verbatim>
* Make sure the new instance is using a unique =fastcgi_pass= and matching =FOSWIKI_BIND=

---++ Tuning

Except from Apache configured using only =.htaccess= file, it's possible to adjust the number of !FastCGI processes. There is no _magic number_: it depends on some variables, like the hardware resources and access load. If you set this number too low, users may experience high latencies and you'll not use all hardware potential, on the other hand if this setting is adjusted too high then the server can be forced to use swap, what degrades performance a lot.
Expand Down

0 comments on commit 57c3179

Please sign in to comment.