![]() |
fastcgi and php on Debian etch walkthrough
Debian 4.0 etch is the new stable distribution. Noteably, Debian has switched to version 2.2 of apache2. The following walkthrough shows how to setup php running inside the fastcgi apache2 module on this new Debian release.
This walkthrough is based on http://www.howtoforge.com/forums/showthread.php?t=4606 with the following exceptions:
For simplicity's sake, this is all done as root. Usually, Debian people recommend using a normal unprivileged account for compiling things and getting package sources.
Code:
apt-get install apache2.2-common apache2-threaded-dev apache2-mpm-worker
Code:
cd supportCode:
/* no file owner check
Code:
make suexecCode:
stat /usr/local/lib/apache2/suexec-fcgi
The libapache2-mod-fastcgi package is in the non-free section of the Debian repositories. If it's not there yet change your entry in /etc/apt/sources.list from Code:
deb http://ftp.uk.debian.org/debian/ stable mainCode:
deb http://ftp.uk.debian.org/debian/ stable main non-free contribThen install fastcgi Code:
apt-get install libapache2-mod-fastcgiCode:
a2enmod fastcgiNow to the configuration of mod_fastcgi. The following allows us to keep the php-fastcgi-starter outside of what the user can access or modify. Code:
# /etc/apache2/mods-enabled/fastcgi.conf
Code:
apt-get install php4-cgi php5-cgi php4-mysql php5-mysqlCode:
cgi.fix_pathinfo=1Create the php-fastcgi starter script (at this point worth mentioning that ISPConfig should already be installed) Code:
/root/ispconfig/scripts/php-fcgi-starterCode:
chown root.root /root/ispconfig/scripts/php-fcgi-starterApply this patch to /root/ispconfig/scripts/lib/config.lib.php Code:
1119c1119Code:
mkdir /var/www/php-fastcgi
For new web sites ISPConfig will create this structure /var/www/--+/webX/ <- normal content, user has full access /var/www/--+/php-fastcgi/webX/php-fastcgi-starter |
Thank you for the howto. I moved it to the tipps & tricks forum. I will try to implement your patch in the ISPConfig dev branch as php configuration option.
|
Do you think you can create a tutorial and submit it? http://www.howtoforge.com/add_howto
That would be great! :) |
Quote:
I'm currently working on fastcgi packages ( php-binary & httpd_module ) for CentOS 4.4 (As I can't find any pre-build packages, you lucky debian people ! :p ), but I haven't yet figured how to config it properly, this could save me a whole load of hassle :) EDIT: Found Mod_fastcgi.rpm on this blokes website: http://www.city-fan.org/ftp/contrib/websrv/ I've built a php-fcgi binary avilable here: http://www.linickx.com/files/rpm/whi...2.4.1.i386.rpm Code:
[root@www tmp]# /usr/bin/php-fcgi -v |
Why
Why use fastcgi instead PHP module?
Faster? Better security? Regards, Taguapire |
fastcgi is not faster the mod_php, but it allows to run php under the admin user of the websites instead of the apache user.
|
like suphp, except apc ,eaccelerator and xcache appear to support fast-cgi .
redhat-like users might be interested in reading this php bug before using fast-cgi tho. |
would this be the solution to allow my users who use fastcgi to kill their own processes? sometimes I am required to killall -9 dispatch.fcgi because they make some bigger changes in their scripts...
also I'd like to ask a question about the settings of fastcgi: I am trying to use these config options: Quote:
BUT if I set a limit for the first one, this does not work out for me as my different instances all have the same name: dispatch.fcgi so if I set option#1 to 2 because I want each "scritp" running max. 2 times in parallel I won't be able to have more than 2 dispatch.fcgi in total on my system... Is there a workaround or did I udnerstand thsi wrong? |
did you do ?
Code:
cd apache2-2.2.3/Code:
apt-get install apache2.2-common apache2-threaded-dev apache2-mpm-worker |
apt-get source apache2.2-common
Quote:
Quote:
Quote:
|
| All times are GMT +2. The time now is 01:00. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.