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?
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 “Default PHP execution mode”. For existing virtual servers, you’ll need to look in “Server Configuration:Website Options” for the specific server.
What, specifically, are you wanting to run with FastCGI? And what trouble are you running into?
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.
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 "FCGId (run as virtual server owner)" 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 www.mydomain.com 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.
Two things to check:
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 “it won’t run” situation, and they’ll set permissions to 777 or similar. When using suexec, this just guarantees 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.
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
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.
Where are the Virtualmin Repos?
The docs on virtualmin.com 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 http://ftp.debian.org/debian/ etch main contrib non-free
deb-src http://ftp.debian.org/debian/ etch main contrib non-free
deb http://security.debian.org/ etch/updates main contrib non-free
deb-src http://security.debian.org/ 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.
Egads…This is all wrong. (“Gromit! These are the wrong trousers, Gromit…and they’re all wrong!”)
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 http://SERIAL:KEY@software.virtualmin.com/debian/ virtualmin-etch main
Where SERIAL and KEY must be replaced with your serial number and license key (found on http://www.virtualmin.com/serial/ )
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 "apt-get install webmin-security-updates".)
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.
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.
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, email@example.com 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 mydomain.com 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]
too many white russisans. mannana esta nuevo daia
too many whitee russnains. mananana esta neuvo dia
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.
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.
O.k., seems to be working.
I uninstalled apache2, virtualmin*, webmin*, and usermin*, then ran the VM Pro install.sh 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 install.sh (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.