save_phpmode.cgi eating RAM

I modified a virtual server's "Website and PHP options" from

  • Run CGI scripts as domain owner?: no
  • PHP script execution mode: (none enabled)

to

  • Run CGI scripts as domain owner?: yes
  • PHP script execution mode: FCGId (run as virtual server owner)

When saving the options the server stopped responsing at HTTP. I still got shell access using SSH but it took ~20 seconds to log in.

Using top I discovered the process /usr/share/webmin/virtual-server/save_phpmode.cgi was using much RAM, see the attached screenshot. When killing the process the server returned to be usable.

BTW: The virtual server in question also produces an error message when backing up:

   Copying Apache virtual host configuration ..
   .. no Apache virtual host found!

It has a conf file in /etc/apache2/sites-enabled though.

Any ideas?

Status: 
Active

Comments

Does the RAM use continue to grow until you kill the process?

Also, what is the output from the command :

virtualmin validate-domains --domain yourdomain.com --all-features

(Got no email notification for your post - sorry!)

virtualmin validate-domains --domain gekartel.db --all-features
gekartel.db
    Mail for domain : Home directory /home/gekartel/test3 for user test@gekartel.db does not exist
    Apache website : No Apache virtual host for gekartel.db found
    Log file rotation : No Apache log found for virtual host gekartel.db

Apache config is there:

ls /etc/apache2/sites-enabled/gekartel.db.conf

RAM usage seems to grow continuous. I guess this because the machine started swapping after saving the options in Virtuaslmin. I did not watch it because it is a production server. Goal was to get it alive fast. So I killed the process and swapping stopped immediately.

That "No Apache virtual host for gekartel.db" message looks like the cause.

What does /etc/apache2/sites-enabled/gekartel.db.conf contain? It needs a line like : ServerName gekartel.db for Virtualmin to properly detect it.

It contains

ServerName gekartel.db

May be the non-standard TLD .db is the problem?

No, that .db shouldn't matter.

If you go to Webmin -> Servers -> Apache Webserver, can you see your gekartel.db virtual host?

Yes, it is there. It uses port 8000 by the way. Here is the content of /etc/apache2/sites-enabled/gekartel.db.conf

<VirtualHost 78.46.178.162:8000>
SuexecUserGroup "#1174" "#1022"
ServerName gekartel.db
ServerAlias www.gekartel.db
ServerAlias lists.gekartel.db
DocumentRoot /home/gekartel/public_html
ErrorLog /home/gekartel/logs/error_log
CustomLog /home/gekartel/logs/access_log combined
ScriptAlias /cgi-bin/ /home/gekartel/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/gekartel/public_html>
Options -Indexes IncludesNOEXEC FollowSymLinks ExecCGI
allow from all
AllowOverride All
AddHandler fcgid-script .php
AddHandler fcgid-script .php5
FCGIWrapper /home/gekartel/fcgi-bin/php5.fcgi .php
FCGIWrapper /home/gekartel/fcgi-bin/php5.fcgi .php5
</Directory>
<Directory /home/gekartel/cgi-bin>
allow from all
</Directory>
RemoveHandler .php
RemoveHandler .php5
IPCCommTimeout 31
RedirectMatch /cgi-bin/mailman/([^/]*)(.*) https://gekartel.db:10000/virtualmin-mailman/unauthenticated/$1.cgi$2
RedirectMatch /mailman/([^/]*)(.*) https://gekartel.db:10000/virtualmin-mailman/unauthenticated/$1.cgi$2
Alias /pipermail /var/lib/mailman/archives/public
</VirtualHost>

Hm, interesting ServerAlias entries. May be that causes the problem?

No, the strange ServerAliases are generated by the Markdown filter of Drupal.

I attached the config file now.

The port of 8000 could cause issues .. did you change the port using Virtualmin? Does it show up at Server Configuration -> Change IP Address ?

I did change it manually. It does not show up at at Server Configuration -> Change IP Address. There I still see port 80. At Server Configuration -> Website Options I see the form as you can see in the attached file Website Options bad.png.

After changing the port manually back to 80 and using Server Configuration -> Change IP Address to change it to 8000 I see the form as in Website Options good.png.

Using the form now works without problems. So that manually change of the port caused the problem.

Two questions are raising now:

  1. Why does save_phpmode.cgi starts using continously RAM in the case of an unexpected configuration?

  2. I thought it would be no problem for Virtualmin to edit config files manually because it just reads them and uses the changed values in it's forms. Are there exceptions to this? Apparently the port configuration not only uses the virtual host config file to save and get the port number. That would be an explanation.

PS: When uploading the attachments I got the error message: "The selected file Website Options bad.png could not be uploaded. The file is 70.28 KB which would exceed your disk quota of 1 MB." So I uploaded it to my host, see it here:

http://fuerstnet.de/kram/Website_Options_bad.png
http://fuerstnet.de/kram/Website_Options_good.png

Point 1 is a bug in Virtualmin - it should fail gracefully in this case, not use up endless RAM. I'll fix that in the next release.

Point 2 is an exception to the rule of Virtualmin detecting manual config changes. In this case because the port was different, it couldn't find the Apache virtualhost block associated with the domain. If you'd changed almost anything else within that block, it would have been OK.