How to increase fcgi timeout?


I have a problem with mod_fcgid: read data timeout in 31 seconds.
I went to server configuration and changed php script time to 100, only to find out that I have to change fcgi time out. I was looking around and couldnt find it.
I found the following link where I think I found a solution to my problem.

But this is for plesk which uses nginx+apache, also i found on another forum that depending on you fcgi version you have to use different settings.

I use Ubuntu 12.04

Where do I enter this settings?
Any help would be appreciated.

Since you’re using mod_fcgi, each virtual server has its own PHP config file. You can edit it by selecting the server and then at “Services -> PHP5 configuration -> Resource limits”. Make sure the screen shows a config file name like /home/DOMAIN/etc/php5/php.ini. An Apache restart might be required after making changes.

I am interested in this settings:

IdleTimeout 3600

ProcessLifeTime 7200

MaxProcessCount 64

DefaultMaxClassProcessCount 8

IPCConnectTimeout 300

IPCCommTimeout 7200

BusyTimeout 300

I thought that I have to find fcgid.conf configuration.
I have increased PHP time out in server configuration
website options
maximum php script run time

Those are global Apache settings for mod_fcgi that you can put in the file /etc/apache2/mods-available/fcgid.conf