Forum
MAMP and Perch
Hi there! I've been following the "How can I install a server to run Perch on my computer?" article and it says i should be setting up a VirtualHost by going through Terminal. I already have another site in there so I assume I need to set up VirtualHosts if I am to install my perch site in there too.
Can I not just copy my new perch site into the htdocs folder inside MAMP and point in towards a different database?
Sorry I'm just a designer and don't know what a VirtualHost is exactly or why I need it set up as the other site already works fine from copying it into htdocs.
Thanks for any help
Jake
If you want to make life easy, MAMP PRO just has a point and click interface for setting up multiple sites. That could be a good option.
I'd second Drew in recommending MAMP Pro. It'll make your life much easier and remove a lot of the technical aspects from setting up Perch (and any other site) locally.
Hey I appreciate your responses but generally like to know why stuff works. I think I'm nearly there but my vhosts.conf file has the NameVirtualHost *:80 set already but all the examples I see don't reference this part so not sure whether to comment it out or not.
Will get there - just a shame there's not more documentation on it as would have thought most people would practice with Perch locally
So the *:80 is a port number. You can change it if you want, but it's usually used as a way of serving several different websites to the same address. Think of them as extension numbers off a master phone number. The best thing to do is leave it is as *:80 to avoid running into using a port that's already in use and the headaches that can cause.
It's unlikely you'll need to worry about port numbers unless you're doing something complex - and that would likely require Perch Runway to avoid unnecessary complications - or using something like MAMP to
I agree there is a level of assumed knowledge when it comes to Perch. But it's also arguable that vhosts aren't necessarily something that should fall within the remit of Perch's docs as it's much more a server thing.
My vhosts file has around 120 different sites in it. A couple of examples are:
and
The # simply comment them out as they aren't being used. If I want to use one, I simply remove them from the lines and add them to the one that was switched on.
Thanks for that Ben. Absolutely perfect
J
Thanks Ben!