Quantcast

Forums | MacLife

You are not logged in.

#1 2007-08-23 8:39 am

chipper
Member
From: Abroad
Registered: 2001-08-29
Posts: 251
Website

MAMP, Parallels, Wordpress on a MacBook Pro

Alright, I've got a bit of a complex problem, and I've found bits and pieces to the answer, but I need help putting it all together. I have found that the the help given to me and others around these parts is quite helpful, so I'm trying here first.

Here's my situation: I want to develop Wordpress themes/Joomla templates on my MacBook Pro - locally (i.e., running from my own machine). Ideally, I'd like to be able to move my computer from my home, to my office, to the coffee shop we visit, to possibly an airplane – regardless of what network I’m on, or if I’m not on one at all. But to just make everything harder, I want to be able to see everything in Parallels (for testing).

So, I found MAMP, which allows me to set up a local install of Wordpress & Joomla. Works great - when I'm on the mac side- Safari and Firefox show the sites beautifully. (I'm going to assume that anyone here who will be in a position to help has used and understands MAMP) For the sake of explanation, I installed Wordpress in the MAMP htdocs folder under the directory "wordpress".

The next trick was being able to see the sites when I'm in Parallels, using IE. I found out that all one has to do is instead of using the URL "http://localhost:8888/wordpress" (this is the standard procedure with MAMP) - you would use the IP address of your mac in lieu of "localhost", that is, in IE you would enter "http://192.168.X.XXX:8888/wordpress". That SORT of worked.

The problem was that since the CMSs that I was using have self-referencing URLs for things like style sheets. So, when I opened my test sites in IE (in Parallels), the site would show up, but completely unstyled. Which kind of defeated the point of the whole exercise - I'm designing using CSS, and that’s what I’m really testing.

So, I found a solution that works at least when I’m at home – and using our wireless network. First off, I found my computer’s IP address on the network – 192.168.a.bcd.

I edited the configuration files of both CMS’s to use that IP address as the root url, i.e.: 192.168.a.bcd:8888/wordpress (in the options menu in Wordpress) and opening joomla’s configuration.php file, and putting 192.168.a.bcd:8888/joomla for it’s “live site” setting.

Now the test sites show up fine on both the Mac side and the Parallels side, completely styled. Works wonders. On both sides, I simply enter "192.168.a.bcd:8888/wordpress" and everything displays as it should.

The problem though, is when I leave our home network, which is daily. And if I’m not getting a network signal at all, this solution is shot. If I'm on another network, I could in theory change the config files again, but that would be a royal pain to do every time.

That’s the point that I’ve gotten to. I’ve found some part-solutions on the internets, including editing the httppd.conf file (under /etc/httpd/) in Mac OS X to add a NameVirtualHost (around line 1063), but that didn’t seem to affect anything. I've reverted it to it's default state.

I’ve also seen people recommend editing the “hosts” file in Windows XP (WINDOWS/system32/drivers/etc). My problem is I can’t quite figure out what to add.

So, does anyone have any suggestions?? I’m stumped and really and the end of my rope on this one.

I’m thinking I’m not grasping something obvious. Any help or direction would be greatly, greatly appreciated. Thanks in advance!

Offline

 

#2 2007-08-23 10:13 am

Gipetto
Yankee Doodle's noodle
Royal Wombat
From: People! Ahg!!
Registered: 2000-09-24
Posts: 9941
Website

Re: MAMP, Parallels, Wordpress on a MacBook Pro

First: read this series. Take notes if you need to. Everything you need to set up the computer to respond properly is in there.

This will tell you how to set up a name based virtual host. You can pick any name, but I like to take what will be the public name and attach .local, ie: if the server is my-server-name.com, I'll do it with my-server-name.local. You might want to do something like wordpress.local and joomla.local to point to the respective installs you have.

After that use the hosts file trick in Parallels. What you're gonna want to do is use the IP address that is assigned to OS X via the 'host only networking' (its in the Parallels manual, it is basically a private loop between the MBP and Parallels) and assign the ip address to the local domain name you set up.

This is how I develop and it works perfectly, it just takes time and research on your part - its a medium length process, but since there are resources that say it already I'm not gonna elaborate too much.

Last edited by Gipetto (2007-08-23 10:13 am)

Offline

 

#3 2007-08-23 11:32 pm

