Here is how I typically work with my small web projects in a LAMP Environment.
Vagrant – Virtual Machine
Vagrant Manager – GUI for managing my Vagrant VMs
Virtual Box
Scotch Box – A vagrant LAMP Stack that just works
Webstorm – HTML/Javascript IDE (free alternative Atom)
Sublime Text – Text editor
iTerm2 – Great terminal program for OSX
Git – Open Source Version Control System
Github/BitBucket – Online GIT Repository
SourceTree – Git GUI
Transmit – FTP Application from Coda
Starting a new LAMP Project : www.devtest.com
When working on a project, I like to build my site locally inside a virtual machine. I prefer this method as it gives me a reliable environment where I am sure would not be affected by other projects. I could also have setup a space on my shared hosting plan and work remotely, but then you have to keep uploading every change you do. My old method of setting up a local Apache/Mysql/Php using Mamp Pro worked fine until I started introducing Node/Grunt/npm/etc.
Sounds like a lot of work to setup a linux vm and getting it setup with all the tools you need. Not so. This is where vagrant comes in. With vagrant you can download a ‘box’ that already contains an os already setup. I would download a Ubuntu box and fire it up in a few short minutes. Hold on you still need to install apache/nginx, mysql/mongodb/maria, php, phpmyadmin, setup shared folders so your vm is accessible by your host machine, configure virtualhosts etc. Well there is another slick tool I’ve started using called Scotch Box that automates all of this.
Getting Started
1. Download/Setup Vagrant
2. Download/Setup Virtual Box
3. Download/Setup iTerm2
3. Download/Setup Git
4. Clone Scotch Box repo from Github to your local machine:
git clone https://github.com/scotch-io/scotch-box.git my-project
5. Run the VM:
Vagrant Up
6. Access your project you just setup:
http://192.168.33.10/
Okay so we now have a Linux VM setup in VirtualBox and preconfigured with Vagrant/Scotch Box. And you also now have a great terminal program to do things like clone Git Repos etc. At this point I would install Vagrant Manager so you have a nice GUI to run/halt your VMs. For version control I would use Git, and I personally find it easier to use a GUI like SourceTree. For my client projects I save my GitHub repos on BitBucket, but general fun projects I just host on GitHub. That way I have a local copy of the project as well as a backup online. Its up to you to take that a step further and backup your local repo to an external disk.
When I have a project ready to publish to the world, I usually create a new account on my shared hosting server I rent. I have a reseller account at CrocWeb and for a small monthly fee I can setup as many websites as I could want. I use Transmit as my favourite FTP client, and SublimeText as my text editor.
Ok so you have now a choice to duplicate this VM and host every web project on a different VM. I think thats overkill and so in some cases I just setup a virtualhost and have multiple small clients on the same vm. Here is more info on how to set that up using Scotch Box.