Blog · 08/12/2021

Virtualmin: incorrect PHP-FPM group

Virtualmin: incorrect PHP-FPM group

Introduction

A long time ago, when the first domains were created on Webmin - Virtualmin we used a server and subserver scheme to organize hosting.

In one server we had the group of customers, in the other the company and in the other the development.

When it grew in the number of domains this scheme left us short at the same time it was already unsafe, so we passed to put all the subservers as main servers.

The problem study in Webmin - Virtualmin

From the beginning we had a problem, the group to which the server belonged was always the same since the beginning , although now, that already the subservers were main the server group and the user should be the same.

That is, when they were subservers the configuration for the PHP was as follows:

[151082908023701]
user = facturascripts
group = empresa
listen = localhost:8045
pm = ondemand
pm.max_children = 5
pm.min_spare_servers = 1
pm.max_requests = 200
php_admin_value[upload_tmp_dir] = /home/facturascripts/tmp
php_admin_value[session.save_path] = /home/facturascripts/tmp

As the value of group was company

When it goes to be main server , the user and the group should be the same, i.e., the configuration for the PHP should be the following:

[151082908023701]
user = facturascripts
group = facturascripts
listen = localhost:8045
pm = ondemand
pm.max_children = 5
pm.min_spare_servers = 1
pm.max_requests = 200
php_admin_value[upload_tmp_dir] = /home/facturascripts/tmp
php_admin_value[session.save_path] = /home/facturascripts/tmp

As observed the value of user is facturascritps and the value of group is facturascripts , being both the same.

Of course, in our case it was also the same value that of user and group when they passed to be main servers because we changed it manually.

This solution is valid temporarily, since in case for example change to another version of PHP Virtualmin you will again put the group previous , making fail for example the PHP service when re-start and refresh the configuration .

The definitive solution

To give a definitive solution, what you have to do is to modify the domain settings file saved in Webmin.

This configuration file is the one that has the stored group value and this value is the same since it was created for the first time.

Although the PHP configuration is rewrite, the group value is still saved and when you need to refresh or regenerate the configuration, the previous will be rewrite.

To avoid this, what you have to do is go to the domain settings that Webmin has saved and modify it, for this we look at the server identification number that is at the top of the PHP settings:

Go to Services -> PHP-FPM Configuration
View the server ID value

Now you have to go to the folder /etc/webmin/virtual-servers/domains and search the configuration file based on the ID of the server observed earlier.

You can help with the fast filter that the Webmin file browser offers you.

Now you just need to edit the file and modify the value ugroup , in this case by facturascripts.

Configuration of Virtualmin Server
Indicate the correct name of group in the value ugroup

After these changes, you will no longer have to worry about the group changing to the original when the server was created when the configuration is changed or rechargeed.

If you have any other type of problem with Virtualmin's PHP settings, this article can help you: /webmin-no-leave-change-modus-php-ni-la-version/