chipper
Member
From: Abroad
Registered: 2001-08-29
Posts: 251
Website

Re: MAMP, Parallels, Wordpress on a MacBook Pro

Gipetto,

Thanks for your response. I may need a little more guidance, though - I scanned the six articles and never saw anything about name based virutal hosts. Did I miss something??

I'm poking around a little bit more - any other places that might point me in the right direction?

Offline

 

#4 2007-08-24 11:19 am

chipper
Member
From: Abroad
Registered: 2001-08-29
Posts: 251
Website

Re: MAMP, Parallels, Wordpress on a MacBook Pro

Well, I've made some progress! I wasn't really able to follow that article, but I found a helpful expalation of setting up a virtual host here at the MAMP forum. So, I've altered my etc/hosts file, created a virtual host named "mysites.local". I've also altered the MAMP httpd.conf file to add the virtual host. So, now, if I open a browser on my mac side, I just type in "mysites.local:8888/wordpress" and voila, the site appears. So, now that I have that first part figured out:

Gipetto wrote:

...
After that use the hosts file trick in Parallels. What you're gonna want to do is use the IP address that is assigned to OS X via the 'host only networking' (its in the Parallels manual, it is basically a private loop between the MBP and Parallels) and assign the ip address to the local domain name you set up.

This is where things get murky for me. I've got the hosts file open under windows, but I'm still not clear on what I should put in the file. You say the IP address assigned to OS X via "host only networking". So, which IP address is that?? Is that the Parallels Host-Guest IP address (10.37.129.2 according to my network system preference)?

I did check the Parallels manual, and it didn't specify where to find the IP address you're referring to - it says where you can specify a range of IP addresses (Parallels>preferences>network), but not "hey, this is your Mac's IP address". Is it the same thing?

___________

Never mind, I figured it out. I set Parallels to use "host only networking", and now it can see my development sites just fine using the URLs I created. The only bummer is that I can't actually connect to the internet while in Windows now. Honestly, it's not that huge of a loss for me, but is there any way to get around that?? Is that a firewall issue? I know I can hope back and forth on the connection while in Parallels; it's just a small annoyance.

Offline

 

#5 2007-08-24 12:47 pm

Gipetto
Yankee Doodle's noodle
Royal Wombat
From: People! Ahg!!
Registered: 2000-09-24
Posts: 9941
Website

Re: MAMP, Parallels, Wordpress on a MacBook Pro

Turn off host only networking and go back to shared.
Open the System Preferences in OS X and then open the Network pane. You'll see a Parallels NAT entry - the IP address in there is the IP address you want to give Windows' HOST file. Then it'll see both the local machine and the rest of your network.

Offline

 

#6 2007-08-24 12:49 pm

Gipetto
Yankee Doodle's noodle
Royal Wombat
From: People! Ahg!!
Registered: 2000-09-24
Posts: 9941
Website

Re: MAMP, Parallels, Wordpress on a MacBook Pro

Oh, and glad to hear you got it running. I didn't realize those articles didn't mention named virtual hosts.

Offline

 

#7 2007-08-24 7:11 pm

chipper
Member
From: Abroad
Registered: 2001-08-29
Posts: 251
Website

Re: MAMP, Parallels, Wordpress on a MacBook Pro

SUCCESS!! Ha ha!

You, sir, are both a scholar and a gentleman!

Whew! I've been trying to get this to work for the better part of a week, and now it all works great. Thank you so much!!

Offline

 

#8 2008-02-10 9:49 pm

chipper
Member
From: Abroad
Registered: 2001-08-29
Posts: 251
Website

Re: MAMP, Parallels, Wordpress on a MacBook Pro

UPDATE:

Okay - this was working great a few months ago, but my situation has changed, and now I'm stuck again.

Here's my current configuration:

I'm running Mac OS 10.5.1
Instead of parallels, I'm running windows using VMWare Fusion
I'm still using MAMP to run my test wordpress sites locally.

What I'm looking for is a way to:
1. Be able to test my local wordpress install from Fusion, so I can test themes in IE
2. Be able to do said testing from any location; I'm still running all of this on my Macbook Pro, which hops from network to network throughout the day. Sometimes, I have no network connection at all.

Unfortunately, in the upgrade to leopard and change to Fusion, several things have changed.

