Using windows file system for web development on ubuntu
I have a dual boot Win XP & Ubuntu configuration.
I've recently revived my Ubuntu installation and upgraded to 11.04 after it became corrupted a couple of years ago.
I do web development under php, apache & mysql on my XP setup, and wanted to do the same on my Ubuntu installation, so I installed all the relevant software and everything is working.
BUT, here is my question:
Can I use my existing web site documents on my windows drive for development under Ubuntu? The file system is mounted and I can see all the files, but I'm aware linux uses different permissions (the chmod bit flags etc) so I guess I cannot chmod them to what they need to be? I kept getting unauthorised errors from apache, so copied my web root folder from my XP drive to my linux drive, then I could set the permissions and everything worked. But I wondered if there is any way I can get this to work without copying my files?
Funny, that's almost exactly how I work: my system is a dual-boot, WUBI system (WUBI: linux filesystem is a single NTFS file). All of my configured DOCUMENT_ROOTs are symbolic links to regular NTFS directories. I've had no problem getting Apache to serve them up properly, whether I boot to Ubuntu or Windows.
(I *do* have separate Ubuntu & Windows Apache installations, of course, each with its own set of config files.)
I use SSI on some projects, so files need to be marked executable; but chmod seems to work happily on those NTFS files. When you use chmod on your Windows files, does it complain, fail silently, pretend to succeed? What does ls report about those files?
You could try setting the "uid=xxx" and "gid=yyy" option in /etc/fstab. ( Replace xxx and yyy with the apropriate UID and GID. ) This will make xxx and yyy owner and group of ALL files on the drive.
You can also set the "umask=" option in fstab to further restrict file permissions based on the owner and group. ( Ex: umask=027 yields permissions of 750 ) Note that this will still affect ALL files and directories.
Example /etc/fstab entry:
/dev/sda1 /mnt/windows ntfs uid=105,gid=108,umask=007
I presume this is just for development and testing? I would not recommend this on an apache installation that's reachable from the internet, for security reasons.
chmodding doesn't report any errors, but when I examine the permissions afterwards, it hasn't changed and stays at 700 or drwx------ for folders and 600 for files.
I think you are right - it is something to do with the way my xp drive is mounted. I unmounted it and then mounted it manually and specified umask=000 and I was then able to set permissions, and apache would serve the files.
Annoyingly this drive does not auto mount on boot up so there is no entry in fstab. I will have to do some research to see what I need to add to it.
Yes, this is for dev only.
|All times are GMT -5. The time now is 03:47 AM.|