Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 2 > Installation/Configuration

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #11  
Old 28th June 2006, 23:01
tosser tosser is offline
Junior Member
 
Join Date: May 2006
Posts: 17
Thanks: 0
Thanked 3 Times in 3 Posts
Default

yes, you need only suexec.
Reply With Quote
Sponsored Links
  #12  
Old 19th April 2007, 20:09
meemu meemu is offline
Member
 
Join Date: Apr 2007
Posts: 39
Thanks: 2
Thanked 8 Times in 5 Posts
Default now sadly outdated

Not quite sure why this is but it looks this is outdated now. The current (non-free) libapache2-mod-fastcgi depends on apache2.2-common. This should break the self-compiled suexec-fcgi.

I notice that current debian packages of php4/5-cgi are fcgi enabled. Why not use those instead of compiling your own?

Has anyone tried mod_fcgid instead of fastcgi? It's looking good (debian package and all that) but I cna't configure it like your example for fastcgi...

I'll keep exploring but would appreciate any help!
Reply With Quote
  #13  
Old 20th April 2007, 13:33
meemu meemu is offline
Member
 
Join Date: Apr 2007
Posts: 39
Thanks: 2
Thanked 8 Times in 5 Posts
Default blame it on debian

Just found out that this is because debian have switched stable to etch. I'll try with the newer versions of the packages.
Reply With Quote
  #14  
Old 30th November 2008, 21:16
Whitenoise Whitenoise is offline
Junior Member
 
Join Date: Nov 2008
Posts: 9
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Hi,

great tutorial, thx.

Unfortunately the patch does not work with the latest ISPC release.

I would also suggest to:

Quote:
chattr +i php-fcgi-starter
to prevent any modifies to the file attributes of the file and its content.
Reply With Quote
  #15  
Old 18th January 2009, 14:41
Melchior Melchior is offline
Junior Member
 
Join Date: Jul 2007
Location: Germany, Darmstadt
Posts: 25
Thanks: 5
Thanked 1 Time in 1 Post
 
Default

Hi,

for all those preferring to use FastCgi I want to supply my little tweaked version of this great post (thx Tosser).

Also if you've got problems to execute the outdated patch this could help you.

The following instructions are only about patching ISPConfig to support FastCgi.

I added

- support that every Vhost will automatically gets copied his own php.ini file into webroot directory.
- new var directory to Vhost that contains sessions and uploaded_tmp files

Please note:

