How could I import a production website into a home-computer localhost virtualmin, and make it behave as if it were still up?


Pardon the lengthy explanation below, I’m stuck and I don’t know how to achieve something that should be simple. If you can help, I will be most grateful :slight_smile:

I have a dedicated server with virtualmin on it, installed by a technician with whom I’ve been working for plenty of years now, and on this virtualmin there are a number of websites for me or my family running.

I want to test stuff on one of those websites (change some server settings, eagerly read the apache error logs, see if the website crashes altogether or malfunctions).
But in order to keep that website online and well, I want to run a copy of it in a sheltered environment, on my home computer, a windows10 machine.

For this, I have successfully installed an Ubuntu 14 server LTS into my usual vmware workstation player, and I have successfully installed virtualmin on it. I can successfully load the virtualmin administration interface on a localhost url, , and finally the post-install final configuration and checkup was successfully performed.
… so far, so good.
But now, what?!? :smiley:

I’m thinking of duplicating a website backup of my production website, as virtualmin does it so well, whose files I would temporarily place in a publicly reachable location, and that I would wget into my virtual machine, on my home PC.
And then, load it into virtualmin, as part of the process to restore a website from a backup.

However, if I did that, the website wouldn’t work, wouldn’t it? It would “want” to work on its .com domain, and would fail to be loaded, and thus fail to be tested, wouldn’t it?

If so, would there be a way to “cheat” the system so that the website, running within the virtualmin running within the virtual machine on my home computer, would falsely think it was still online and running?

I’m running out of ideas, and my google-fu is so poor I’m not finding a how-to. Really, if you can help, I’ll be most grateful, thank you! :slight_smile:

Hi, a website if dynamic, it will be in 2 parts, MySQL Database and files, one of the files is a configuration file to make connection to the database.

So , in principal you can move independent from the system *** files from and to in both your environments.

*** tricky bit is that the PHP and MYSQL environment should be “almost” identical, with same PHP modules and so on, that’s all to it :slight_smile:

Not sure if you ment to website on-line from both environment is that is a little more complicated.

Thanks RavenKing.

Well, basically, in my eyes, it’s about changing from php5 fcgid to php7.x php-fpm and see whether all hell breaks loose or not.

I tried this afternoon: on my test virtualmin, I imported a virtualmin backup of the website I wanted to test, I had placed its .gz, .gz.dom and inside a publicly reachable directory for me to wget it, and I asked virtualmin to restore those files.
Virtualmin told that everything went A-OK, the website was successfully created (as it wasn’t present yet) and everything was restored.

And then, in virtualmin, I went in Services > Preview website…
and as I expected, it didn’t work.
In the URL of my browser, it loaded “ (edit: the URL was cropped by the forum engine, my bad, so I insert text in the middle)
And I got a
Failed to connect to : Connection refused
error message in the browser window.

This looks odd, as I could successfully manage virtualmin in this very same browser window, etcetera O_o

If your website is WordPress, there is another way…

Lookup wp2static plugin for WordPress. It allows you to develop the website in one location, and upload a static version of it to another.

So you set the static version as your production location, whilst you play around editing the dynamic version on another directory, or different webserver altogether.

Obviously this has its limitations.

Another option is to configure your Windows hosts file so that if you type a domain name into your Web browser, Windows goes to a wamp/xamp directory on your system itself…Ie your browser doesn’t go looking for external dns for ipaddress for this website (This method should work, however you will need to remember to change/disable it when you want to view live production site online)

Thanks Adam. It’s not a wordpress, so I’ll skip, haha.
Also, thanks for suggesting I update my local hosts file, however at the present time I can already load, on my home PC in my regular browser, the virtualmin server’s served pages created within the virtual machine that’s running on my home PC. (I’m quite certain a native English speaker would have written that previous sentence better, but I gave up after rewriting it 3 times.)
Vmware player already configured it to work, I load a 192.168.something in my browser and I can view the virtual machine’s virtualmin, etc.

No, the problem is elsewhere, these are precisely the websites virtualmin creates that don’t manage to be viewed.

I’ll find it, eventually, sigh. Or I can go back to 1997 and try easyphp, who knows maybe it will work!