Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I've asked this on the virtualmin forums, but haven't had any help from there.

Recently, "something" happened and it seems that the apache service has gone a bit weird.

What it does: it runs all apache traffic as www-data and sometimes spawns the php5-cgi process as www-data, this is a problem because all the domain users own their directories and default permissions don't let www-data write to these folders (file uploads are dead) or read .htaccess (permalinks are broken in wordpress).

I've googled this for about a week straight now, tried pretty much everything I could find and achieved nothing.

The only thing that I think might actually be the cause of all this is this page: http:// - i.imgur.com/NYW3x.png (got shut down by the spam filter) So I figured if I set it to "default", this might magically start working again, but all it does is "crash" apache (all websites timeout).

I figure it's something to do with the "mpm" module or something, but I can't find anything relevant in the settings to modify for it to work.

Can someone please point me in the right direction?

System info:

Webmin version   1.580
Kernel and CPU    Linux 2.6.35.4-rscloud on x86_64
Virtualmin version 3.90.gpl GPL
Ubuntu 10.04 LTS (Lucid)

A couple screenshots of top

share|improve this question

2 Answers 2

up vote 1 down vote accepted

When updating to php 5.4+ on a Debian server I ran into this same problem.

By default, the php5.4+ distribution will include the SetHandler directive in its apache conf files. Virtualmin adds its own SetHandler configuration directive for each site. So to make this work properly you want to disable this directive from the default php conf file.

Open your php.conf or php5.conf apache conf files.

/etc/apache2/mods-available/php5.conf
/etc/apache2/mods-available/php_cgi5.conf

Comment out SetHandler lines with a #. Or the whole FilesMatch node.

#<FilesMatch ".+\.ph(p[345]?|t|tml)$">
#    SetHandler application/x-httpd-php
#</FilesMatch>

Restart apache.

share|improve this answer

Re-Check Configuration will detect whether suexec is misconfigured in some way on your system, but since it works sometimes, it means you have some configuration over-riding Virtualmin's settings in the Apache configuration.

suexec not being called for some domains or directories is the source of your trouble. That would indicate a few possibilities...mod_php doesn't work with suexec, so you'd need to use FCGId mode or CGI mode in order for suexec to work.

My assumption would be you've got some custom PHP handlers in your httpd configuration that are leading to mod_php being used for some applications rather than CGI or FCGId. Virtualmin only controls that with domain-level specificity, so if it's really "sometimes" for a given domain, it has to be directory level or more specific.

So, check your configuration file for custom handlers that lead to mod_php being used instead of FCGId or CGI. Also, MPM is incompatible with mod_php, as far as I know. So, if you're ever using MPM, you should even be loading mod_php, as you can't safely use it.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.