Current time: 12-25-2024, 11:47 PM Hello There, Guest! (LoginRegister)


Post Reply 
Default fcgid configuration is wrong...
Author Message
kilburn Offline
Development Team
*****
Dev Team

Posts: 2,182
Joined: Feb 2007
Reputation: 34
Post: #5
RE: Default fcgid configuration is wrong...
Warning: This is the configuration I like to use in my servers, but there are no guarantees that they are going to work well in your case (you *have* to adjust the min/max processes to prevent too many php5-cgi processes eating all your server's ram). Additionally, this is only tested in Debian squeeze.

First of all, we have to edit the wrapper being called by mod_fcgid. At this aim, start by modifying the *users* wrapper template found in "/etc/ispcp/fcgi/parts/php5-fcgi-starter.tpl":
Code:
#!/bin/sh

umask 022

PHPRC="{PHP_STARTER_DIR}/{DMN_NAME}/php5/"
export PHPRC

TMPDIR="{WWW_DIR}/{DMN_NAME}/phptmp"
export TMPDIR

PHP_FCGI_CHILDREN=0
export PHP_FCGI_CHILDREN

PHP_FCGI_MAX_REQUEST=1000
export PHP_FCGI_MAX_REQUEST

exec {PHP5_FASTCGI_BIN}

Next, we also need to modify the *panel's* wrapper template, that is located in "/etc/ispcp/fcgi/parts/master/php5-fcgi-starter.tpl":
Code:
#!/bin/sh

umask 022

PHPRC="{PHP_STARTER_DIR}/{DMN_NAME}/php5/"
export PHPRC

PHP_FCGI_CHILDREN=0
export PHP_FCGI_CHILDREN

PHP_FCGI_MAX_REQUEST=1000
export PHP_FCGI_MAX_REQUEST

TMPDIR="{GUI_ROOT_DIR}/phptmp"
export TMPDIR

exec {PHP5_FASTCGI_BIN}

Now that the wrappers are properly configured, lets see the mod_fcgid specific settings. These are setup in the "/etc/apache2/mods-enabled/fcgid_ispcp.conf":
Code:
# ispCP ω (OMEGA) a Virtual Hosting Control Panel
# Copyright (C) 2006-2010 by isp Control Panel - http://ispcp.net
#
# Version: $Id: fcgid_ispcp.conf 3498 2010-10-20 06:17:13Z nuxwin $
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
# License for the specific language governing rights and limitations
# under the License.
#
# The Original Code is "ispCP ω (OMEGA) a Virtual Hosting Control Panel".
#
# The Initial Developer of the Original Code is ispCP Team.
# Portions created by Initial Developer are Copyright (C) 2006-2010 by
# isp Control Panel. All Rights Reserved.
#
# The ispCP ω Home Page is:
#
#    http://isp-control.net
#

<IfModule mod_fcgid.c>

  # MODULE SETUP: Do not change this unless you know what you're doing
  ########################################################################
  AddHandler fcgid-script .php .php5
  SocketPath /var/lib/apache2/fcgid/sock
  FcgidMaxRequestsPerProcess 1000
  FcgidPassHeader Authorization


  # ADMIN PREFERENCES: These control different limits as described below
  # Notice: These settings can be overwritten for a single website by
  # specifying them inside the website's custom configuration file:
  #     /etc/apache2/ispcp/website.tld.conf
  ########################################################################

  # Maximum request time in seconds (a script will be killed if it
  # runs for more time than that)
  FcgidBusyTimeout 300

  # Maximum time before the request generates some data (a script will be
  # killed if it doesn't generate any output before this number of seconds)
  FcgidIOTimeout 300

  # Maximum request lenght in bytes. No request larger than that will ever
  # be procedded, so this has to be higher than the biggest file upload you
  # want to allow.
  FcgidMaxRequestLen 104857600


  # PERFOMANCE SETTINGS: Used to limit the memory requirements
  ########################################################################

  # Maximum number of php5-cgi processes allow to run among all websites
  FcgidMaxProcesses 100

  # Maximum number of php5-cgi processes allowed to run for a single website
  FcgidMaxProcessesPerClass 10

  # Minimum number of php5-cgi processes running for each website. Only set
  # this to 1 or higher if your server has very few domains. Do not set it
  # higher if you have many domains, even if they are rarely accessed, or
  # you will eat up all of the server's RAM and force it to swap to death.
  FcgidMinProcessesPerClass 0

</IfModule>

Finally, you just need to regenerate the configuration files so that your changes to the templates are made effective.
(This post was last modified: 09-13-2011 04:17 PM by kilburn.)
09-13-2011 04:12 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Default fcgid configuration is wrong... - Nuxwin - 10-19-2010, 06:12 PM
RE: Default fcgid configuration is wrong... - kilburn - 09-13-2011 04:12 PM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)