多重启动时共享 Apache / MySQL / PHP 设置
简而言之:
我有一台装有 Win XP、Windows 7 和 Ubuntu 的多重启动计算机,我希望我的本地主机 Web 项目能够由所有三个操作系统共享。
详情:
我最终想摆脱 Windows XP 来进行 Web 开发工作,但我的本地 Apache + PHP + MySQL 堆栈与我的旧操作系统绑定在一起,我花了一些时间思考如何将这个设置调整为现在的样子。
如果我可以将数据库和 Web 文件放在独立于当前操作系统的位置,那就太好了,这样我就可以使用不同的操作系统重新启动并继续处理相同的项目。
理想情况下,我还想保留和共享其他应用程序的设置和文件(Firefox 插件、Opera 键盘快捷键、邮件和聊天帐户、Eclipse 设置等),但这可能是另一个问题。
如果可能的话,我希望避免严重的性能影响。
最后,一旦我选择了一个解决方案,如果我能找到一种简单的方法将设置从 Windows XP 设置移植到新的共享环境,那就太好了。特别是:数据库、htdocs 文件夹、虚拟主机设置。
VirtualBox 或 vmware 是解决方案吗? 或者带有便携式应用程序的东西? 或者我应该在每个操作系统上运行单独的 Apache / MySQL / PHP,然后让它们共享其设置和 htdocs 文件?
谢谢!
In short:
I have a multiboot machine with Win XP, Windows 7 and Ubuntu, and I would like my localhost web projects to be shared by all three OSes.
Details:
I finally want to get rid of Windows XP for my web development work, but my local Apache + PHP + MySQL stack is tied to my old OS, and I spent some time and thinking to tweak this setup up to the way it is now.
It would be great if I could have the databases and web files in a location that is independent of the current OS, so I can reboot with a different OS and continue working on the same projects.
Ideally I would also want to keep and share settings and files for other applications (Firefox addons, Opera keyboard shortcuts, Mail and chat accounts, Eclipse settings etc), but that's probably another issue.
If possible, I would like to avoid serious performance hits.
And finally, once I pick a solution, it would be nice if I can find an easy way to port settings from the Windows XP setup to the new shared environment. Especially: databases, htdocs folders, vhost settings.
Is VirtualBox or vmware a solution?
Or something with portable apps?
Or should I run separate Apache / MySQL / PHP on each OS and then make them share their setup and htdocs files?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
尝试使用多重引导时,您会发现困难多于好处。
您可以尝试的解决方案(我当前使用的)是虚拟机。我在使用 VMWare 的虚拟机上有一个 WAMP 堆栈,其他虚拟机用于不同目的,并且所有与 AMP 堆栈虚拟机的对话都作为 Web 服务器。
您可以选择在物理机或虚拟机之一上进行开发。您还可以在不同操作系统中共享相同的 VM 实例(取决于您选择的 VM 软件)。
在我将 WAMP 堆栈与物理机和开发环境分开后,这对我来说非常有用,因为我现在可以在错误/实验配置后炸毁或穿越我的 WAMP 虚拟机,同时不会影响操作系统性能或需要更多文件存储库。
You will find more difficulties than benefits trying to work on multiboot.
The solution (I current using and) you can try out is virtual machine. I have a WAMP stack on a VM using VMWare, other VMs for different purposes and all talks to the AMP stack VM as web server.
You have choice to develop on your physical machine or in one of your VM. You may also share the same instance of VM in different OSes (depends on the choice of your VM software).
This worked out great for me after I seperate my WAMP stack with physical machine and development environment as I now can blow up or time travel my WAMP VM after mis-/experimental configurations while not effecting os performance or have to more file repository around.
同样在这里,正如rockacola所说,它有它的困难,但有解决方法。
您可以通过编辑 Apache2 配置来更改本地主机路径,在 Ubuntu 中编辑
/etc/apache2/sites-available/default
处的文件并更改 DocumentRoot 值。另外符号链接
可能是个好主意。您可以将 XAMPP/WAMP 安装的 MySQL 数据文件夹复制到 Ubuntu 中的
/var/lib/mysql
中。 rsync 可能是 MySQL 数据同步问题的一个很好的解决方案。我还有一个脚本可以跨操作系统定期同步 MySQL 数据文件夹。Same here, as rockacola said, It has its difficulties but there are workarounds.
you can change your localhost path by editing Apache2 configs, in Ubuntu edit the file at
/etc/apache2/sites-available/default
and change your DocumentRoot value. Alsosymlinking
could be a good idea.You can copy the MySQL data folder of your XAMPP/WAMP installation into
/var/lib/mysql
in Ubuntu. rsync might be a good solution for MySQL data synchronization issue. Also I have a script to periodically synchronize the MySQL data folders across OSes.共享配置文件会带来更多的麻烦而不是其价值。只是分享 htdocs,那是另一回事了。
我自己也看到类似的问题。真正的问题是MySQL。 AFAIK,MySQL 表数据不可移植。
您将需要使用 phpMyAdmin 或其他工具将数据从一个操作系统复制到另一个操作系统。我假设您正在使用 htdocs 的 Windows 分区并在 Ubuntu 中对其进行符号链接。
这应该不是问题,但如果文件需要文件系统访问权限或其他内容,请确保文件的权限设置正确。
Sharing config files will be more trouble than it's worth. Just sharing htdocs, well that's a different story.
I see a similar problem myself. The real problem is MySQL. AFAIK, MySQL table data is not portable.
You will need to use phpMyAdmin or something to copy the data from one OS to another. I am assuming you are using the Windows partition for htdocs and symlinking it in Ubuntu.
This should not be a problem, but be sure permissions for the files are set up right if they need filesystem access or something.