From January 2010

Today I set out to get MySQL and PHP setup on my MacBook Pro. Since Apache2 already comes with MacOS X (mine is Snow Leopard and yours should be too!). Now, the funny thing is that I first searched on the web how to best install PHP and MySQL.

Surely, I came across MAMP (a package that gets you Apache2, PHP, MySQL and a couple libraries) in a nice one click application and some others. Being the guy who rather has things separated and controllable, I quickly shined away from those. Thought, I gave MAMP a try, but could not get MySQL to listen to anything else then the internal Apache2 server from the MAMP package (but guess that is another story and I’m really not doing this the first time.). Anyhow…

I then looked into getting Apache2, MySQL and PHP with MacPorts. Thought MacPorts has proven to be perfect in such circumstances, I had a hard time (and it took very long) to get this setup up and running. I’m sure, some of you have had successful installs and all works great, but at the end it did not work for me. There are even more instructions to get PHP running, with a lot of tweaking and such, but to be honest in the end…

Really the simplest and most straightforward method to get Apache2, MySQL and PHP running on MacOS X is;

MySQL

Now, this is really no brainer. All you need to do is to go to http://www.mysql.com and download the recent release. Within the download image you will find a nice installer and Preference pane which lets you start/stop MySQL. If you want to go all GUI, then also download the GUI tools from MySQL.

Apache2/PHP

The probably easiest of it all. Since MacOS X already comes with Apache2 and PHP all you need to do is to enable it. Thought, PHP is disabled in the httpd.conf, all there is to do is to edit httpd.conf and uncomment the mod for the php library.

That’s it!

Nothing to install, (almost) nothing to configure. Simple and easy.

SugarCRM is a good open source CRM, but the overwhelming functions and navigation makes it “sometimes” hard to really get to the one thing you want to do. In any case, it does the job well. Apart from that, I just came upon this error message within SugarCRM:

Warnings: Inbound Email cannot function without the IMAP c-client libraries enabled/compiled with the PHP module. Please contact your administrator to resolve this issue.

This definitely means that PHP is missing some mail libraries, but the message to compile PHP is kinda scary, isn’t it? Luckily, if you are using Ubuntu all you need to do is to issue an “apt-get” command and you are rolling. So here we go:

apt-get install php5-imap

This will install everything for you, make sure to restart PHP (restart Apache or the FastCGI).

Just been going trough a lot of reconfiguration lately and today finished configuring a new server. While testing the mail function we saw in the mail logs the following lines:

javax.mail.MessagingException - 501 Syntactically invalid HELO argument(s)

First we thought, it is the application server or sendmail/exim not being properly configured. But as we soon found out, one simply needs to have a valid hostname set for the server. In other words, this error is commonly caused by the hostname of the machine being wrong compared to what the mailserver expects. Java mail does a getHostName and uses that in the HELO.

And just in case you simply set your hostname with “hostname domain” it will not persist on the next reboot. In order to keep your new hostname you will need to change it in the hostname file itself, as in:

sudo  vi /etc/hostname

Do a reboot and all should be good.

We just moved some of our subversion repositories to a new server and with it changed the URL’s. Now, in order to change any existing checkout version to grab updates from the new subversion server we issued the simple “switch” command from subversion as in:

svn sw svn://svn.domain.com/trunk .

The problem with this was that the system complained with:

svn: 'svn://svn.domain.com/trunk'
is not the same repository as
'svn://svn.newdomain.com/trunk'

The correct syntax to relocate any existing checkout copy is to use the “–relocate” switch as in:

svn sw --relocate svn://svn.domain.com/trunk svn://svn.newdomain.com/trunk 

And we are back in business…