Saturday, December 13, 2008

Change MySQL Timezone

If your server is in a different timezone, a quick fix is to update the timezone of the server. I did that previously, but that turned out is not enough. I had to change the timezone of mysql daemon too. Here is how I did it:

SET GLOBAL time_zone = 'America/Los_Angeles';

SET SESSION time_zone = 'America/Los_Angeles';

Check it using:
SELECT @@global.time_zone, @@session.time_zone;

Friday, December 12, 2008

shindig and ssl

For our website, we are looking at some gadget/widget frameworks. First thing I tried was shindig from apache.

I had some trouble getting it to work, so I thought I will document the workaround, in case someone else has the same problem.
Note that in the end, the problem turned out to be different versions of openssl in apache and php, but here is how to work around it.

What caused the problem?
I like portable apps. So that whenever I change/upgrade my machine, I just copy my 'dev' directory to new machine, and my whole development environment is avaialble out of box.
I had set up apache and php about 2 years ago. Over time, as I played with various apps, lot of fat was added, not all of which jive together (notably openssl in this context).

So, to try out shindig, I downloaded the package and followed instructions from this site:

I turned on curl and openssl in php.ini, by uncommenting extensions for curl and openssl.

I configured virtal domain and then I hit this url in a browser:

I got this error message:
Shindig requires the openssl extention, see for more info

Without SSL, I got the above message, but with SSL, apache showed alert with this message whenever I tried to start apache.
"The ordinal 3879 could not be located in the dynamic link library LIBEAY32.dll"

I tried various things, but then I didn't really need ssl at this point, so here is what I did. I went into the shindig code, and found that I could work around the problem. Here is how:

In shindig/php/index.php
look for openssl, and change it like this:

//$modules = array('json', 'SimpleXML', 'libxml', 'curl', 'openssl');
$modules = array('json', 'SimpleXML', 'libxml', 'curl');

That's it. When I will need ssl, I will handle that, but for now, I can keep playing with shindig.