PHP, Linux and the like…

October 16, 2007

MS Exchange functionality on Linux? Zimbra ties it all together.

Filed under: Linux, Reviews, exchange, zimbra — Paul Skinner @ 1:29 am

The never-ending quest to put a bullet in the Microsoft Exchange server has just chambered another live-round in the form something called Zimbra. To be fair, the Exchange server I manage is very stable, and runs great. I just loath the price of licenses and dread the obscure solutions to seemingly easy tasks.

I don’t know where this product has been hiding, but it caught my eye last week as a result of a Stumble! click. It seems Yahoo! has spent some coin and bought out Zimbra but is continuing to offer the code and binaries under a variety of licensing models. This is all good news for IT departments and service providers everywhere!

There are a number of How-To documents on the Internet that describe implementing various services to support an Exchange’esque environment. I’ve tried it, it works, but it’s ugly and a devil to maintain. Zimbra provides all the necessary technologies in one suite and centralizes the configuration in a uniform interface. The clever folks at Zimbra did it RIGHT. Both the authentication and directory Services are user configurable and 3rd party supported. This means that Zimbra can leverage your existing directory systems such as Active Directory or any other LDAP server for that matter.

I needed to see this in action and judge for myself.

This was a perfect opportunity to use VMWare to stage an image and play around with the basics. I created a 10GB virtual disk and installed Fedora Core 7 x86 while I was downloading the Zimbra 4.5.8GA Binaries for Fedora Core 5 x86 (yes, for FC5). FC7 was installed with minimal options as the Zimbra docs state that services such as httpd, mysqld, slapd, and a few others be either un-installed or disabled. I wasn’t in the mood to fight, so I complied.

Once done, I copied the Zimbra tarball over to the fresh VM, untarred and ran the ./install.sh script. This script does a great job of telling you what you’re missing; in my case I had to add some symlinks for version compatibility in /usr/local for libcurl and libidn. Fetchmail, curl and libstdc++ needed to be installed as well.

I also configured a A and MX record for the DHCP provisioned VM that resolved to private LAN address; all for testing purposes of course. I managed to get Zimbra installed without too much mucking about and went with the default values for the most part. It completed the install and launched the Zimbra services.

Web Client

The web-client is pretty slick, it’s by far the best looking one I’ve yet to see!

Zimbra Inbox

It has everything you’d expect in a webclient including a handy search-launch across the top for both internal/Google searches, and built in shared Wiki style document manager. Users can manage multiple identities, POP accounts, Address books… there are lots of variables and settings!

Comparing functionality with that of the Exchange Web client, I don’t notice anything missing, in fact, there’s way more in Zimbra. Even with all the playing around and trying all sorts of options it never hung or crashed my browser; it just plowed through it all.

Web Admin

Like the webclient, the web administration is top-shelf. It offers a ton of configurable items that are often annoying or impossible to do under MS Exchange. For example, under Exchange getting a Resource to auto accept an available booking for something like a meeting room or projector is nuisance; last I checked a Micro$oft DLL was required to hook certain Exchange message and action the resource via script. This functionality is build right into Zimbra.

Spam and AV control; yep. Built right in too.

Separately it would be like managing OpenLDAP, Postfix, Spamassassin, Anomy, ClamAV, stats package, webserver, database, spell-check, CA, and an IMAP server (and more I’m sure)!
Zimbra Admin

Migrating from Exchange seems to be straight-forward. I didn’t get the chance to try, but there are included tools that facilitate the process, mapping MAPI accounts to Zimbra accounts. The tools claim to migrate everything, and based on what I’ve seen so far, there is no reason to doubt this product either.

Given the opportunity (hardware) , I’d love to dedicate an environment to test Zimbra at the office to get an idea of what the day to day operation and maintenance is like and report back on the overall stability and workload.

The system requirements:

Evaluation and Testing
• Intel/AMD 32-bit or 64-bit CPU 1.5 GHz
• 1 GB RAM
• 5 GB free disk space for software and logs
• Temp file space for installs and upgrades*
• Additional disk space for mail storage

