I'd like to have ubuntu and windows share my htdocs and mysql databases for local development. This isn't a web-facing site, just for personal development use. Is there a way to do this? Is this a terrible idea?
Ubuntu – Make Linux and Windows share localhost (webserver) files and database
dual-bootwebserver
Best Answer
When I first did this I had a lot of problems getting my LAMP stack to play nice with my WAMP stack - I got a lot of "you're not allowed to access this" errors when I navigated to localhost.
I tried various apache virtual host configurations, none of which allowed me access to the files.
What worked was to use
mount --bind
to put my windows folders into the corresponding linux folders. If this works, you'll notice the default ubuntu landing page for localhost replaced with the "it works" from windows. Note that any linux files will be hidden by windows files with the same name.I have an
fstab
entry that mounts my windows partition to/media/windows
.The solution was to
Mount and Bind the files into the correct locations:
First, make an "upstart file" with these contents as mentioned here.
Run this in terminal:
Paste this into it, changing the ... to the path to your htdocs. Obviously, test these commands in terminal to be sure you have the paths right. The linux file locations are the important bit.
With these two commands I got close, but InnoDB was preventing mysql from starting. The problem is the InnoDB log file size check. An easy solution is to have one OS use a different log file than the other. Otherwise only the most recent os will start mysql. You could also delete the files every time you start or shutdown, but it's easier just to keep separate logs. They share changes just fine, just not log files.
Change MySQL log file location
In Ubuntu, in
/etc/mysql/my.cnf
, add this line in the InnoDB section:That solved it for me.
Caveat: linux is more "case-sensitivey" than windows. Where windows will happily go grab an image with different capitalization and serve it, linux won't. Of course, real web developers always are exact in their capitalization.