Hello there,
I run into an error when updating Virtualmin on several (not all) Debian systems.
It concerns the latest version, I make all my updates in command line: "apt-get update && apt-get dist-upgrade".
It happens on Debian 6 (yes, I know...), 7 and 8.
Here is the error :
The following packages will be upgraded: webmin-virtual-server 1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Need to get 1 634 kB of archives. After this operation, 0 B of additional disk space will be used. Do you want to continue [Y/n]? Get:1 http://software.virtualmin.com/gpl/debian/ virtualmin-universal/main webmin-virtual-server all 5.05.gpl [1 634 kB] Fetched 1 634 kB in 1s (1 246 kB/s) (Reading database ... 102785 files and directories currently installed.) Preparing to replace webmin-virtual-server 5.04.gpl (using .../webmin-virtual-server_5.05.gpl_all.deb) ... Unpacking replacement webmin-virtual-server ... Setting up webmin-virtual-server (5.05.gpl) ...
virtual-server/postinstall.pl failed : virtual-server::module_install failed : Failed to copy /etc/php5/apache2/php.ini to /home/domain/domains/domain.com/etc/php5/php.ini : cp: cannot create regular file `/home/domain/domains/domain.com/etc/php5/php.ini': No such file or directory
Is that harmless ?
All the best! Nico
Comments
Submitted by andreychek on Mon, 11/28/2016 - 10:52 Comment #2
Howdy -- hmm, it looks like it's having trouble copying the php.ini file into the etc dir of one of your domains. It looks like the directory may not exist.
What is the output of these commands:
ls -ld /home/domain/domains/domain.com
ls -ld /home/domain/domains/domain.com/etc
ls -ld /home/domain/domains/domain.com/etc/php5
You'd need to ensure that all those directories exist.
Submitted by JamieCameron on Mon, 11/28/2016 - 16:32 Comment #4
This is a bug in Virtualmin - it shouldn't be trying to generate missing php.ini files for alias domains. However, it's harmless and can be ignored.
We will fix it in the next release though.
Submitted by JamieCameron on Mon, 11/28/2016 - 16:32 Comment #5
Submitted by george.asenov on Wed, 12/07/2016 - 03:05 Comment #7
Hi Jamie,
We have tested the following fix but it didn't work,
In virtual-server-lib-funcs.pl on line 14032:
foreach my $d (grep { &domain_has_website($_) && !$_->{'alias'}}
&list_domains()) {
&save_domain_php_mode($d, &get_domain_php_mode($d));
&clear_links_cache($d);
}
$config{'last_check_php_vers'} = join(" ", @newvernums);
}
the change is :
from foreach my $d (grep { &domain_has_website($_)}
to foreach my $d (grep { &domain_has_website($_) && !$_->{'alias'}}
Unfortunately the error come up when you try virtualmin Re-Check Configuration also. And because of that if you add new PHP version it can't be added to virtualmin and used.
So Jamie can you please post here the fix because we need to add new PHP version and with that error it won't get added to virtualmin configuration. Thanks in advance.
Submitted by JamieCameron on Wed, 12/07/2016 - 22:43 Comment #8
That should do it - but make sure you run
/etc/webmin/restart
after making this code change to apply it properly.Submitted by george.asenov on Thu, 12/08/2016 - 01:05 Comment #9
Hi Jamie,
I made a service webmin restart but it didn't help. The error was the same.
Submitted by andreychek on Thu, 12/08/2016 - 08:36 Comment #10
Hmm, what is the output of this command:
ps auxw | grep miniserv
Submitted by JamieCameron on Thu, 12/08/2016 - 17:20 Comment #11
Which PHP execution mode is the top-level domain using?
Submitted by george.asenov on Fri, 12/09/2016 - 03:07 Comment #12
Hi Jamie ana Andreychek.
So there ware two issues. After Jamie mention the php execution mode. I use the console command: virtualmin modify-web --all-domains --mode fcgid to update all domain's php execution mode and with the fix the recheck went trough, slow but pass.
Submitted by george.asenov on Fri, 12/09/2016 - 03:44 Comment #13
Hi again,
As I understand this recheck configuration try to regenerate all php.ini files for all domains. Why is that when if you try to change the php version for a website virtualmin automatically regenerate all php.ini files (if some does not exist) for this website. This regeneration will take more than an hour to regenerate php.ini files for a server with more than 1000 websites.
Submitted by JamieCameron on Fri, 12/09/2016 - 11:57 Comment #14
It doesn't re-generate all the files - just creates missing ones.
Submitted by skelgaard on Sat, 01/14/2017 - 02:22 Pro Licensee Comment #16
this is still a problem .... PHP versions have changed to 5, 7.0 since last check. Regenerating any missing php.ini files.
Failed to copy /etc/php5/apache2/php.ini to /home//domains/****/etc/php5/php.ini : cp: cannot create regular file ‘/home//domains/***/etc/php5/php.ini’: No such file or directory
Webmin version 1.831 Virtualmin version 5.05
Submitted by skelgaard on Sat, 01/14/2017 - 03:43 Pro Licensee Comment #17
deleted all alias, ran the Re-check configuration, success and then readded the alias, now i can run the re-check without problems.
Submitted by andreychek on Sat, 01/14/2017 - 08:57 Comment #18
Glad to hear that worked for you!
We haven't actually released a new Virtualmin version yet, though I think we're going to be doing that fairly soon now due to the number of pending bug fixes that are in it.