Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
mod_fcgid-2.1-r1, suexec, php and apache-2.2
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
kaktuspalme
n00b
n00b


Joined: 23 Apr 2006
Posts: 29

PostPosted: Fri Jun 01, 2007 9:58 pm    Post subject: mod_fcgid-2.1-r1, suexec, php and apache-2.2 Reply with quote

Hi, im searching and searching and searching... :D
I didn't find anything how to configure mod_fcgid with apache 2.2 and php and suexec, can anyone help me? Or can anyone post a sample config with the actual mod_fcgid-2.1-r1? I would like to make a tutorial if it works.
At the moment mod_fcgid with apache 2.2 and php works, but without a php.ini per vhost.


Sorry for this bad post, but on my systems its 12 o' clock at the moment :)
Sorry for my bad Englisch.
Back to top
View user's profile Send private message
nativemad
Developer
Developer


Joined: 30 Aug 2004
Posts: 918
Location: Switzerland

PostPosted: Sat Jun 09, 2007 10:11 am    Post subject: Reply with quote

Ok, assuming you have www.vhost.com, your user is called vhostuser and is in the Group web-group. The Doc-root starts at /var/www/www.vhost.com/root/public_html/ in this sample.
This goes additionaly in the vhost apache conf:
Code:
DocumentRoot /var/www/www.vhost.com/root/public_html
SuexecUserGroup vhost-user web-group

<Directory "/var/www/www.vhost.com/root/public_html/>
AddHandler fcgid-script .php
Options ExecCGI FollowSymLinks
allow from all
FCGIWrapper /var/www/www.vhost.com/cgi-bin/php .php
</Directory>

This is in /var/www/ww.vhost.com/cgi-bin/php:
Code:

#!/bin/sh
PHPRC="/var/www/www.vhost.com/"
export PHPRC
PHP_FCGI_CHILDREN=8
export PHP_FCGI_CHILDREN
PHP_FCGI_MAX_REQUESTS=5000
export PHP_FCGI_MAX_REQUESTS
exec /usr/bin/php5-cgi  #Here you can also switch to php4

The php.ini can be placed at /var/www/www.vhost.com/php.ini
and /etc/apache2/modules.d/20_mod_fcgid.conf looks like this:
Code:

<IfDefine FCGID>
    <IfModule !mod_fcgid.c>
        LoadModule fcgid_module modules/mod_fcgid.so
    </IfModule>
    <IfModule mod_fcgid.c>
        AddHandler fcgid-script .fcg
IdleTimeout 1200
  ProcessLifeTime 3600
  IPCConnectTimeout 1200
    IPCCommTimeout 900
    </IfModule>
</IfDefine>


Hopefully this gives you an idea of how it can be done... :wink:
Back to top
View user's profile Send private message
kaktuspalme
n00b
n00b


Joined: 23 Apr 2006
Posts: 29

PostPosted: Wed Jun 13, 2007 10:02 am    Post subject: Reply with quote

Really Really thanks, i will try it today and post if its work.
Back to top
View user's profile Send private message
nativemad
Developer
Developer


Joined: 30 Aug 2004
Posts: 918
Location: Switzerland

PostPosted: Wed Jul 04, 2007 2:55 pm    Post subject: Reply with quote

did it work for you? Or can i help further?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum