Archive for January, 2010

Published by Rolf on 29 Jan 2010

Installing Roundcube webmail on Plesk 8

The Plesk 8 default webmail client is Horde, which would be fine if it was 2002.  For me it was nothing but a headache (I never did get rid of all the PHP warnings), and worse, it seemed to consistently mangle sent emails.  Finally I had the last straw and moved to Roundcube, which I’ve been a fan of since it first came out.  Slick Web 2.0 application, looks like a stripped-down Yahoo Mail.

There were a few things to be aware of when installing, though.  Here’s what I did:

  1. Download and unzip the tarball to /usr/share/roundcube, so it sits next to Horde (which is installed to /usr/share/psa-horde).
  2. Edit the Plesk vhost config file at /etc/httpd/conf.d/zz010_psa_httpd.conf as follows (changes are in bold):

    <VirtualHost \
    IPADDRESS
    >
    #    DocumentRoot /usr/share/psa-horde/
    DocumentRoot /usr/share/roundcube/

    Alias /horde/ /usr/share/psa-horde/
    Alias /imp/ /usr/share/psa-horde/imp/
    ServerName webmail
    ServerAlias webmail.*
    UseCanonicalName Off
    # <Directory /usr/share/psa-horde>
    <Directory /usr/share/roundcube>
    <IfModule sapi_apache2.c>
    php_admin_flag engine on
    php_admin_flag magic_quotes_gpc off
    php_admin_flag safe_mode off
    #php_admin_value open_basedir “/usr/share/psa-horde:/etc/psa-horde:/etc/psa:/tmp:/var/tmp:/var/log/psa-horde:/usr/share/doc:/usr/share/psa-pear”
    #php_admin_value include_path “/usr/share/psa-horde:/usr/share/psa-pear:.”
    </IfModule>
    <IfModule mod_php5.c>
    php_admin_flag engine on
    php_admin_flag magic_quotes_gpc off
    php_admin_flag safe_mode off
    #php_admin_value open_basedir “/usr/share/psa-horde:/etc/psa-horde:/etc/psa:/tmp:/var/tmp:/var/log/psa-horde:/usr/share/doc:/usr/share/psa-pear”
    #php_admin_value include_path “/usr/share/psa-horde:/usr/share/psa-horde/lib:/usr/share/psa-pear:.”
    </IfModule>
    Order allow,deny
    Allow from all
    </Directory>
    </VirtualHost>

  3. Create the database and database user on the appropriate server and fill in the connection info.
  4. Change the owner of /usr/share/roundcube to apache.
  5. Bounce apache.
  6. Then go to http://webmail.yourdomain.com/installer and follow the rest of the Roundcube install instructions.
  7. Be sure to set $rcmail_config['default_host'] = “mail.yourdomain.com”.

Installing it this way makes for the most minimal changes, so if for some reason you wanted to revert to Horde, you’d just have to revert the vhost config file above and bounce apache again.

Published by Rolf on 28 Jan 2010

Refreshing a shared Vista Media Center library

I wanted to test out media sharing to a Windows 7 PC.  My music server is running Vista and has quite a lot of music on it.

The sharing feature seemed unreliable for me – sometimes when I would connect to the remote library it wouldn’t show any media, and other times it would only show some of the files.  The following steps seem to force it to work:

  1. First, delete the cached library metadata for the remote library.  The file(s) will be named something like _HME_HOME_uuid-33b809d3-d8aa-c83d-5197-c38cfbcd27be,_0.wmdb.
  2. Then open up Windows Media Player on the PC you want to share to.
  3. Click on the remote library and go to the Music section.
  4. Leave WMP open while it quietly does it’s thing.  Be patient, it could take a long time.  Don’t touch it until you’re positive it is done and it’s at the “Z”‘s.  The most time-consuming part of this seems to be transferring the album art files over the network.

Note to Microsoft – why in the world wouldn’t you give the option to check progress feedback of the remote library refresh?  Or at the very least put up an alert so we know it’s done and ready to use?

Published by Rolf on 24 Jan 2010

Setting up an RSYNC server on Windows Vista

