As it's pretty important that you should be able to develop the application locally, let's use the Vagrant project for setting up the local deploy target.
To be brutally short, Vagrant (see http://www.vagrantup.com/) is a toolset to manage virtual machines from the command line. The end result of your setup would be this:
vagrant up
in the command line.http://localhost:8888/
URL in your browser.vagrant halt
in the command line.All dependencies for your application, including the web server and database, are inside the virtual machine image managed implicitly by the Vagrant toolset. Nothing leaks to your host system.
Vagrant supports several virtual machine vendors, and we should have no trouble if we decide to use the VirtualBox project (see https://www.virtualbox.org/) as both technologies are open source and free to use.
As we'll configure the virtual machine, we need to plan our LAMP stack in detail right from the start.
We need to set up four things:
More than that, we'll need a setup script that will automate the necessary preparations of the base system, including installing all the things mentioned for setup.
Deployment will be greatly simplified by Vagrant, because it just makes the directory holding the code base (where you call vagrant up
, specifically) shared inside the virtual machine as the directory named /vagrant
. That slash is important as it's the vagrant
folder at the root of the directory tree. As a result, the code base will always be synchronized between the deploy target and the development workstation, so you can use whatever toolchain you use to write and maintain the code base, and it will transparently and constantly be sent to the deployment target.
Vagrant hides the management of the virtual machine behind the concept of box. The box is a specially prepared virtual machine image in any format recognizable by Vagrant. These boxes have to be downloadable from somewhere, and a website located at http://www.vagrantbox.es/ holds references to a lot of such prepared images for Vagrant.
However, Vagrant recognizes, and is able to, install some boxes right out of the box. One of them is called precise64, which is Ubuntu 12.04. For simplicity, we'll use this box as it requires essentially no additional setup outside the box.
18.118.253.223