No doubt PHP is the best tool a web developer can have and if you develop applications on Windows you must have heard of Wamp Server. (Those who don't know Wamp let me tell you it can setup your local environment in minutes to start developing your applications). There are many tasks we used to repeat daily or many times a day.
- Pull from server - in case you are using GIT
- Push to the Server - in case you are using GIT
- backup database
- backup files
- Sync Files - in case you are using two development machines e.g. laptop, PC.
- System got damaged then again developing from scratch because you forgot to backup. The worst one happened to me. :(
- so on ...
- Setup and install Wamp Server. To download one follow the link.
- Setup and install Dropbox. Follow the link to download. ( By default Dropbox provide 2GB of storage. You would get 2.25GB from this link.)
Now Apache needs to be informed to store and use Dropbox as root directory:
- Create a folder named 'www' in dropbox folder and tell Apache to use this folder as root.
- This we do by editing Apache’s httpd.conf file. If you installed Wamp Server with its default settings, this file should be located at ‘C:\wamp\bin\apache\Apache2.2.21\conf\httpd.conf’. (version may vary).
- Open this file in notepad or any editor you use. Search for the word "DocumentRoot" or the line looks similar to (most probably line no 178):
- Change it to :
- Notice the slashes used, only forward slashes can be used don't use backward slashes.
- On around line no 205 you will find :
- Change it to :
- Save and close the files.
- Open the file my.ini located in "C:\wamp\bin\mysql\mysql5.5.20\my.ini"and find a variable declaration datadir (line no: 39) and change its address to "C:/Users/dassaumen/Dropbox/database/".
- In the same folder you would find a folder named data copy its content to the following location "C:/Users/dassaumen/Dropbox/database/".
- Restart your Wamp server.
You have configured your localhost to stay synced with dropbox. And dropbox keeps all your devices synced. Just follow the steps on all your devices.
Note: Never delete the content of folder in "C:\wamp\bin\mysql\mysql5.5.20\data".
So now you have a real-time backup system for your web applications, and a fast and easy local server.