开发者

How to run the same project version from windows and ubuntu in my apache localhost

This is for pure curiosity and power control.

I have a project on my localhost in ubuntu (or in windows). Now I want it to run on http://localhost/myproject on both Operating systems. The same version of the project as in edits while using any of the开发者_运维技巧 operating systems will effect the project and you can see the results on any of them.

Is that possible ?

Take Wordpress project as an example ( PHP Project )


The quick and dirty way of doing this is to put your php scripts into a shared directory, configure both webservers to point to that, and point it to a single shared database.

The right way of doing this is to use version control, continuous integration and automated deployment scripts. Then when you check in your code, you can have it automatically roll out to all platforms you wish to test on. I would recommend that you copy your database to each server too rather than connect multiple instances the same database.

I'd question why you want to bother with this at all though - Wordpress is pure PHP/MySQL and runs unchanged on a lot more platforms than just Windows and GNU/Linux.


EDIT: If you're determined to go down the quick and dirty route and you already have your php scripts on the Windows box, just mount your Windows share on Ubuntu, i.e.

mount -t smbfs //windowsbox/webroot /mnt/windows

(plus username/password etc as required)

Then use the Alias directive in Apache

Alias /wordpress /mnt/windows/wordpress 
Alias /myphpstuff /mnt/windows/myphpstuff

Then set up your MySQL so it's listening externally on the Windows box and configure Wordpress to connect to the external hostname of the Windows box (i.e. mycomputername not localhost)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