Archive for April, 2010

Blackberry Professional Server – Blackberry Controller Service Will Not Start

Tech Supporton April 30th, 20104 Comments

Today we had a problem on our Blackberry Professional Server where the “Blackberry Controller” service was stopped and would not start.  Trying to manually start the service would give us the following error:

The BlackBerry Controller service terminated with service-specific error 5003 (0x138B).

Luckily, the fix was easy. There seemed to be some contention with this service and the “DNS Server” service on the same machine.  Stopping the DNS Server service, starting the Blackberry Controller service, and then restarting the DNS Server service seemed to fix the problem.

Deleting the Wrong Mailbox in Exchange Server 2007 – And Restoring It

Tech Supporton April 30th, 201013 Comments

So, it was bound to happen… We removed the wrong user’s mailbox in Exchange Server 2007 today.  Unfortunately, with Server 2007, removing an account, removes the Windows user object and also marks the mailbox in the database for removal.  Luckily, there is a relatively quick fix:

  1. Restore the Active Directory object with the AdRestore utility
  2. Connect the disconnected mailbox to the restored user account

Step 1
First, we downloaded the AdRestore program from Microsoft onto our primary Active Directory server and then ran the command:

> adrestore -r username

The program searches through recently deleted (tombstoned) objects and allows you to recover them.  The username part works as a rudimentary search.  If it finds the object, it prompts you to proceed.  Once you do, the account is restored.  It’s disabled and doesn’t have a password, so you’ll need to set the password and the activate the account. Microsoft has a long drawn-out article on restoring Active Directory accounts, but running this simple tool seemed to work fine for us.

Step 2
In the Exchange Management Console, we went to Recipient Configuration -> Disconnected Mailbox and went to find the deleted mailbox.  Oh crap! It wasn’t there!  Luckily, it turns out that if the mailbox management process has not yet run, you will not see recently deleted mailboxes.  Fortunately, you can force this by going to the Exchange Management Shell and running:

> clean-mailboxdatabase “Mailbox Database

After running this command, the disconnected mailbox now appeared.  You then right-click on it, and select “Connect…”  Check “User Mailbox” and click Next.  Then, select “Existing User,” browse to find the user, make sure their Alias is correct, and click Next. Clicking Finish reconnects the user’s old mailbox to the restored user account.

The reconnection looked like it finished quickly, but we found that it took about an hour for it to fully connect and allow the user access to her email again.  Hope this helped!

Symfony, WordPress and nginx – configuration details and setup

nginxon April 8th, 2010No Comments

After several hours of trial and error, we finally figured out a configuration that works for running Symfony and WordPress together on the same web site using the nginx web server.  This post had a lot of useful information, but none of it worked perfectly for us, so this is what we came up with:

server {
    listen   80;

    access_log /home/logs/domain/access.log;
    error_log /home/logs/domain/error.log notice;

    root   /home/www/sfprojects/domain/web;
    index  index.php;
    charset utf-8;

    ## configuration for the WordPress blog with the WP-SuperCache plugin
    ## (remove if not using WordPress)
    location /blog {

        # if the requested file exists, return it immediately
        if (-f $request_filename) {

        set $supercache_file '';
        set $supercache_uri $request_uri;

        if ($request_method = POST) {
                set $supercache_uri '';

        # Using pretty permalinks, so bypass the cache for any query string
        if ($query_string) {
                set $supercache_uri '';

        if ($http_cookie ~* "comment_author_|wordpress|wp-postpass_" ) {
                set $supercache_uri '';

        # if we haven't bypassed the cache, specify our supercache file
        if ($supercache_uri ~ ^(.+)$) {
                set $supercache_file /blog/wp-content/cache/supercache/$http_host/$1index.html;

        # only rewrite to the supercache file if it actually exists
        if (-f $document_root$supercache_file) {
                rewrite ^(.*)$ $supercache_file break;

        # all other requests go to WordPress
        if (!-e $request_filename) {
            rewrite  ^(.*)$  /blog/index.php?q=$1  last;


    location / {

        # If the file exists as a static file serve it directly without
        # running all the other rewite tests on it
        if (-f $request_filename) {
            expires max;

        if ($request_filename !~ "\.(js|htc|ico|gif|jpg|png|css)$") {
            rewrite ^(.*) /index.php last;

    location ~ "^(.+\.php)($|/)" {
        set $script $uri;
        set $path_info "";

        if ($uri ~ "^(.+\.php)($|/)") {
            set $script $1;

        if ($uri ~ "^(.+\.php)(/.+)") {
            set $script $1;
            set $path_info $2;

        fastcgi_index  index.php;
        include        fastcgi_params;

        fastcgi_param  SCRIPT_FILENAME  /home/www/sfprojects/domain/web$script;
        fastcgi_param  SCRIPT_NAME      $script;
        fastcgi_param  PATH_INFO        $path_info;

   location /sf/ {
        root /home/www/sfprojects/domain/lib/vendor/symfony/data/web/;

   error_page   404  /404.html;
   location = /404.html {
        root   /usr/local/nginx/html;


And this is the content of our fastcgi_params file which we include above:

fastcgi_param  QUERY_STRING       $query_string;
fastcgi_param  REQUEST_METHOD     $request_method;
fastcgi_param  CONTENT_TYPE       $content_type;
fastcgi_param  CONTENT_LENGTH     $content_length;

fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
fastcgi_param  REQUEST_URI        $request_uri;
fastcgi_param  DOCUMENT_URI       $document_uri;
fastcgi_param  DOCUMENT_ROOT      $document_root;
fastcgi_param  SERVER_PROTOCOL    $server_protocol;

fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
fastcgi_param  SERVER_SOFTWARE    nginx/$nginx_version;

fastcgi_param  REMOTE_ADDR        $remote_addr;
fastcgi_param  REMOTE_PORT        $remote_port;
fastcgi_param  SERVER_ADDR        $server_addr;
fastcgi_param  SERVER_PORT        $server_port;
fastcgi_param  SERVER_NAME        $server_name;

# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param  REDIRECT_STATUS    200;

fastcgi_connect_timeout 60;
fastcgi_send_timeout 180;
fastcgi_read_timeout 180;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_intercept_errors on;

Hope this proves helpful to someone going through the same problems!