Sunday, August 15, 2010

Windows and Mac on same Network

I have a MAMP Server on my LAN. Browsing to it from within the network, or FTPing to from within the network can be done using the IP address, but that could be dynamic and change (particularly if I take the server home and use it on a different LAN). I browse or FTP to the server from various devices (Windows Vista, Windows XP, iPod, iPhone, iPad. I was going crazy because the apparent computer name was unrecognized in a pattern that I didn't understand. UNTIL NOW !!

Here is the great secret: MAC PROVIDES 2 DIFFERENT COMPUTER NAMES FOR ONE SERVER: ONE FOR WINDOWS DEVICE CLIENTS AND ONE FOR APPLE DEVICE CLIENTS. You find this in Mac System Preferences --> Sharing --> Windows Sharing. At the top it says "Other computers on your local subnet can access this computer at lowername.local". That's for Apple clients. For Windows clients, use the computer name in text field above that message, which can be totally different, which I will call uppername. Even if you force it to be the same, it is still without the ".local".

For FTP, if you highlight Windows Sharing, it says "Windows users can access your computer at \\ipaddress\firstnamelastname". You can substitute the computername for the ipaddress, and now when you browse to the device on the network it prompts you for username and password. Your username is firstnamelastname, which corresponds to the name of your user folder on your mac inside the "Users" folder, and your password is your mac password. Highlighting the various other checkbox sharing options gives you all kinds of useful information for networking in addition to this.

So in summary:
Apple devices browse to: lowername.local:8888
Windows devices browse to: http://uppername:8888

Apple devices ftp to: Surf to uppername within Finder
(Finder --> [Command]-K --> afp://uppername._afpovertcp._tcp.local)
Window devices ftp to: \\uppername\firstnamelastname from either networks, browser, or Windows -->Run.

And of course, you can browse to the MAMP server from the server itself within Safari:
http://localhost:8888

Addendum: MAMP installation puts the root directory by default inside the Applications Folder, in subdirectory MAMP/htdocs. Everything inside Applications folder is inaccessible over FTP. To change the root, go into that little MAMP window and there is a big "preferences" button on the lower right (below Stop Servers, Open Start Page). Go to Apache tab. Change document root to /Users/firstnamelastname/htdocs and of course move the entire htdocs folder to that location. Also note that the default port is 8888 with MAMP. That can be changed to a different port if necessary, but you have to include the port after a colon in MAMP. (Be aware that WAMP uses a different port by default, I think 8080, and you can get away with omitting the colon and port number in WAMP).