How do I host multiple websites on a Mac?

0

I work on several PHP and JSP websites on my MacBook (running development Apache server and Tomcat) and they all are hosted on shared servers.

What I want to do is to clone my MacBook to a Mac mini server, connect it to a separate cable modem and router, assign a static IP to it and run a production server here in my office.

One of my registrars lets me edit DNS records, so I guess I can just point the DNS to that static IP and manage the rest with virtual hosts, right?

Another registrar only lets me edit nameservers. It seems like I can run a DNS server on Mac; is it a simple thing to do?

Is it feasible, then, to host multiple websites on a Mac in this manner?

dfo

Posted 2011-06-23T18:56:34.873

Reputation: 133

Answers

0

Hosting websites on a Mac is pretty much the same as doing it on any *nix host.

You can install MAMP, giving you Apache, PHP, Mysql in one shot or you can run the native install of Apache that comes pre-packaged into OSX. If you're new, I'd suggest the MAMP route, as it takes care of most of the nitty-gritty details for you. MAMP doesn't have Virtual Hosting enabled by default, but it's easy enough to configure. From there, you can setup Virtual Hosts and point them to different directories and you're off! Once that's done, just setup A records on your DNS server and point them to your IP Address.

For help on setting up Virtual Hosts in MAMP, see Here

nageeb

Posted 2011-06-23T18:56:34.873

Reputation: 186

I already have apache, php, mysql and tomcat running on my development machine. I wasn't sure if just editing httpd-vhosts file would do... Also, I'm mostly concerned with the DNS. – dfo – 2011-06-23T22:27:29.980

Although your answer is very encouraging, Thanks! – dfo – 2011-06-23T22:27:59.730