Please enable JavaScript to view this site.

CloudLinux Documentation

Russian
English

Navigation: Installation > Installing on H-Sphere Server

Converting from mod_fastcgi to mod_fcgid

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 http://repo.cloudlinux.com/cloudlinux/sources/mod_fcgid-hsphere/fcgi.conf

 

Step 2:

 

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

######
LoadModule hostinglimits_module /hsphere/shared/apache2/modules/mod_hostinglimits.so

 
<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

 
</IfModule>
#######

 

Step 4:

 

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

 

       apache_version=2

       apache_mpm=prefork

       apache_fastcgi

       apache_fcgid

       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 http://apache.osuosl.org//httpd/mod_fcgid/mod_fcgid-2.3.9.tar.gz
$ 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/mod_fcgid.so /hsphere/shared/apache2/modules

Step 2:

 

Download and apply patch http://repo.cloudlinux.com/cloudlinux/sources/mod_fcgid-hsphere/usemodule.phpmode.patch to /hsphere/local/config/scripts/usemodule.phpmode:

$ wget http://repo.cloudlinux.com/cloudlinux/sources/mod_fcgid-hsphere/usemodule.phpmode.patch
$ 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 http://repo.cloudlinux.com/cloudlinux/sources/mod_fcgid-hsphere/httpd.conf.tmpl.patch to /hsphere/local/config/httpd2/httpd.conf.tmpl.custom:

$ wget http://repo.cloudlinux.com/cloudlinux/sources/mod_fcgid-hsphere/httpd.conf.tmpl.patch
$ patch --fuzz=3 /hsphere/local/config/httpd2/httpd.conf.tmpl.cusom  httpd.conf.tmpl.patch

Step 4:

 

Download pre-defined config file http://repo.cloudlinux.com/cloudlinux/sources/mod_fcgid-hsphere/fcgi.conf to /hsphere/local/config/httpd2:

$ wget -O /hsphere/local/config/httpd2/fcgi.conf http://repo.cloudlinux.com/cloudlinux/sources/mod_fcgid-hsphere/fcgi.conf

 

Step 5:

 

Download our wrapper file http://repo.cloudlinux.com/cloudlinux/sources/mod_fcgid-hsphere/php-wrapper into /hsphere/shared/php5/bin/ and make it executable:

$ wget -O /hsphere/shared/php5/bin/php-wrapper http://repo.cloudlinux.com/cloudlinux/sources/mod_fcgid-hsphere/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
</IfModule>

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

 

sshot-2013-07-30-21-25-48

 

Step 9:

 

Set PHP configuration to:

php_libphp5 enabled but not default
php_fastcgi5 enabled and is default

sshot-2013-07-30-21-31-05

 

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.