Ditch MAMP on Snow Leopard

I was fond of the stack XAMPP offered when I developed on Windows and lazily continued used XAMPP/MAMP once I moved to a Mac OS X based workstation. Unfortunately, the latest releases of MAMP have attempted to restrict the utility of the stack in an effort to raise revenue through a less restricted "Pro" version. Developers on Snow Leopard are much better off moving to standalone installations of everything MAMP offers. There are many ways to install PHP, MySQL, Apache, and phpMyAdmin - all with a list of pros/cons. Without debating the merits, here's what I did to replace MAMP:

1. Dump your MAMP Mysql databases and save them for import into your standalone MySQL install

mysqldump --all-databases > ~/old-mysql-data.sql

2. Install a more recent copy of MySQL server than the one delivered with Snow Leopard

I already had macports installed, so the choice here was easy. The following command installs the mysql binaries under /opt/local/bin/ port install mysql5 mysql5-server

3. Import your data into your new MySQL database

First, be certain to shutdown all the MAMP servers (MySQL, Apache, etc...) - then start your new standalone MySQL sudo /opt/local/bin/mysqld_safe5 & Finally, run the following: mysql

4. Install phpMyAdmin on the SL delivered Apache installation

Install it fresh, or just copy your MAMP installation to ~/Sites where it will be available under http://localhost/~your-username/

5. Enable PHP5 on the SL delivered Apache installation

Open /etc/apache2/httpd.conf and enable the line: "#LoadModule php5_module libexec/apache2/libphp5.so" by removing the pound. Then in the Mac System Pref -> Sharing, turn on (or if it was already on, turn off/on) Web Sharing. If you need to move any vhost or SSL config directives from MAMP to the SL Apache install, you'll make those changes to files in /etc/apache2/extra/

6. Optional - Configure PHP by creating a php.ini under /etc

I'm content to use the PHP installation already delivered by SL, but there is no default php.ini - simply create one under /etc and it'll be read automatically. You can now remove the MAMP training wheels and proceed developing with full standalone versions of your stack - happy trails.
Posted by Eric Simmerman
 

Connecting to Netscreen Series (NetScreen-5) VPN with Mac OS X (Snow Leopard)

(Followup to my NetScreen-5 from Ubuntu article) I recently struggled through the details of establishing a VPN connection from my Mac OS X desktop to a Juniper Networks Netscreen-5. Here's how I solved it. My Netscreen-5 was configured with some typical settings: Phase 1 Pre-shared key "your-pre-shared-key-here" Encryption "pre-g2-aes128-sha" Phase 2 Encryption "g2-esp-3des-sha" To configure the client-side using an Ubuntu desktop, I used Racoon and KVpnc but didn't have the luxury of KVpnc on my Mac desktop so I had to manually edit my racoon.conf:
log debug2;

path pre_shared_key "/etc/racoon/psk.txt";

path certificate "/etc/racoon/certs";

timer
{
        natt_keepalive 10 sec;
}

remote VPN.GATEWAY
{
        exchange_mode aggressive;
        nat_traversal on;
          ike_frag on;
        peers_identifier asn1dn;
        proposal_check obey;
        my_identifier user_fqdn "YOUR.EMAIL.ADDRESS";

        proposal {
                encryption_algorithm aes;
                hash_algorithm sha1;
                authentication_method pre_shared_key;
                dh_group modp1024;
        }
}

sainfo address DESKTOP.IP.ADDRESS/32 any address VPN.GATEWAY/28 any
{
        pfs_group modp1024;
        encryption_algorithm 3des;
        authentication_algorithm hmac_sha1;
        compression_algorithm deflate;
}

listen
{
 adminsock "/var/run/racoon.sock" "root" "operator" 0660;
}
Posted by Eric Simmerman
 

Eclipse Galileo unable to read Subversion repository

After a clean Snow Leopard install on a new machine, I fired up a fresh Galileo Eclipse and pointed it at a copy of my old workspace.  I first encountered and resolved the missing Mac OS X JRE issue described in my last post, only to then find that my existing subversion repositories were inaccessible in the new Eclipse install. I hopefully added "-clean" as the first parameter of my eclipse.ini file and restarted but the situation remained unchanged. Undeterred, I launched eclipse from the command line with a -clean startup parameter and this did the trick: /Applications/<your install dir/Eclipse.app/Contents/MacOS/eclipse -clean
Posted by Eric Simmerman
 

Missing MacOS X VM in Eclipse Galileo on Snow Leopard

I recently encountered an issue where I was unable to add a JVM to my Eclipse install on Snow Leopard. There was no MacOS X VM option under Installed JREs -> Add and attempting to use the Standard VM resulted in an error. After digging around in Eclipse bug reports, I discovered this is a known issue with the Cocoa build of Galileo with PDT pre-installed.  The easy fix is to install Eclipse without PDT (just install the Eclipse IDE for Java - Cocoa 64 bit) and add PDT plugin later. When you take this route, the MacOS X VM will be configured automagically.
Posted by Eric Simmerman
 

Copy/Paste clipboard broken on Snow Leopard

After a recent Apple update, copy and paste quit functioning on my Snow Leopard install. After a number of red herrings, I eventually traced the issue to Synergy and noticed that synergyc constantly emptied my clipboard immediately after any copy operation. I was running synergy 1.3.1 at the time which was released back in 2006 - I was hopeful that the latest release of the Synergy fork Synergy Plus might provide a quick solution. An install of synergy-plus 1.3.4 Darwin binary did not resolve the issue and a build of the latest from subversion (r252) would not run for me (separate issue - synergyc unable to resolve server address). I happened upon this thread in my search for an answer and based on comments there decided to build revision 242 for my Mac client and run 252 on my Ubuntu server. Happy to report it resolved my issues. One note - I was thrown for a bit when my first Xcode build resulted in 14 compile time errors. Turns out it was necessary for me to build for i386 as the 64-bit build would not compile for me. UPDATE: After a couple weeks use, I found the synergy-plus binary to be rather buggy and went in search of a solution. MacPorts supports a patched build of synergy 1.3.1 for Snow Leopard and so far it is working beautifully. Assuming you have ports installed, the following will install the tried and true synergy.
port clean synergy ; port install synergy +universal
Posted by Eric Simmerman
 

Subversion, Jira, Sonar, Hudson & Fisheye on Mac OSX Server with Snow Leopard

Here are some notes from the field on setting up all these development services to play nice on Mac OS X Server 10.6:
  • Use this excellent writeup from Apple to get Subversion setup as a webservice. Note the comment about how the DAV setting can revert to DAV no and need correction. I've found that it sometimes reverts to "DAV On" and this will break your subversion service...it must always be set to DAV svn
  • Configure Jira using Server Admin's "Sites" panel for configuring the Web service. Under Sites->Proxy configure an ajp worker to talk to your Jira instance. I installed jira on its own context /jira as opposed to root and therefore set the worker URL path as well as the Proxy Path to /jira
  • For running under the same hostname/virtual host any additional balancer groups will need to be configured manually. I was able to configure an ajp balancer for sonar but had to use a http balancer for hudson. Avoid using 8443 for your ports for any customer services as Apple's iCal is configured for this one by default.
Posted by Eric Simmerman