- use on own risk
- only apache2 support (you can easily add apache1)
- only FASTCGI-Support (can't be switched)
- You've to controll the config.lib.php and make your custom changes (CHOWN: Webserver-User, CHMOD: your rights!)
- If you want to regenerate the .php.ini // .php-fcgi-starter // var folder - just delete them and run a vhost change.


here we go:

1. open config.lib.php

2. find "if($web["web_php"]){"

3. delete this complete if condition including bracket content { ... }

4. and inner in this exact place this:
Code:
   // FIXED TO SUPPORT FASTCGI
    if($web["web_php"]){
    	$php = '';
        $php = "ScriptAlias /php/ ".$mod->system->server_conf["server_path_httpd_root"]."/"."web".$web["doc_id"]."/\n";
    
     	$fcgip = $mod->system->server_conf["server_path_httpd_root"]."/"."web".$web["doc_id"];
     	
     	// COPY /var/www/webX/.php-fcgi-starter AND fill in right webId
     	$fgiFile = $fcgip."/.php-fcgi-starter";
		if(!file_exists($fgiFile)) {
			exec("cp -p /root/ispconfig/scripts/php-fcgi-starter $fgiFile && chown root:root $fgiFile");
			$contentCgiFile = $mod->file->rf($fgiFile);
      		$contentCgiFile = str_replace("{WEB_ID}", "web".$web["doc_id"], $contentCgiFile);
    		$mod->file->wf($fgiFile, $contentCgiFile);
		}
		
		// COPY /etc/php5/ispconfig_fastcgi_default/php.ini TO /var/www/webX/.php.ini AND fill in right webId
		$phpIniFile = $fcgip."/.php.ini";
		if(!file_exists($phpIniFile)) {
			exec("cp -p /etc/php5/ispconfig_fastcgi_default/php.ini $phpIniFile && chown root:root $phpIniFile");
			$contentPhpIniFile = $mod->file->rf($phpIniFile);
      		$contentPhpIniFile = str_replace("{WEB_ID}", "web".$web["doc_id"], $contentPhpIniFile);
    		$mod->file->wf($phpIniFile, $contentPhpIniFile);
		}
		
    	if(!is_dir("$fcgip/var/uploads_tmp")) {
			exec("mkdir -p $fcgip/var/uploads_tmp");
		}
		
    	if(!is_dir("$fcgip/var/sessions")) {
			exec("mkdir -p $fcgip/var/sessions");
		}
		
		exec("chown -R webserv:web".$web["doc_id"]." $fcgip/var");
		exec("chmod -R 775 $fcgip/var");
		
		// "/var/www/{WEB_ID}/var/uploads_tmp/"
		// var/www/{WEB_ID}/var/sessions"
		
    	if($go_info["server"]["apache2_php"] == 'addtype' or $go_info["server"]["apache2_php"] == 'both') {
			$php .= "AddType application/x-httpd-php .php .php3 .php4 .php5\n";
		}
    } else {
      $php = "";
    }
5. in /root/ispconfig/scripts/ create or replace php-fcgi-starter with chmod 755 (!) this (new) content

#!/bin/sh
PHPRC="/var/www/{WEB_ID}/.php.ini"
export PHPRC
PHP_FCGI_CHILDREN=1
export PHP_FCGI_CHILDREN
exec /usr/lib/cgi-bin/php5


6. create /etc/php5/ispconfig_fastcgi_default and place in here php.ini with this sample config (if you want)
Code:
;;;;;;;;;;;;;;;;;;; PHP INI FOR {WEB_ID} ;;;;;;;;;;;;;;;;;;;

error_reporting = E_ALL & ~E_NOTICE
display_errors = On
display_startup_errors = On
log_errors = On
log_errors_max_len = 1024
error_log = /var/www/{WEB_ID}/log/phperrors.log

ignore_repeated_errors = Off
ignore_repeated_source = Off

report_memleaks = On

register_globals = Off
register_long_arrays = On
magic_quotes_gpc = Off
magic_quotes_runtime = Off

default_mimetype = "text/html"
default_charset = "utf-8"

post_max_size = 50M
file_uploads = On
upload_tmp_dir = "/var/www/{WEB_ID}/var/uploads_tmp/"
upload_max_filesize = 60M
max_execution_time = 600    ; Maximum execution time of each script, in seconds (30)
max_input_time = 600		; Maximum amount of time each script may spend parsing request data (60)
memory_limit = 60M      	; Maximum amount of memory a script may consume (8MB)

session.auto_start 0
session.save_path = "/var/www/{WEB_ID}/var/sessions"
session.use_cookies = 1
session.name = PHPSESSID_{WEB_ID}
session.cookie_lifetime = 0


;;;;;;;;;;;;;;;;;;; APPENDIX, SELECT IF WANTED ;;;;;;;;;;;;;;;;;;;

;error_log = filename
;error_log = syslog

;date.timezone = 
;iconv.input_encoding = "utf-8"
;iconv.internal_encoding = "utf-8"
;iconv.output_encoding = "utf-8"

; NOT WORKING WITH FASTCGI AFAIK
;session.gc_maxlifetime = 5
;session.gc_probability = 1
;session.gc_divisor = 1000

;session.cookie_path = /
;session.cookie_domain =
;session.cache_limiter = nocache
;session.cache_expire = 180
;safe_mode = Off
;safe_mode_gid = Off
;safe_mode_include_dir =
;safe_mode_exec_dir =
;safe_mode_allowed_env_vars = PHP_
;safe_mode_protected_env_vars = LD_LIBRARY_PATH
;open_basedir =

;extension=apc.so
;apc.mode = on
;apc.rfc1867 = on
;apc.max_file_size = 128M
;apc.enabled=1
;apc.shm_segments=1
;apc.shm_size=128
;apc.ttl=7200
;apc.user_ttl=7200
;apc.num_files_hint=1024
;apc.mmap_file_mask=/tmp/apc.XXXXXX
;apc.enable_cli=1
Done.


Hope it works for you!

regards,
Melchior

Last edited by Melchior; 18th January 2009 at 14:45.
Reply With Quote
The Following User Says Thank You to Melchior For This Useful Post:
falko (19th January 2009)
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Fastcgi support till Developers' Forum 0 7th May 2006 19:36


All times are GMT +2. The time now is 14:28.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.