Submitted by ADDISON74 on Mon, 06/20/2016 - 16:53
I created a clone to one of my test virtual servers then I tried to use phpmyadmin to access its database. I couldn't, user doesn't have permissions for its own database. I checked its privileges inside mysql and I discovered I should create new ones. Once I granted privileges I could use phpmyadmin to see database content. Please do a test and see what is happening.
Status:
Active
Comments
Submitted by JamieCameron on Tue, 06/21/2016 - 00:33 Comment #1
Was this a sub-server being cloned, or a top-level virtual server?
Submitted by ADDISON74 on Tue, 06/21/2016 - 01:17 Comment #2
It is a top level virtual server. I am investigating today if the privileges for initial virtual server are setup from the very beginning. If they are it means by cloning process the new admin doesn't have permissions setup for its cloned databases.
Submitted by ADDISON74 on Tue, 06/21/2016 - 05:00 Comment #3
A first observation related to phpMyAdmin configuration. If you selected when installing the script in 'Database to manage' section [*] Only selected ... this selection of databases will be cloned too into the new virtual server. When you log into phpMyAdmin on cloned server you will see no databases and no privileges will be displayed. In order to correct this you have to edit
/phpmyadmin/config.inc.php
$cfg['Servers'][$i]['only_db'] = Array('your_initial_databases_list');
Also if you check Details for installed script into cloned virtual server you will see the line "initial login" having the same connection information from master virtual server.
In my opinion some scripts must be reinstalled from scratch instead of cloning them. Virtualmin is not doing anything for preventing this for the moment.
Submitted by ADDISON74 on Tue, 06/21/2016 - 04:53 Comment #4
one more observation after using grep command in cloned folder looking for master name. file /home/[cloned_virtual_server]/public/awstats/.htaccess has this content:
AuthName "[master_virtual_server] statistics"
AuthType Basic
AuthUserFile /home/[master_virtual_server]/.awstats-htpasswd
require valid-user
In conclusion a few files must be edited after cloning a virtual server. Till no there are affected AWstats and phpMyAdmin. It could be other scripts too. I will evaluate RoundCube.
Submitted by ADDISON74 on Tue, 06/21/2016 - 05:01 Comment #5
WARNING - OWNER PERMISSIONS IN CLONING A VIRTUAL SERVER
Just use this command find /home/[your_cloned_server] -group [master_server_name]
I found this list of files which don't have the owner and group correctly set up:
/home/[your_cloned_server]/public_html/awstatsicons
/home/[your_cloned_server]/public_html/icon/mime/csv.png
/home/[your_cloned_server]/public_html/icon/mime/dtd.png
/home/[your_cloned_server]/public_html/icon/mime/runtime.png
/home/[your_cloned_server]/public_html/icon/mime/swf.png
/home/[your_cloned_server]/public_html/icon/mime/conf.png
/home/[your_cloned_server]/public_html/icon/mime/package.png
/home/[your_cloned_server]/public_html/icon/mime/fon.png
/home/[your_cloned_server]/public_html/icon/mime/flv.png
/home/[your_cloned_server]/public_html/icon/mime/xsl.png
/home/[your_cloned_server]/public_html/icon/mime/vbs.png
/home/[your_cloned_server]/public_html/icon/mime/document.png
/home/[your_cloned_server]/public_html/awstats-icon
/home/[your_cloned_server]/etc/php.ini
/home/[your_cloned_server]/cgi-bin/lang
/home/[your_cloned_server]/cgi-bin/plugins
/home/[your_cloned_server]/cgi-bin/lib
After cloning a virtual server you MUST run chown command to set up correctly the owner and group for the whole tree of files.
Just be careful some files cannot be changed so easy:
chown: changing ownership of './fcgi-bin/php7.0.fcgi': Operation not permitted
chown: changing ownership of './cgi-bin/php7.0.cgi': Operation not permitted
Submitted by JamieCameron on Thu, 06/23/2016 - 23:07 Comment #6
Wow, it looks like something went really wrong with cloning there! There shouldn't be any files left over owned by the old user.
Did you get any errors in the middle of the process?
Submitted by ADDISON74 on Fri, 06/24/2016 - 08:41 Comment #7
I agree bad things happened. It is not only the ownership issue, see the others. There were no error in logs or in browser in cloning process.
Submitted by JamieCameron on Fri, 06/24/2016 - 19:42 Comment #8
I'm looking into this, and will also fix the issue of the wrong path being left in the
.htaccess
file.However, it isn't practical to fix all script config files (like phpMyAdmin) as Virtualmin doesn't have internal knowledge of how every possible app stores it's settings.
Submitted by JamieCameron on Mon, 07/04/2016 - 00:52 Comment #9
The
.htaccess
issue will be fixed in the next Virtualmin release.Submitted by ADDISON74 on Sat, 01/20/2018 - 17:00 Comment #10
Some issues were not fixed.
Submitted by andreychek on Sun, 01/21/2018 - 10:01 Comment #11
Can you clarify what problems you are experiencing?
Submitted by ADDISON74 on Sun, 01/21/2018 - 11:49 Comment #12
Issues posted at #3, #4, #5 are still present in the newest version.