Apache and PHP with fcgi on 10.04

Wipe_Out wipe_out at users.sourceforge.net
Mon Aug 8 21:54:20 UTC 2011


Jordon.. Have got it working.. Thanks for the input.. Going to start tuning
it to my needs now..

Can you clarify some things for me..

I am running mpm-itk and using it to execute php as the owner of the files
in the virtual server..

I understand that for each virtual server a new php process will be created
and will remain until the time out or the number of requests has been
filled..

Will more than one php process ever be created for a single virtual server?
If so how is this controlled?

If I wanted to use APC I would I need to restrict the number of processes
for a virtual server to 1 so that it doesn't chew up all the server memory
with a separate cache per process?

I have a virtual server with only 512MB ram hosting a couple of drupal sites
so APC would be useful but I need to make sure the fcgi processes don't
saturate the memory..

Thanks.

On 8 August 2011 09:11, Wipe_Out <wipe_out at users.sourceforge.net> wrote:

> Thanks Jordon.. I will give it a try..
>
>
> On 8 August 2011 00:10, Jordon Bedwell <jordon at envygeeks.com> wrote:
>
>> Snippet from Wipe_Out On 07/08/11 14:13:
>> > Any help converting from what I have setup to an fcgi setup would be
>> appreciated..
>>
>> I'm only going to show you how to do barebones, this will get you up and
>> running but this isn't secure at all without some sort of real ACL and
>> suexec, but then again, I don't remember the last time one of my clients
>> put up an ACL before I was there o.O most of them think suexec is good
>> enough.  Anyways suexec is easy enough to install and configure so I'll
>> just give you the basics:
>>
>> ---
>>
>> sudo apt-get install php5-cgi \
>> apache2 \
>> libapache2-mod-fcgid \
>> apache2-mpm-itk --no-install-recommends
>>
>> ---
>>
>> sudo vim /etc/apache2/fcgi.bash
>> Contents:
>>
>> #!/bin/sh
>>
>> # The basics
>> export PHPRC=/etc/php5/cgi/
>> export PHP_FCGI_CHILDREN=3
>> export PHP_FCGI_MAX_REQUESTS=5000
>>
>> # Time for the fun
>> exec /usr/lib/cgi-bin/php5
>>
>> ---
>>
>> sudo chmod a+x /etc/apache2/fcgi.bash
>>
>> ---
>>
>> sudo a2dismod authn_file \
>> authz_default \
>> authz_groupfile \
>> authz_user \
>> autoindex \
>> cgi \
>> status \
>> auth_basic \
>> authz_user
>>
>> ---
>>
>> sudo echo "AddHandler fcgid-script .php" >> \
>> /etc/apache2/mods-available/fcgid.conf
>>
>> ---
>>
>> sudo echo "FCGIWrapper /etc/apache2/fcgi.bash .php" >> \
>> /etc/apache2/mods-available/fcgid.conf
>>
>> ---
>>
>> I love Apache and live by Debian, but, it's disgusting that they think
>> it's alright to violate FHS and Debian supports it because Apache
>> foundation does and they don't want to "alienate" users. While one could
>> argue against /srv/www it's well within FHS.
>>
>> sudo rm -rf /var/www
>> mkdir -p /srv/www
>>
>> ---
>>
>> sudo vim /etc/apache2/sites-available/default
>> Contents:
>>
>> <VirtualHost *:80>
>>        ServerAdmin webmaster at localhost
>>
>>        DocumentRoot /srv/www
>>
>>        <Directory /srv/www/>
>>                Options -Indexes +FollowSymLinks -MultiViews +ExecCGI
>>                AllowOverride None
>>                Order allow,deny
>>                allow from all
>>        </Directory>
>>
>>        LogLevel warn
>>        ErrorLog ${APACHE_LOG_DIR}/error.log
>>        CustomLog ${APACHE_LOG_DIR}/access.log combined
>> </VirtualHost>
>>
>> ---
>>
>> echo "<?php phpinfo();" > /srv/www/index.php
>>
>> ---
>>
>> chown www-data:www-data /srv/www/index.php
>>
>> ---
>>
>> sudo service apache2 restart
>>
>> ---
>>
>> firefox http://localhost
>>
>> ---
>>
>> Oh hai, how are you today FCGI and PHP? Nice to see you...
>>
>> --
>> ubuntu-users mailing list
>> ubuntu-users at lists.ubuntu.com
>> Modify settings or unsubscribe at:
>> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20110808/feb64e32/attachment.html>


More information about the ubuntu-users mailing list