Remons TechNotes

Development WebServer on OSX Lion

So you found yourself in need of a development server (or maybe a regular production server) on your Mac… Well, good for you, because your mac can do it all. I found myself in need of it as well and wanted a stable Apache2/PHP5/MySQL installation with the PHP SVN PECL module installed. (because I want to fool around with our SVN server :) )

I can tell you 4 ways of getting a real, life ‘n kickin’, web server on OSX.

1. Use MAMP

MAMP is probably the least painless but also the least compatible. I’ll tell you the pro’s and con’s.

PRO:

CON:

MAMP PRO is a bit better but it’s commercial.

PRO:

CON:

Advice on MAMP:

Use it when you have no choice, discard and use the options below for a more stable environment. And MAMP Pro?? not worth the money, use the free version and buy VirtualHostX instead.

2. Macports Apache/MySQL/PHP

This is a bit more tricky to set-up. There is some planning involved and you can find decent guides on the internet everywhere. Just google it.

Software:

PRO:
  • It works like a charm; all files are placed in /opt so no system parts are touched. Macports will adjust your system config to use the newly installed software
  • All latest software built for your system
CON:
  • Software that uses the built-in Apache/PHP other than via the webserver will need configuring to use the Macports version
  • The SVN PECL module? no dice. Not available in Macports – or so it seems after 48 hours of googling (not all in one day :P )
You still have to use a program like VirtualHostX to set-up virtual hosts on your server.

3. A hybrid version

Just use MySQL from Macports, and the rest from OSX

PRO:

CON:
  • Still need to tell PHP where to find your database server socket.
  • Still no SVN support

And indeed, you still have to use a program like VirtualHostX to set-up virtual hosts.

4. My favorite; use the built-in Apache and PHP and MariaDB for a super-fast 100% MySQL compatible database.

PRO:

And again, you will still need VirtualHostX (or similar) to maintain your virtual hosts

Ow, and a final note;

When trying out VirtualHostX and you find your hosts don’t work? Downgrade to version 2.x of VirtualHostX, it works like a charm!

Ow, p.s. don’t forget to grant access to your databases.

Exit mobile version