Handling Local and Production Database of WordPress

The WordPress has configuration for one database During working locally, If you want your development site to connect with the local MySQL so you do not risk messing up the production database o MYSQL. Other words, that is one of the reasons you are doing this. The common method for development is to set the database on localhost host and set your MySQL credentials and table name locally to the same as the production site or the development site. This is not good for security. The Mark Jaquith offers an alternative solution that allows for both a production and a local workstation set of database access credentials on his site at the address of http://markjaquith.wordpress.com/2011/06/24/wordpress-local-dev-tips/ and you can find it here. Basically, he changes the wp-config.php file and overriding the set of credentials that exist on his development machine or workstation only and then He ignores this wp-config-local.php file in his source code control so that each developer can have his or her own controlled local credentials and so that this file never makes it to production server.

Creating Virtual Local Server Names of  WordPress

Basically, you set up the WordPress in the document root of your local Apache server. If you wanted more than one local website on your development station, you could set each website in its own folder or its own directory. So this works is very comfort and you use it for many development sites at a time. Either, you can also set up each web server to respond to a local “fake” domain name for every site. When moving to production and using this method makes the conversion from development to production easier and easily move. Now a day’s everyone is familiar with the common top-level domain names, like that .com, .net, and .org, UK, and there are in fact many more.These absolutely qualified domain names run through the DNS system wherever web browsers ask these Internet-accessible DNS servers for the ip address of the web site domain you written in. However, your web browser uses the DNS resolver to examine an area file first to see if there’s predefined mapping. This file is called the hosts file. you’ll use this file and matching Apache configurations to make your work station access local sites with fake fully qualified domain names.
There are some of approaches. Some developers set the domain names of the particular web site they are functioning on to be their local digital computer instead, pre-empting DNS requests. It means that until they revert these changes, they cannot access the live web site, and every one requests can attend the local site. for example, publicly having requests for mirmillo.com attend the server’s in public accessible IP address, these requests are intercepted and are redirected to the localhost ip address and this is always The other choice is to set to development web site with a fake name that’s easy to interchange in SQL during the development phase. During this case, we set the local development web site to be mirmillo.local, hich is an invalid top-level or top ranked domain name (for now). This way, we will access mirmillo.com through ancient DNS and still work on our local development version by accessing mirmillo .local in our application program.
First, you’ve got to line up your Apache to support virtual hosts. the particular configuration here is going to vary counting on your Apache installation. Using WAMP, the fi rst step was to line up a virtual host in Apache. This is often done by redaction the httpd-vhosts.conf file found in C:\wamp\bin\apache\Apache2.2.11\conf\extra. The default example comes with two sample virtual hosts. Change one amongst the present examples to become your localhost virtual host. Then amendment the second example to match the settings you would like for your local installation, like mirmillo.local, as shown in Figure below.

Handling Local and Production Database of Wordperss for Web Developer London.Creating Virtual Local Server Names of  WordPress
Handling Local and Production Database of Wordperss for Web Developer London.Creating Virtual Local Server Names of WordPress

After that, you have to direct Apache to include this file. It is done by after the editing your httpd.conf file as you have done previously in the article. As shown in Figure below, you uncomment the line to include the virtual host configurations settings the file of httpd.conf.