Virtualmin mod_fcgi documentation?

16 posts / 0 new
Last post
#1 Fri, 08/22/2008 - 11:50

Virtualmin mod_fcgi documentation?

Hi folks, newbie here.

Just purchased a 10 server license and I am trying to conf mod_fcgi.

Debian 4.0, Webmin and Virtualmin are all updated as of today.

php-cgi is installed, as is apache2-mod-fastcgi

Can someone please point me to any documentation concerning first-time configuration on mod_fcgi?

Thank you.

Fri, 08/22/2008 - 13:17
Joe's picture

<div class='quote'>apache2-mod-fastcgi</div>

Do not want! ;-)

mod_fastcgi is broken in several annoying ways under Apache 2. Even with patches found in the Debian build, it's a bit of a mess.

You want mod_fcgid. The two cannot coexist in the same Apache (though both can installed--you can't load them both into the same process).

The Virtualmin install script should have handled everything for you...though it only sets up for PHP apps, by default.

You can double check to be sure your box is setup to use FastCGI in the Server Templates under the Apache Website section. The option is labeled &quot;Default PHP execution mode&quot;. For existing virtual servers, you'll need to look in &quot;Server Configuration:Website Options&quot; for the specific server.

What, specifically, are you wanting to run with FastCGI? And what trouble are you running into?


Check out the forum guidelines!

Fri, 08/22/2008 - 13:44 (Reply to #2)

I'm not particularly interested in fastcgi, was under the impression that it was the same as fcgid, which is what I am after.

The reason I went ahead and upgraded to VM pro 10 is to be able to run Apache2 as the UNIX user instead of www-data.

Upgraded via the Virtualmin dialog, everything went smoothly, but when I set my test domain to use mod_fcgid it stopped loading at all.

Apparently it is because mod-fcgid was not installed. Hehhehhe I'm dumb.

Removed the package apache2-mod-fastcgi, installing apache2-mod-fcgid now.

Thanks for the tip.

Fri, 08/22/2008 - 13:53 (Reply to #3)

O.k., I did not have it set to fcgid, I was trying to set the CGI wrapper option.

Now that apache2-mod-fcgid is installed, in the Website and PHP Options dialog the option &quot;FCGId (run as virtual server owner)&quot; is presented.

So I set it for the domain in question, saved the settings, reloaded apache2, and now it gives the following error:

[code:1]Service Temporarily Unavailable

The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
Apache/2.2.3 (Debian) mod_python/3.2.10 Python/2.4.4 PHP/5.2.0-8+etch11 mod_ssl/2.2.3 OpenSSL/0.9.8c mod_perl/2.0.2 Perl/v5.8.8 Server at Port 80[/code:1]

Other domains on the same server that run as www-data still function normally.

Any suggestions? I have looked for documentation but have not found any so far.

Fri, 08/22/2008 - 14:13 (Reply to #4)
Joe's picture

Two things to check:

/usr/libexec/apache2/suexec -V

Is DOCROOT set to /home? If not, you need to install our Apache package (this should also have been done by the install script, but I've been getting the feeling that lately that isn't working for some reason). Try upgrading your system with apt-get, or just:

apt-get install apache2

And see if it'll get our version.

The other possibility is permissions. Folks often get a little silly when presented with a &quot;it won't run&quot; situation, and they'll set permissions to 777 or similar. When using suexec, this just <i>guarantees</i> that it won't run. Files to be run under suexec must meet the following conditions:

Owned by the user that owns the virtual server

Not group or world writable (thus, definitely not 777)

Within the DOCROOT discussed above

If any of those aren't true, then things won't work.


Check out the forum guidelines!

Mon, 08/25/2008 - 12:16 (Reply to #5)
ronald's picture

that sounds like a good approach. Make sure the OS installation is minimum so you can get the packages from the virtualmin repo.

Also webmin should not be pre-installed with the OS template.

Fri, 08/22/2008 - 14:41

O.k., getting warmer... :)

[code:1]sv01:/home/nukesylo13/public_html# a2enmod suexec
This module is already enabled!
sv01:/home/nukesylo13/public_html# /usr/lib/apache2/suexec -V
-D AP_DOC_ROOT=&quot;/var/www&quot;
-D AP_HTTPD_USER=&quot;www-data&quot;
-D AP_LOG_EXEC=&quot;/var/log/apache2/suexec.log&quot;
-D AP_SAFE_PATH=&quot;/usr/local/bin:/usr/bin:/bin&quot;
-D AP_USERDIR_SUFFIX=&quot;public_html&quot;
sv01:/home/nukesylo13/public_html# apt-get install apache2
Reading package lists... Done
Building dependency tree... Done
apache2 is already the newest version.[/code:1]

DOC_ROOT is set to /var/www

Going to cast around now for a Virtualmin apache2 package, I think that is what you were hinting at above.

Fri, 08/22/2008 - 14:59 (Reply to #7)
Joe's picture

Egads...This is all wrong. (&quot;Gromit! These are the wrong trousers, Gromit...and they're all wrong!&quot;)

Obviously our upgrade from GPL to Professional process has been drinking the Fail-Aid.

I'm guessing that you installed initially using the wbm modules, rather than using the install script for Virtualmin GPL? I think that's the way to end up with the upgrade not enabling the Virtualmin Professional apt repository and such.

So, you probably want to get the apt repo setup. The virtualmin repo line looks like:

deb virtualmin-etch main

Where SERIAL and KEY must be replaced with your serial number and license key (found on )

Then you can try upgrading Apache again. (You may also want to move your install over to a deb-based one, and use the Virtualmin Package updates module to help you stay on top of updates. Once apt is configured, you can get it via &quot;apt-get install webmin-security-updates&quot;.)


Check out the forum guidelines!

Fri, 08/22/2008 - 14:56

Where are the Virtualmin Repos?

The docs on mention the installer updating the repos but I don't see it.

[code:1]sv01:/etc/apache2# cat /etc/apt/sources.list
# deb cdrom:[Debian GNU/Linux 4.0 r0 _Etch_ - Official i386 CD Binary-1 20070407-11:55]/ etch contrib main

deb etch main contrib non-free
deb-src etch main contrib non-free

deb etch/updates main contrib non-free
deb-src etch/updates main contrib non-free[/code:1]

Sorry for bugging you to death about this. Not used to not knowing, been running Debian since hamm and this Virtualmin upgrade is being a pain.

Fri, 08/22/2008 - 15:08

Awesome, that sounds like the ticket.

Installed Virtualmin via wbm and then upgraded from GPL to Pro from within Virtualmin.

Going to add the repo now.

Sorry to hear about your trousers. :D

Fri, 08/22/2008 - 15:22

Got the repo added, apache2-and-friends install went well, already had the webmin security 3.1 update.

Still no go, the site hangs and then times out with the error message from an earlier post.

Here is a tail of the apache2 error log:

[code:1]sv01:/var/log/apache2# tail error.log
[Fri Aug 22 20:17:04 2008] [notice] mod_fcgid: call /home/myusername/public_html/index.php with wrapper /home/myusername/fcgi-bin/php5.fcgi
[Fri Aug 22 20:17:04 2008] [notice] mod_fcgid: server /home/myusername/public_html/index.php(11981) started
[Fri Aug 22 20:17:04 2008] [notice] mod_fcgid: process /home/myusername/public_html/index.php(11979) exit(server exited), terminated by calling exit(), return code: 0
[Fri Aug 22 20:17:04 2008] [notice] mod_fcgid: process /home/myusername/public_html/index.php(11975) exit(communication error), terminated by calling exit(), return code: 0[/code:1]

Time for vodka. :)

Fri, 08/22/2008 - 15:33

I set the child processes from 4 to None and got a different error message.

New error message:

[code:1]Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.
Apache/2.2.3 (Debian) mod_python/3.2.10 Python/2.4.4 PHP/5.2.0-8+etch11 mod_ssl/2.2.3 OpenSSL/0.9.8c mod_perl/2.0.2 Perl/v5.8.8 Server at Port 80[/code:1]

Tailing the log shows this:

[code:1][Fri Aug 22 20:32:03 2008] [notice] mod_fcgid: call /home/nukesylo13/public_html/index.php with wrapper /home/nukesylo13/fcgi-bin/php5.fcgi
[Fri Aug 22 20:32:03 2008] [notice] mod_fcgid: server /home/nukesylo13/public_html/index.php(12523) started
[Fri Aug 22 20:32:03 2008] [notice] mod_fcgid: process /home/nukesylo13/public_html/index.php(12522) exit(server exited), terminated by calling exit(), return code: 0
PHP Warning: Module 'json' already loaded in Unknown on line 0[/code:1]


Sat, 08/23/2008 - 00:22

too many white russisans. mannana esta nuevo daia

Sat, 08/23/2008 - 00:23

too many whitee russnains. mananana esta neuvo dia

Sun, 08/24/2008 - 19:35

O.k., moving domains off the server to a shared host.

Once they start resolving there I'm going to remove Virtualmin completely and use the VM Pro install script instead of using the package upgrade from GPL to Pro.

Hopefully that will get everything configured properly.

If it fails, I'll put in a ticket.

Mon, 08/25/2008 - 23:42

O.k., seems to be working.

I uninstalled apache2, virtualmin*, webmin*, and usermin*, then ran the VM Pro script.

Problem: I already had quotas set up, and when the script tried to set up quotas, it couldn't and so it failed. Once I figured out what was up, I edited fstab and remounted the drive, then ran the script again and it completed successfully. Installed FCGId and it worked out of the box.

Created a Joomla instance and uploaded a file through the media manager using the browser, it uploaded fine which indicates that apache is spawned as the user instead of www-data.

Awesome, good stuff.

Might want to document somewhere that folks should disable their disk quotas before they try to install Virtualmin via the (assuming it was not just a problem on my server) and that to upgrade to Pro, everything Webmin, Usermin, and Virtualmin should be removed.

Of course it may already be written down somewhere and gotten overlooked.

Topic locked