4

I currently have a problem with how to setup my virtual environment for my LAMP stack. The site I'm developing is a web application written in PHP and uses MySQL for the database. Right now, I have a single VM running inside Virtualbox with CentOS. I run the web/mysql server in it and have my code folder setup with GIT.

The host OS (Mac/Windows) currently is setup with a SAMBA share to access the code inside the GIT folder on the VM. From this, I use SourceTree and PHPStorm to manipulate the files and make commits. Permissions on the files/folders are set with a force mask (which doesn't seem to be possible with NFS)

(Samba server on CentOS(guest os), Samba client on Windows/Mac(host os))

The problems occur on occasion when I run my environment like this. I've had my GIT repository have weird errors and corrupting (HEAD detaching, index files corrupting / being too small, other .git files corrupting). There is also an issue where the file names are case insensitive and the CentOS guest OS runs it as case sensitive.


Ultimately, my questions is: How can I setup my development environment to execute the code inside my CentOS Guest OS, have file permissions not be a hassle when I'm commiting/executing, allow me to setup an environment that will match my multi-server environment (ie. multiple Virtualbox instances), and have it run into no or minor problems as if I was just running it all under CentOS for development?

I would prefer to be able to run VirtualBox, be able to develop my software using my PHPStorm/SourceTree applications on my Host OS, and avoid any problems that lead to corruption of my filesystem in GIT.

3
  • Are you running the VM locally? If so, why are you running it through a VM? I develop all my sites locally on a windows enviroment and have never run into an issue. Jun 5, 2013 at 0:44
  • Samba server on CentOS, Samba client on Windows/Mac. Jun 5, 2013 at 1:31
  • VM is running locally. It is running through a VM because it is suppose to match the production environment so we don't run into issues, and it has quite a bit of software to setup. There are things that create problems configuring in windows/mac with MAMP/WAMP such as php extensions and software other than MySQL, like HAProxy/NGINX/iptables. Jun 5, 2013 at 1:32

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.