Production environments
• Intel/AMD CPU 32-bit 2.0 GHZ+. or large deployments (more than 2000 users), 64-bit OS is recommended.
• Minimum – 2 GB RAM Recommend – 4 GB
• Temp file space for installs and upgrades*
• 10 GB free disk space for software and logs (SATA or SCSI for performance, and RAID / Mirroring for redundancy)
• Additional disk space for mail storage

This is a great product, truly well done, congratulations to all involved!

- Paul

October 12, 2007

PHP 5 under IIS: It’s ready.

Filed under: PHP, Win32 — Paul Skinner @ 4:31 am

One of my first blog posts, PHP Installation: A myriad of options asserted that Windows and PHP 4 in ISAPI mode was a frustrating affair. I hereby offer a partial retraction in this regard as PHP 5 is MUCH different.

The folks at PHP recently announced the retirement of the 4.x version slated for December 2007. After which PHP 4 will continue to receive critical updates until August 2008. If you still run PHP 4, now is the time to starting thinking about getting everything up to version 5.

With that in mind, we’ve decided to upgrade all our development environments to PHP 5. Our standard development machines aren’t really all that fancy; 2 year old Dell P4 H/T based desktops running XP. Being a small group of developers, we’re liberal with the choice of IDE; some use PHPEdit, while I’m drawn between Zend IDE and Eclipse.

Our previous run-ins with PHP4 in ISAPI mode were not good. While PHP would usually run to some extent, we were often faced with segfault error message at the top of the output and often IIS would space out. Yes, we’d followed the lengthy install read-me on the site and still could not get PHP and IIS to play nicely. We pretty much gave up on PHP in ISAPI under IIS and settled with PHP in CGI mode for development purposes.

With the introduction of PHP 5.2 and the impending retirement date; we took the plunge and downloaded the latest PHP 5.2.3 Windows Binary Installer package from PHP.net.

To begin, we un-installed the PHP 4.4.x series CGI installation and removed all traces of PHP from IIS. The PHP.ini file was also backed-up and removed. Once complete, IIS was restarted and we moved on to the installation.

This was straight-forward; it’s a familiar MSI package loaded with all the extensions and required libraries. We stepped through the installation selecting ISAPI mode and the extensions we need for our application such as LDAP, MB_string and MSSQL. For the sake of path simplicity, we also overrode the default “C:\Program Files\PHP…” path with a more friendly “C:\PHP5″ folder. The installer recommended that we “Reboot” because well… it IS Windows after all, and it’s your duty to rebootie…

Once back up, a simple “test.php” was called up containing nothing more than a simple <?phpinfo();?> . Unfortunately this didn’t work. The content was dumped literally, unparsed in the browser; the ISAPI filter obviously didn’t render. A quick look in IIS revealed that in fact the ISAPI filter was NOT configured under the Application Configuration property pages. A few clicks and key strokes linked .PHP files with “C:\PHP5\PHP5ISAPI.DLL”; restarted IIS.

Tried the test page again with success! The phpinfo() method called confirmed we were now in ISAPI Server API;

PHP 5.2.3 Win32 phpinfo() part

We now have a working PHP 5 ISAPI installation under Windows XP!

In terms of our application’s compatibility with PHP5; there are many occurrences of about 4 different issues.

  • mktime – called without setting a timezone
  • strtotime – called without setting a timezone
  • “Call-time pass-by-reference”
  • Assigning the return value of new by reference is deprecated.

The main architecture of our application works as designed and most of the issues were fixed with a blanket search/replace within the application. The timezone stuff is a bit of a nuisance as we’d designed a great set of wrappers in PHP 4 to handle timezone adjustments. PHP5 handling of this sort of thing is vastly improved, but the list of available timezones is quite large and needs to be integrated into our app.

I look forward to exploring the new reflection classes and tightening up the OO model of our application to take advantage of the new PHP 5 class features. Check out PHP’s migration notes for more detailed information on the differences and changes between PHP 4 and 5.

- Paul

Blog at WordPress.com.