Frustration Abounds

As long as I’ve been running a box on linux, all the tutorials and documentation I’ve read have been geared towards integration with a control panel (line cPanel or Virtualmin or ISPConfig).  That’s all fine and good, but when you’re operating a box from your house, or a VPS, you don’t want to pay for the licensing fees or have them installed as the memory hogs they can be.  Not to mention the fact that many of them suggest that you run your user’s sites out of the /var/www/ directory – not exactly a recipe for success, in my opinion. 

I’ve long preferred the standard method of rooting users to the /home/ directory.  It works, and you can lock a user to their individual folder.  Unfortunately, with the way most installations go, it’s not the easiest thing in the world to accomplish. 

The other thing that really bothered me was the fact that the email setups favored physical users for email accounts (i.e. present in the users list) or a complete setup of virtual mail using some extreme integration between postfix, dovecot/courier, and using manual editing of MySQL tables.  (yuck)

I finally have gotten to the point where I’m comfortable with the way my setup is now geared.  I’ve arranged for virtual users through Postfix, email interactivity through Zarafa, and setting up users to have their own directory, not in /var/www.  Unfortunately, it’s not perfect, but it’s as close to a standard “hosted” setup as I’ll get, I suppose. 

The breakthrough came yesterday after I came across a blog post about a guy doing roughly the same thing.  The problem exists that outside of /var/www, your options are limited for how the users can access and utilize the PHP library.  Under a basic setup, PHP works fine in /var/www, but when you move beyond that, you have issues with file permissions.  Such is the instance for WordPress, if you want let it “auto-update” or to write the .htaccess file for pretty permalinks, it either needs to be in /var/www, or you have to use a combination of suEXEC and fastcgi to accomplish it.  This becomes a problem when suEXEC is configured upon install to work with /var/www and not some other directory.  I’ll freely admit that I’m not the most knowledgeable linux guy out there – but understand enough to be extremely dangerous. 

Through a combination of symlinks and using the fast-CGI method, I’ve gotten it to work.  Unfortunately, I couldn’t disable php entirely, as some of my stuff needs php to work correctly.  (Stuff like PHPmyadmin and Z-Push).  What’s even more annoying is that I couldn’t seem to get the Zarafa webaccess interface to load on fastcgi either.  These I would consider as “system” utilities anyways, and work under their own auspices.  I don’t need the write access to them.  (Technically I could have unloaded 2 of my other web-apps to “system” status, but didn’t bother at the present time.)

The mail solution came after I setup iRedMail and then unwound it from it’s need to use Dovecot as the pop3/IMAP interface and use Zarafa instead.  It uses PostfixAdmin to setup the domains and mailboxes for Postfix.  The biggest headache, of course, was getting Postfix unwound from Dovecot as an authentication and delivery method. 

Eventually I’ll be putting up the methodology behind all of this work (so no one has to bother with trying to unwind things) so you can setup Zarafa to integrate with Postfix immediately, as well as favor individual users.  I wouldn’t say it’s something for a lot of shared hosting, but would be useful for say a small family or group of friends to get setup and running.