Skip to content


Transferring email from Outlook Express to Outlook for Mac 2011

Most email clients have import and export functionality, but for some reason you cannot export email from Outlook Express. You can however import mail into other programs on the same computer and thus in a way export email from Outlook Express. After that, you can export the emails to a hard drive and import it to your Mac. I used the free Thunderbird client by Mozilla, but Outlook (full version) and other will probably accomplish the same. Here are the steps:

  1. Install Thunderbird on the PC
  2. Import email to Thunderbird from Outlook Express
  3. Check where the actual emails are stored by right clicking on the email folder and clicking on Properties
  4. Copy the whole folder with the emails to an external HDD
  5. Connect the HDD to the Mac and import the emails to the Mac native Mail-program via File->Import mailboxes->Thunderbird and browsing to the folder on the external HDD.
  6. After importing to Mail, open Outlook and import to it from the Mail-program

That’s it. Importing to Mail before Outlook is a required step since Outlook for Mac does not have the capability to import items from Thunderbird.

Posted in Uncategorized.

Tagged with , , , , .


Loadbalancing Tomcat with Apache

I found myself in a situation where the load on one of our Tomcat instances was growing too high. I had other servers to share the load, but none could carry the load by themselves. I had being using Apache’s mod_proxy and I knew this was the time to check out mod_proxy_balancer.

I found this great resource, which gave me all the relevant information I needed: http://sihantech.wordpress.com/tag/using-mod_proxy-and-mod_proxy_balancer-in-apache/. Here’s my final setup inside an SSL VirtualHost:

ProxyPass /myApp/ balancer://JvmsInternal/ stickysession=JSESSIONID|jsessionid
<Proxy balancer://JvmsInternal>
BalancerMember ajp://192.0.0.101:8009/myApp/ loadfactor=1 route=jvm1 ttl=5 timeout=300
BalancerMember ajp://192.0.0.103:8009/myApp/ loadfactor=1 route=jvm2 ttl=5 timeout=300
</Proxy>
<Location /balancer-manager>
  SetHandler balancer-manager
  Order deny,allow
  Allow from 192.0.0
</Location>
Although some guides might omit the use of the jvmRoute parameter in Tomcat’s Engine tag in server.xml, sessions did not work without it. So be sure to put the same value for the jvmRoute parameter as for the route parameter on the mod_proxy_balancer.
<Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">

Posted in Apache.

Tagged with , .


Forwarding multiple domains with .htaccess

Lately I’ve being doing some work on a few websites. One company posed an interesting problem: they wanted to use their existing webhotel account to host two or three new sites.

I moved the existing files and folders in the root into a new subfolder and figured I’d do the same to the new sites. Sounds simple enough.

As always with this type of work, problems arise and this time was no exception. The forward to the new folder worked fine, but in typo3 – the CMS used on the existing site – some links with canonical urls weren’t working and instead forwarded to the index page.

After getting to know typo3 and spending some time debugging, I figured out it was links to pages with short titles that weren’t working and finally hunted down the problem to a typo3’s helper function. It seems typo3 uses the actual php file’s location on the server instead of the uri when getting the REQUEST_URI using the helper function. This is used when typo3’s canonical plugins extract the title and post number from the uri. A modification to the function fixed that.

The next problem I ran into was getting a 403 error when forwarding the new domain. This was due to a missing slash before the folder name.

Here’s my final .htaccess file:

RewriteEngine On
# NOTE: Also place all valid domain names as NOT (!) conditions in the last ruleset where unwanted requests are processed
# SITE 1
RewriteCond %{HTTP_HOST} ^domain1\.([a-z]+)$ [OR]
RewriteCond %{HTTP_HOST} ^www\.domain1\.([a-z]+)$
RewriteCond %{REQUEST_URI} !^/site1/
RewriteRule (.*) site1/$1 [L]
# SITE 2
RewriteCond %{HTTP_HOST} ^domain2\.([a-z]+)$ [OR]
RewriteCond %{HTTP_HOST} ^www\.domain2\.([a-z]+)$
RewriteCond %{REQUEST_URI} !^/site2/
RewriteRule (.*) site2/$1 [L]
#
# Place other domains before this line. This forwards unwanted requests to an empty directory
#
RewriteCond %{HTTP_HOST} !^domain1\.([a-z]+)$
RewriteCond %{HTTP_HOST} !^www\.domain1\.([a-z]+)$
RewriteCond %{HTTP_HOST} !^domain2\.([a-z]+)$
RewriteCond %{HTTP_HOST} !^www\.domain2\.([a-z]+)$
RewriteCond %{REQUEST_URI} !^/empty_do_not_move/
RewriteRule .* /empty_do_not_move/

I found this article and used it to learn mod_rewrite: http://corz.org/serv/tricks/htaccess2.php along with the apache documentation: http://httpd.apache.org/docs/2.2/rewrite/

Posted in Apache.

Tagged with , , .


Cognos Business Intelligence 10 installation on Linux

Preface

