FCgi and subservers

I have migrated some sites from a Cpanel. They have been loaded as a main server and several subservers. Some sites are old and require php 5.6 so I have installed and am running php through FCgi so I can select the PHP version. That all seems to be working but… The subservers were migrated with their own user, different to the user for the main server. PHP for the subservers seems to be running as the user for the main server, this is causing file protection issues. How do I get PHP to run as the subserver user for each subserver? I hope that makes sense.

It’s probably just some config artifacts that came over during the migration. Check the Suexec config directives for those virtual hosts in the Apache config files (where they are depends on your distro/version, but either /etc/httpd or /etc/apache2).

Thanks. In the sites-available directory there is a conf file for each site. They all seem to have SuexecUserGroup set to the main domain user. So I guess I just need to change that for each domain?

Yes, should do the trick, just restart Apache after.

Would have forgotten the restart! That seems to have broken it completely. Now getting the dreaded mod_fcgid: error reading data from FastCGI server. Protection problem with something created when it was running as the main server owner maybe?

Oh, yeah, you’ll need to make sure all the files in public_html are owned by the domain owner user:group (and make sure their permissions aren’t too loose…e.g. 777 will never run under suexec).

Everything under public_html looks OK. I was thinking more on the php config side. Looking in the domains directory fcgi-bin and the files in that php5.6.fcgi and php7.2.fcgi are owned by the main server. Do they need changing to be the subserver owner?

And the php.ini files in domains/serverowner/etc

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.