问题
I'm currently running a virtual Ubuntu Server on my mac via Parallels. It is really quite alright, but working in the virtual environment can be a little slow.
I am looking to just run the server, but do the actual development on the mac side. I really just want the server to run silently in the background whilst all dev work is handled on the mac.
Has anyone set up something like this and would be able to point me to a fairly concise tutorial?
Some of the challenges (for me) are :
- accessing the files on the server to edit
- virtual hosts
- using the mac console instead of the virtual server's
回答1:
I suggest installing LAMP, MAMP or XAMPP on your OS X host and developing via that,
But if you insist, there are options. Use eclipse for development and it supports remote projects (though some functionality is limited) so you can enter virtual guest IP and access project files there.
You can also setup OpenSSH on your guest to access its console via ssh in your own console.
I dont know what you mean by virtual hosts, Do you intend to setup virtual hosts that reside on your host OS? I dont think it'll be possible.
The solution I'd offer would be to use SVN or any other version control on your host (OS X), commit changes into that, run a cron or daemon on your ubuntu that does "svn update" frequently on your folder.
回答2:
If you want to use VMs, using a shared directory makes things easy.
You can keep source code on Mac and share it with guest OS in VM. That ways you can edit it on Mac itself and inside VM, mount it on relevant Apache directory to run.
And do enable SSH on the guest OS. With that, you can use Mac console to manage Apache and other components on guest OS.
回答3:
You can use a Bitnami application for this purpose:
https://bitnami.com/stacks
They run locally, from a folder in your home directory, so everything is local. Most of them have a nice GUI to start/stop the LAMP stack, so you can focus on you application.
You just need the application you want to run (i.e. Wordpress, Drupal, or plain LAMP), download an installer and run it. Since it runs from a folder in your local "physical" machine, you can work with any file with the Finder and with your favorite text editor, there's no need to do anything special.
For more details on Bitnami installers see https://docs.bitnami.com/installer/faq/osx-faq/#install_osx
来源:https://stackoverflow.com/questions/5305471/virtual-lamp-server-developing-on-mac-whats-the-best-way-to-achieve-this