Help me get OSX and Debian (under VMWare) playing nicely together for web development
January 23, 2008 7:22 AM   Subscribe

Trying to set up a development environment on my Macbook (running latest Leopard). I have VMware fusion running Debian etch, set up perfectly with the requisite LAMP stack. The problem is, I'd like to have Debian's /var/www/ available to OSX for actual editing. I've tried setting up NFS, but to no avail (though I'm admittedly novice at this sysadmin stuff).

I've also attempted to setup up simple FTP between OSX and Debian, but that's proven fruitless (probably due in part to my frustration level at the time).

My ideal situation:

/var/www on Debian is mounted as ~/webserver on OSX, where I have complete read/write access (as my regular user, not requiring any root authentication nonsense every time I save). Make a change in TextMate, save, refresh browser viewing site served up by Debian, the change is there.

Am I asking for the impossible?
posted by inkedmn to Computers & Internet (8 answers total) 1 user marked this as a favorite
 
Is there a reason why you don't run the AMP part of LAMP directly on your MacBook?

Anyway, what you want to do should be pretty easy to set up with either NFS or SMB. I prefer NFS because it's a bit more seamless.

Here's a quick and dirty way on how to do it in NFS:
In /etc/exports on the Debian box, put this line:
/var/www 10.0.0.0/255.255.255.0(rw,no_subtree_check,all_squash,anonuid=1000,anongid=1000,insecure)
Replace 10.0.0.0/255.255.255.0 with the network/subnet that VMware is using to talk to your MacBook. Replace anonuid and anongid with the uid/gid of the user that you want to be on the Debian machine. To get these, look for your user name in /etc/passwd on the Debian machine. Once this is done, restart the nfs server. Note that these options are very insecure, but as long as your Debian machine is kept within the confines of VMware you should be OK.

On the Mac in Terminal, cd into /net/[ip address of Debian box]/var/www and do an ls. Are your files there? Great. Go back to ~ and do ln -s /net/[ip address of Debian box]/var/www webserver. Tada—you can now get to those files in TextMate. And since this is all done with the autofs feature built into Leopard, you will never have to screw around with manually mounting anything.
posted by zsazsa at 7:48 AM on January 23, 2008


Also, from your original question it seems like you can't write to the files in /var/www when you're not root. That's easy to fix. As root, go to /var/www and do chown -R username . with your user name substituted for username. That'll make everything under /var/www belong to you so you can write to it, create new directories, all as you instead of root.
posted by zsazsa at 7:53 AM on January 23, 2008


The easiest would be setting up Samba, configuring a share, and mounting that in OSX. (Finder -> Connect to Server smb://x.x.x.x/sharename


Another method about the same complexity would be to set up WEBDAV on apache on debian, and attaching in a similar manner (http://x.x.x.x)

Another would be to use sftp (ssh)... use fugu or cyberduck on osx and you can edit direct to textmate and it will take care of saving/uploading. If it's all just vm.. maybe use root (Blasphemy, I know.)
posted by TravellingDen at 7:56 AM on January 23, 2008


@zsazsa

Well, the webhost where my apps will ultimately live is a Debian etch install, so I was wanting to mirror that configuration as closely as possible for my dev environment. Also, I like that I can easily turn off all of the web-ish stuff by simply suspending VMWare instead of having to stop a bunch of services under OSX.

One question - will changing the owner of /var/www affect apache's ability to use the files?

Thanks for the great tip - I'll be sure to try it out when I get home tonight!
posted by inkedmn at 7:59 AM on January 23, 2008


Changing the owner of /var/www shouldn't affect Apache at all. It's what I do on every web server I run because becoming root to do web stuff is a pain and is unsecure to boot.
posted by zsazsa at 8:03 AM on January 23, 2008


Argh, there's no reason to change the ownership of /var/www. I'm willing to bet it's owned by the www or www-data group, to which you should merely add yourself (try /usr/sbin/vigr).

I'd just use fink to set up your LAMP stack on the MBP.
posted by kcm at 8:18 AM on January 23, 2008


kcm: aww man, why didn't I think of that?
posted by zsazsa at 8:53 AM on January 23, 2008


Doesn't VMWare Fusion have shared folder capabilities, even on Linux once you've installed the VMWare Guest Tools?
posted by mkb at 9:17 AM on January 23, 2008


« Older Airline Woes: When should airline passengers...   |   Since the weekend, everytime I swallow I get an... Newer »
This thread is closed to new comments.