开发者

Developing on Windows Machines, deploying on Linux (Ubuntu)

I've been developing a web application (written in Python/Django) for a while. All my development work is done on a Windows machine, but I eventually deploy to an Ubuntu 10.10 server (VPS).

I've started having a lot of trouble with the fact that my dev environment and production environment are different. I'm constantly trying new libraries that are supported on Linux, but have terrible Windows support, etc. I do have a staging server, but obviously I can't do most of my development by deploying to a staging server every time.

My Question: I want to keep working with Windows as my development environment, but to not have all these issues. What's the best way to go about it? I've started considering running a local Linu开发者_如何学Pythonx Server on a virtual machine, giving me the speed of a local server but removing the Windows obstacle. Is that the best way to go about this?


I guess there are as many solutions as freelance developpers.

Maybe not the best, but here what I'm doing and it works well :

  • Windows7 hosting 2 Virtual machines (virtualbox)
  • Eclipse Helios on the Windows machine
  • 1 VM ubuntu, used for various script testing from a client
  • 1 VM Debian, as a development server, built as perfect image of the production server
  • 1 production server, so Debian in my case, where I transfer the "finished" product or validated releases.
  • 1 developpement server, only for SVN and/or TRAC or similar. This could be merged within your development VM server.
  • for Perl developments, I have added Perl modules -under cygwin- on the windows hosting machine, Eclipse being tuned accordingly to this set up. But being honest, such mixed solutions should be avoided.

What does it allow ?

  • the VM use allows you to have a kind of permanent backup of your development server,
  • the VM use allows you to come back easily to a previous server release - for instance in case of crash,
  • ssh from one machine to the other, even from one VM to the other,
  • sharing directories between Windows and your VM's,
  • using Eclipse as a developpment center for all these on the Windows machine (subclipse/svn client, java, python, php, perl, bash, js, ...)

You will loose some of the speed of a local server because of the VM required resources - hosted on the same machine than your windows stuffs, but the "how much" will depend on your hardware. In any case, this shall not become a bottle neck for such a layout.

It's a bit heavy to setup at the beginning but very convenient once on track.

Hope it gives you ideas at least.

PS: setting up a VM is quite straight forward, even a noob like me has done it :-)


Use of virtual machines is the normal way to solve this problem. They work fantastically well on modern hardware. A VM will give you, by far, the most convenience of available options.


I've had a similar problem not a while ago. I've been developing a Linux mobile app and didn't want to abandon the convenience of Visual Studio editor. I've set up VirtualBox with Ubuntu and a shared folder between guest and host OS's. Thus I was able to edit code in VS and compile/run it under Ubuntu without much overhead. That worked well for me for quite a long time. I suggest to try that out.


Either use a virtual machine. Or you can use Cygwin. Which is a kind-of pseudo VM.


I would recommended a preconfigured TurnKey Django virtual machine for your development. A huge bonus in doing so is that you can leverage TurnKey Backup and Migration (TKLBAM) to migrate your app (and any server customizations) to the cloud when you're ready...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