I had a complete drive failure on my LaCie EDMini drive yesterday (it would start up and then turn itself off after 30 seconds). I had gotten a good 3 years of constant use out of it, though, so I shouldn’t complain. Good thing I had the automatic nightly backups to my FreeNAS server, so I didn’t lose anything permanently.

As a result I had to work though the recover process for the first time, whereby I wanted to transfer the backed-up files to a new Windows Vista Ultimate PC (using rsync of course) since this PC would become the new origin for the files going forward. This meant I had to set up the PC as an rsync server.

There are 3 primary methods for doing this (described well here). In my case, DeltaSync would have worked great except for the fact that it couldn’t handle Unicode file and folder names (even with the patched version of cygwin1.dll).  So this let me to Cwrsync.  Follow these steps:

  1. Download Cwrsync – all you need is the “Server Installer”.
  2. When you install it make sure you run as the normal PC user (and not the default account that it suggests).  This is important; otherwise you are likely to run into insurmountable file-permissions problems later.
  3. Set up the rsyncd.conf file as per the example. E.g., I used
    [rsyncroot]
    path = /cygdrive/c/Users/USERNAME/Documents/
    comment = Rsync Root
    read only = false
    transfer logging = yes
  4. It’s not necessary to run the separate “prepare directory for upload” program, since we’re running the service as the normal user.
  5. Open up Windows Firewall and create an exception for Port 873 (the default rsync port, if you’re not going over ssh which we’re not).  If you have a 3rd-party firewall you’ll need to do the same there too.
  6. On FreeNAS, I ran a bash script like the following to set up the initial push from FreeNAS to the PC. I have to set RSYNC_PROXY since I don’t want to run this over ssh.  In my case, I have a partial  backup there already, so I am checking on “size only” as well since the timestamps happen to be far too different between the two boxes.
    #!/bin/sh
     
    # don't use rsync over ssh
    set RSYNC_PROXY=localhost:873
    export RSYNC_PROXY
     
    /usr/local/bin/rsync -hazvrn --delete-after --progress --stats --force  \
    "/mnt/data/music" "192.168.2.4::rsyncroot"
  7. If the rsync errors out (in my case it was initially caused by some Unicode filenames left over from testing DeltaSync earlier; I don’t think it would happen on a clean setup), you may find that the file and permissions get hopelessly messed up. So open an admin command prompt and do the following:
    1. Take ownership of the folder: takeown /f c:\path\to\dir /r /d y
    2. Assign full control to Everyone: icacls c:\path\to\dir /grant Everyone:F /T

Hope this helps.

Update 1/25/10: The same directions work on Windows 7 too.  However the process for opening a port in the firewall is different – you’ll have to go to Network and Sharing Center -> Windows Firewall -> Advanced Settings -> and add a new Inbound Rule for port 873 (TCP).

Published by Rolf on 23 Jan 2010

Open Source Software = Transparent Government? Um, not quite…

According to the San Francisco Examiner, there’s a new policy proposed in the city to encourage open source software in government:

The policy says departments must “consider open source software equally with commercial products when purchasing new software.”

Open source software allows the public to access government information and the ability to make creative use of it. The software delivers “shorter implementation times and lower costs for the City, as seen with DataSF.org, RecoverySF.org and the City’s 311 integration with Twitter,” the Mayor’s Office said.

Uhh… Note to the author: that’s not at all what “open source “means.  If you chose an open source solution for some governmental function, that just means the IT employees for the city have access to the source code.  Now it’s possible an open-source solution does decrease implementation times compared to buying closed software, but in no way does it have any effect on the public’s ability to access government functions or write applications that make use of them.  For example, a webservice to display the most recent criminal activities in a zip code could be built with or without open source software, and from the public’s perspective (and more specifically, that of a public developer who wanted to use it in an application) it wouldn’t make one whit of difference which was used.  The public features and functions would be identical.

I’m all for the Mayor’s Office encouraging the consideration of open source software for the city, but do it for the benefits it actually can provide: quicker development and implementation of governmental software and services.  A vehicle for any sort of “transparent government” it’s not.