This document describes the process of installing Cognos BI Server 10.1 and Transformer 10.1 on a 64bit Linux. (Distribution used is CentOS 5.5 64bit).

This document also describes the configuration of external Congnos applications that connect to the server.

Preliminary steps

  • Download 64bit Linux version of the Cognos BI Server
  • Download Transformer for Linux (only available as 32bit)
  • Download compat-libstdc++-33.i386, compat-glibc.i386 and openmotif22 library or make sure yum (or other package management software) has it in its catalog
  • Download unixODBC software or make sure yum (or other package management software) has it in its catalog
  • Download MySQL ODBC Connector 5.1.5 for Linux
  • Download appropriate Java JRE (64bit if possible). At the time of writing, the best supported JRE was 1.6.12

Software installation and configuration

  • If not already installed, install Java JRE or SDK
  • Before installation, the JAVA_HOME variable must be set in /etc/bashrc:# Use your installation directory
    export JAVA_HOME=/usr/java/latest/
  • You will run into trouble unless you install these 32bit support libraries:
    yum install compat-libstdc++-33.i386
    yum install compat-glibc.i386
    yum install openmotif22.i386
  • Install BI Server by running the issetup program in the linuxi38664 directory. This will install Cognos Server in /opt/cognos/c8_64. Note: If you want to install the Content Store, you have to explicitly select it during installation.
  • Install Transformer by running the issetup program in the linuxi38632 directory. This will install Cognos Transformer in /opt/cognos/c8.
  • Set the Cognos library path in /etc/bashrc:
    export LD_LIBRARY_PATH=/opt/ibm/cognos/c10_64/bin64
  • This is a good time to check if you have SELinux installed and operational. SELinux secures your linux installation, but it also disturbs Cognos a lot. Set SELinux level to Permissive.
  • Copy /opt/cognos/c8_64/bin64/jre/1.5.0/lib/ext/bcprov-jdk14-134.jar to the lib or lib/ext directory under your Java JRE installation directory
  • Run /opt/cognos/c8_64/bin64/cogconfig.sh, save the config and start the service with the play button
  • Install unixODBC. I have the 32bit version installed, but you may want to try the 64bit version first:
    yum install unixODBC.x86_64
  • Install MySQL ODBC Connector from RPM. Again, you might want to try the 64bit version first:
    rpm -i mysql-connector-odbc-3.51.19-0.x86_64.rpm
  • Check that the unixODBC library is properly symlinked. You should have /usr/lib64/libodbcinst.so link to libodbcinst.so.1.
  • Configure unixODBC by setting up the following files
    • /etc/odbcinit.ini – this is where all the DB drivers are configured:
      #/etc/odbcinit.ini
      [MySQL]
      DRIVER = /usr/lib64/libmyodbc5.so
      UsageCount = 1
    • /etc/odbc.ini – this is where the data sources are configured:
      #/etc/odbc.ini
      [MYSQL-Tuotanto]
      Driver = MySQL
      SERVER = server IP
      PORT = 3306
      DATABASE = dbname
      USER = username
      PASSWORD = password
      # sqlDescribeColumn returns table names, must be equal to Framework Manager computer ODBC setting in order for native queries to work
      OPTION = 1024
      CHARSET =utf8
  • Install/register the MySQL driver and data source:
    odbcinst -i -d -f /etc/odbcinst.ini
    odbcinst -i -s -l -f /etc/odbc.ini
  • You can test the datasource availability and connection:
    odbcinst \-s \-q
    #Outputs: [data source name]
    isql \-v datasourcename username password
    # Starts a console
  • Add Apache configuration to /etc/httpd/conf/httpd.conf:
    #
    # COGNOS
    #
    ScriptAlias /ibmcognos/cgi-bin "/opt/ibm/cognos/c10_64/cgi-bin/"
    Alias /ibmcognos "/opt/ibm/cognos/c10_64/webcontent/"
    <Directory "/opt/ibm/cognos/c10_64/webcontent/">
    Options Indexes ExecCGI
    AllowOverride None
    Order allow,deny
    # Allow access from LAN and localhost
    Allow from 192 10 127.0.0.1
    </Directory>
    <Directory "/opt/ibm/cognos/c10_64/cgi-bin/">
    Options Indexes ExecCGI
    AllowOverride None
    Order allow,deny
    # Allow access from LAN and localhost
    Allow from 192 10 127.0.0.1
    </Directory>
    #END COGNOS

Workstation configurations when using the Linux server

When you use a different computer to access the Cognos services on the server, configure the workstation Cognos as follows:

  • If you are using 32bit Cognos programs, open the configuration utility in the Cognos 32bit folder C:\Program Files (x86)\cognos\c8\bin\cogconfigw.exe and for 64bit programs the from the 64bit folder C:\Program Files\cognos\c8_64\bin64\cogconfigw.exe
  • Select the Environment node in the tree
  • Set Gateway URI to point to the Linux server IP instead of localhost
  • Set Dispacher URI for external applications to point to the Linux server IP instead of localhost
  • Save configuration

Posted in Unix.

Tagged with , .