mod_cgi not found when mod_cgid is use

I'm running CentOS7, latest of all the things, including running PHP7(remi repository) as primary, and attempting to run 7, 5.6 as possibilities. I'm currently trying to figure out why some sites just attempt to download PHP to the client, while most(under FPM), work fine. Problem is, with a (mostly) working setup, if re-check configuration, Vmin complains "The Apache module mod_cgi is either not installed or not enabled." and immediately stops the config with "your system is not ready for use by Virtualmin." I'm using mpm_event so I'm aware that mod_cgi wouldn't be in use - mod_cgid would be. I see some checks in the code for cgid, so I'd assume it should "just work", but I'm seeing this isn't the case.

Status: 
Closed (fixed)

Comments

Howdy -- Jamie may need to chime in about the mod_cgi vs mod_cgid notices you're receiving in the config check, though I suspect that's not the cause of the issue you're seeing.

Regarding the downloaded files -- you may be seeing a config issue with those PHP packages... they may be adding a SetHandler line that's causing the trouble there.

What is the output of this command:

find /etc/httpd -type f | xargs grep -i sethander

find /etc/httpd -type f | xargs grep -i sethandler(sethandler vs sethander :)
Gives me a mixture of: SetHandler proxy:fcgi://localhost:xxxx in httpd.conf SetHandler application/x-httpd-php in php.conf

There's a bug that can cause this false warning, which we'll fix. You can basically ignore it for now.

Jamie any workaround I can do for now? It stops the reconfigure wizard from progressing.

I have this same issue.Is there a way to get a littel more detail on applying this patch.

Thanks

Basically, just create the the file /usr/libexec/webmin/apache/mod_cgid.pl containing the contents from the patch.

atleast's picture
Submitted by atleast on Wed, 02/21/2018 - 19:57

Dear JamieCameron Thanks a lot for your great help. You are so nice, benevolent and great soul. Each time I work with Virtualmin webmin I think of you and send you best wishes and blessings. May you and your good team always prosper and be content. What shall I do without your incredible support.

I have a same problem. Can you tell me how to fix this in Ubuntu?

@Rolcsi On Ubuntu it's located at /usr/share/webmin/apache/mod_cgid.pl

However I'm still getting this error and that file is already there when I checked so I'm not too sure what's up just yet.

Ubuntu Linux 16.04.3
Webmin version 1.881
Usermin version 1.734
Virtualmin version 6.02-3

If you have that file and you're still seeing this error, login via SSH as root and run :

rm /etc/webmin/apache/site
virtualmin check-config

Thank you! Unfortunately I'm still seeing this after running that:

ERROR: The Apache module mod_cgi is either not installed or not enabled.

Everything seems to be working ok though from what I can see. There are only 2 virtual servers and both are using FCGId.

rrhode - which Virtualmin version are you running?

It's an Amazon EC2 micro instance.
Kernel and CPU: Linux 4.4.0-1052-aws on x86_64
Ubuntu Linux: 16.04.3
Webmin version: 1.881
Usermin version: 1.734
Theme version: Authentic Theme 19.09.2
Virtualmin version: 6.02-3

In case it lends any hope to resolving this for others - I solved this(for me) two ways. First one was I reloaded my server (ok, ok, not really a resolution.).
I just came across this recently getting another CentOS box up and running. While comparing webmin code and httpd configs between two servers, I found httpd.lock in /etc/httpd/conf/. the pid in the file no longer existed. I removed the lock file, restarted httpd, which pointed me to an error in the conf file, re-ran "virtualmin check-config" and I was up and running again. Not sure if it helps anyone, and if the lock file is created by virtualmin setup, it might be a good thing to alert to it's existence or remove it if the pid is dead.

For me the solution was simple: 1) go to Virtualmin 2) servers 3) Apache 4) global configuration 5) configure apache modules 6) enable "CGI"