0

I have a live 1.9.2.2 website, however I want to make a local host version of it so I can run tests on changes, before applying them to my live site.

What is the best way to go about setting up a local host at this point? I've got instructions on how to do it for a site that isn't live, but wasn't sure if I needed to change anything if the site was already live.

Thanks!

2

Setup Local Web Server

This is a rather broad scope question but consider the following routes:

Setup Apache or Nginx to serve your working directory eg /home/username/repositories/yourproject/ as a http webroot.

Setup your computers local hosts file to serve an internal style domain eg dev.yourwebsite.com or internal.yourwebsite.com (doesnt really matter what you use, but should aim for it to be something your not going to need access to on the public internet.

Add that to /etc/hosts 127.0.0.1 internal.yourdomain.com

Then, import your database into your local mysql and update app/etc/local.xml with the username and password for the new database.

Update core_config_data to point your website to internal.yourdomain.com

This assumes of course your working on a Linux or Mac based computer, you can get it working on windows but if your using windows I would reccomend you approach it as a virtual machine.

Setup Virtual Machine

This is the approach that I usually use. Download virtual box (https://www.virtualbox.org/)

Then install a Linux distribution such as Ubuntu then install Apache/MySQL/PHP as you normally would on your production server. You will need to update your hosts file again but instead of pointing to 127.0.0.1 as above, you'll point it to the IP given to the Virtual server.

Alternative routes include Docker: https://github.com/kojiromike/docker-magento which I have not currently used there are several preconfigured environments for working with Magento but the steps will be vastly the same - point hosts to the docker instance and sync file systems.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.