First off, the way Leopard displays your network info is annoying, and to be honest, more confusing than before. I mean, to find your IP address, you have to go to "advanced" in the network pane - it used to be the first thing that came up.

second, vmware fusion handles it's networking slightly differently. at least, the nomenclature is different enough to confuse me.

to summarize what happened in this thread earlier - what you really need to do is edit the HOSTS file in the windows installation. It can be found at:

C:\Windows\system32\drivers\etc\hosts

but before, there was an easy to find IP address in Mac System Prefs - it was under the network pane and listed as "parallels-guest". However, now, in Leopard, and with Fusion, there is no such entry in the network pane. so, i'm confused.

when I edit my HOSTS file, what should my entry be? should I list the IP address that windows itself has under fusion (it's 192.168.113.128)? or is it a different IP address altogether?

any help is greatly appreciated! Thanks!!

Offline

 

#9 2008-02-11 6:53 am

chipper
Member
From: Abroad
Registered: 2001-08-29
Posts: 251
Website

Re: MAMP, Parallels, Wordpress on a MacBook Pro

Further update -

I figured out what had to be entered in the HOSTS file. So it works - kinda.

I'm unable to see my wordpress installation, even though I can see other things running under MAMP.

Is anyone else trying to have a setup like mine?

Offline

 

#10 2008-02-11 7:11 pm

Abu
Disheveled, Quite.
Royal Wombat
From: Minnesota, USA
Registered: 2000-02-06
Posts: 8764
Website

Re: MAMP, Parallels, Wordpress on a MacBook Pro

I have the same setup as you, but I'm running Parallels instead of VMware. It should work regardless, though. Here's what I've done.

* * * * * * * *
MAMP httpd.conf file

Code:

NameVirtualHost 127.0.0.1
NameVirtualHost 192.168.0.3
NameVirtualHost 10.211.55.4
Listen 80

I've got MAMP running on port 80 for simplicity's sake. It could certainly run on others, but I found this to be easiest. I'm sure the more experienced server admins will tell me that I've got a major security hole going here. I dunno.

I've got three Virtual host IPs set up. The first is for local requests, the second for requests forwarded from my router, and the third is for Parallels.

Code:

<VirtualHost 127.0.0.1 192.168.0.3 10.211.55.4>
    ServerAdmin me@joelschou.com
    ServerName fuzzycoconut.sucrose
    #ServerAlias fuzzycoconut.joelschou.dyndns.org
    DocumentRoot /Applications/MAMP/htdocs/fuzzycoconut.com
    ErrorLog error.log
    Options Indexes MultiViews Includes
</VirtualHost>

I have a whole pile of VirtualHosts set up for my different sites. Every entry looks something like this. My computer's name is sucrose, so I use .sucrose for a TLD instead of .local for fun. You can use any phony TLD you want.

Note that I have all three aforementioned IP address in the <VirtualHost> declaration. Note also the line that is commented out. I use dyndns.org and port forwarding on my routers to allow connections from the outside world (hence the 192... IP). I've disabled it for this site.

* * * * * * * *
hosts file on my Mac

Code:

127.0.0.1 192.168.0.3 fuzzycoconut.sucrose

This just tells my Mac to which IP addresses to map a request for fuzzycoconut.sucrose.

* * * * * * * *
Getting Parallels to work
As you may have gathered, the local IP address of my Mac is 192.168.0.3. I have Parallels set up with Shared Networking, so it obtains its IP from OSX. Parallels also tells Windows that my Mac's IP is 10.211.55.4. This is where your "moving around from place to place with the MB" problem should get fixed. I assume VMware does something similar.

* * * * * * * *
hosts file on Windows

Code:

10.211.55.4 fuzzycoconut.sucrose

This points all requests for my custom TLD at my Mac.

* * * * * * * *
Adding a new site
Every time I set up a new site in MAMP, I create a new VirtualHost entry in my httpd.conf file and add the new domain with fake TLD to the hosts files on both OSX and Windows. A short restart of MAMP later and I'm set to go.


Look at it this way: you've sold as many paintings as Van Gogh—and you have both your ears.
Thanks, Dad.


www.joelschou.comwww.bothears.comwww.vault25.comwww.fuzzycoconut.com

Offline

 

Board footer

Powered by PunBB 1.2.6
© Copyright 2002–2005 Rickard Andersson