Converting from mod_fastcgi to mod_fcgid

Navigation:  Installation > Installing on H-Sphere Server >

Converting from mod_fastcgi to mod_fcgid

Previous pageReturn to chapter overviewNext page

To achieve the best results in productivity and stability we recommend converting from mod_fastcgi to mod_fcgid.


[H-Sphere 3.6.3+]


Step 1:


Download our fcgi.conf file:


$ wget -O /hsphere/local/config/httpd2/fcgi.conf 


Step 2:


Edit ~httpd2/conf/extra/httpd-hostinglimits.conf to the following state:


LoadModule hostinglimits_module /hsphere/shared/apache2/modules/
<IfModule mod_hostinglimits.c>
SkipErrors Off
AllowedHandlers cgi-script %php% fcgid-script application/x-miva-compiled
DenyHandlers hs-php5-script hs-php53-script hs-php54-script
Include /hsphere/local/config/httpd2/fcgi.conf


Step 4:


Go to P.Servers > web server [Config] and be sure to have enabled:






PHP version/mode: php_fastcgi*


* No changes needed to httpd.conf.tmpl.custom or usermodule.phpmode as this version provides its own mod_fcgid.



[Older Versions of H-Sphere]


Step 1:


Compile mod_fcgid module:


$ yum install gcc liblve-devel zlib-devel openssl-devel 
$ wget
$ tar zxvf mod_fcgid-2.3.9.tar.gz
$ cd mod_fcgid-2.3.9/
$ APXS=/hsphere/shared/apache2/bin/apxs ./configure.apxs 
$ make
$ mv modules/fcgid/.libs/ /hsphere/shared/apache2/modules


Step 2:


Download and apply patch to /hsphere/local/config/scripts/usemodule.phpmode:


$ wget 
$ patch /hsphere/local/config/scripts/usemodule.phpmode usemodule.phpmode.patch


Step 3:


If /hsphere/local/config/httpd2/httpd.conf.tmpl.custom does not exists - create it:


$ cp -rp /hsphere/local/config/httpd2/httpd.conf.tmpl /hsphere/local/config/httpd2/httpd.conf.tmpl.custom


Download and apply patch to /hsphere/local/config/httpd2/httpd.conf.tmpl.custom:


$ wget 
$ patch --fuzz=3 /hsphere/local/config/httpd2/httpd.conf.tmpl.cusom  httpd.conf.tmpl.patch


Step 4:


Download pre-defined config file to /hsphere/local/config/httpd2:


$ wget -O /hsphere/local/config/httpd2/fcgi.conf        


Step 5:


Download our wrapper file into /hsphere/shared/php5/bin/ and make it executable:


$ wget -O /hsphere/shared/php5/bin/php-wrapper
$ chmod 755 /hsphere/shared/php5/bin/php-wrapper


Step 6:


Change permissions for /hsphere/local/home to 755:


$ chmod 755 /hsphere/local/home


Step 7:


Edit ~httpd2/conf/extra/httpd-hostinglimits.conf and add DenyHandlers, so section will look like:


<IfModule mod_hostinglimits.c>
SkipErrors Off
AllowedHandlers cgi-script %php% fcgid-script application/x-miva-compiled
DenyHandlers hs-php5-script hs-php53-script hs-php54-script 


Step 8:


Configure physical server from H-Sphere admin > E.Manager > P.Servers > server_name [parameters] icon, settings should be:


apache_version = 2
apacha_fastcgi = yes
apache_status = yes




Step 9:


Set PHP configuration to:


php_libphp5 enabled but not default
php_fastcgi5 enabled and is default




Other options could be configured according to personal needs.

When done - click SUBMIT to apply changes.


Note. After updating H-Sphere software on web server with CloudLinux you need to re-apply step 2 (patch usemodule.phpmode) and restart apache with /hsphere/shared/scripts/apache-restart script.