Friday 23 May 2008

Typo3 on Oracle

Yesterday I succeeded in installing Typo3 on Oracle. That is: I used Oracle Enterprise Linux and Oracle XE Database.

You might think: "Why is this so special?" And "what is Typo3 anyway?"

Typo3
Typo3 is an open source Content Management System (CMS). You can find al about it at: http://www.typo3.org/. A few years ago I was looking for a CMS for some sites I was maintaining. I found a site that listed all the different ones. Some were merly blogs but there were few "real" CMS. Actually I came on to two: Joomla (formerly Mambo) and Typo3. Joomla is a real nice CMS for smaller organizations that want a website that is simple, free and easy to maintain. It is written in PhP and mySql and that is what most ISP provide. But I wouldn't use it for large websites. Sites that have multiple front-ends/channels, for example when you want to distinguish between a demand and a delivery part with a different layout. Or when you need fine-grained acces control: several different roles that have to access different parts of the site with different access rights.

Typo3, however, supports all this and more. It can support multiple sites and recognize with what url you request a page and deliver that part of the site that belongs to that url. You can have multiple domains or sub-domains and all have different parts with different layouts from the same installation. It supports fine-grained access control in both the front-end as well as the back-end (administrator pages).

Also Joomla organizes the articles in Sections and Perspectives. And a crossreference between those determine more or less how and where they are shown from the menu. Typo3 uses an hierarchical view and builds the menu from that hierarchy. This is more intuitive, I think.
And also Typo3 has loads of extensions, in fact it installs with a lot of base extensions. And it serves extremely well an Intranet, because of the fine-grained-access-control features.

But why on Oracle?
I have learned to know Oracle Portal, one of the CMS's of Oracle. I even learned Webdb the ancestor of Oracle Portal. I don't know Stellent or Sharepoint of Microsoft of other products. But I think that for many features Typo3 can meet the commercial products.
The only thing might be that it is in PhP (well that's not a big point) but it runs by default on mySql. For most purposes this is fine, but larger organisations that want to host their website by themselves and even use it for an intranet, might want to have it run on an Oracle database. It has to scale, be high available so it should also run with an Oracle Application Server. Such organizations often allready have Oracle expertise on Database and Application Server. They have implemented backup-and-recovery policies on Oracle. They might even use the integration products in SoaSuite and want to integrate the intranet with other Oracle technology based Applications.

Some of those organizations are the Dutch local counties. A few weeks ago I read an article that 15 of them (not the smallest ones) joined eachother in a Typo3 User group:
Typo3-gemeenten maken vuist.

Ok then, How to?
Well, what I did is first create a virtual machine with Oracle Enterprise Linux 5. As you might have noticed in other articles on this blog: I use VMWare Server ... a lot. In fact all my installations I work with I do in VMWare. That makes it easy to share this with colleagues and I can quite simply reinstall my laptop. But this is not a VMWare article...

I assume that you have allready an OS installed. I also assume for my convenience that you use a Linux based one, but this should easily translate to Windows. I'll give some reference articles that also counter for Windows.
I used the following products:
I used the latest Apache 2.0 since that one is also available with Oracle Application Server. Actually the OAS by default installs the 1.3 HTTP server, but there is also a 2.0 on the companion cd's. I used the latest version available for PhP. But I used the 4.1.6 version of Typo3 since I could not get the installer-pages started of the 4.2.0 version. But that is probably due to something I did wrong myself. But 4.2.0 is basically 4.1.6 with a nicer/newer UI.

Install Apache, Php and Oracle on Linux
I used this article to install the basics: http://www.oracle.com/technology/tech/php/htdocs/inst_php_apache_linux.html. There is also a windows variant. Look for more info on the php-developer-center of Oracle: http://www.oracle.com/technology/tech/php/index.html.
Be very precise in following the instructions. It is important to compile the packages correctly. And do test the installation with the php-scripts listed.

Install Typo3
First you have to unpack the typo3 packages. You need two: the dummy and the source. If you use windows you have to get the zip-files of the two and unzip them in one directory. If you use Linux/Unix then you're better of since Linux/Unix support symbolic links. Get then the .tar.gz packages and unpack them side by side. If you have the dummy of the same version as the source (that is pretty much advisable) then unpacking them side by side will give you the proper symbolic links in the dummy-directory to the source directory. The dummy directory will in fact be your site. What I did was unpacking the two in a sub-directory cms under htdocs (/usr/local/apache/htdocs/cms). I named the dummy typo3_416 and had the directory of the source directory defaulted (typo3_src-4.1.6.tar.gz => typo3_src-4.1.6).
So the Typo3 system is then reachable with the browser using /cms/typo3_416.
Then I used the following document to do the install: http://wiki.typo3.org/index.php/Oracle.
When you then go to /cms/typo3_416 the 1-2-3 installer will start. But that one gives some problems with the database/host settings. You'd better go the basic-installer with the link at the bottom-right corner of the screen. Then do the basic checks to see if all the necessary directories are writable and then compare database.

One strange thing is that I started apache as root. That is necessary when you run it at port 80 (port below 1024). But when I do ps -ef|grep apache I see that the apache listeners are running as "nobody". So I had to make the necessary typo3 folders writable to all instead of only to owner or group.

Since I do not like an url as /cms/typo3_416 I moved the typo3 folders a level higer afterwards, removed the folder cms and named the folder typo3_416 (formally known as dummy-4.1.6) to cms.

Don't forget to make the datamodel changes to implement the named triggers and index.

Conclusions
Hopefully this will pull you and your company over the line to use Typo3 and Oracle. Typo3 is a good choice if you want to implement an intranet and find the commercial ones too expensive but mySql is not in your strategic choice of products. Also this will open up the integration of your Typo3 based intranet/internet site and your other Applications using custom-build interfaces in Pl/Sql or SoaSuite. Many extensions will put their info in the database, you might have an Form-extension that puts the information of filled-in forms in the database. On submitting a form you can have events picked up by Oracle ESB or simply a trigger in the database.

It's also quite possible to build exctensions based on pl/sql procedures you have in your Oracle Applications to show for example the current sales revenue or the number of calls in your call-center directly from your Oracle Database.

I myself have two things on my list:
  • Have Typo3 running on a Oracle 10g AS and an Oracle 10g/11g Database Enterprise Edition. Most organizations have the database on an other server then the AS/Http Server. So this will have other connect strings to use in Typo3.
  • Integrate Oracle Application Express with Typo3.

Thursday 22 May 2008

Multicast DNS in Linux

Last week I happily succeeded in finishing my OpenSuse 10.3 installation on my laptop. One of the things I had to solve was the problem that at my current customer where I work, I had problems with connecting to servers and intranet sites.

I had this same problem with Ubuntu 7.10, when I was working at another site of the same customer. I was then mentioned that it had to do with Multicast DNS that the customer's infrastructure did not support. In Ubuntu it was simply solved by disabling the system service that handled this service. I can't remember exactly where to find it (my memory is not created in the way that I photographically remember steps, but just the global procedures and how-to find's. That saves organic-memory-space I presume). But look for system services in the adminstration menu and then look for Multicast DNS and disable that.

In OpenSuse it was a little harder to find. But since I'm posting this blog you probably expect me having find it. And you're right.
  1. Go to YaST2 (Green Chameleon/Computer/Administrator Settings)
  2. Choose System/System Services (RunLevel)
  3. Find Avahi-deamon and Avahi-dnsconfd and disable them (buttons below the screen)
In the description of the deamons you'll find a remark that these services handle mDNS and service registration. I figured that mDNS probably stands for multicast-dns. And indeed googling on mDNS brought me here: http://www.multicastdns.org/.

Monday 19 May 2008

Suspend to disk works

In my ealier post about my OpenSuse installation I mentioned that I still had an issue with suspend to disk. With help of Dean on the OpenSuse Forums I solved it.

For some reason the partitioner in the OpenSuse installer named my partitions sdb1, sdb2 to sdb5. I would expect it to name them sda*. This is maybe because I had an usb-drive attached to my dockingstation. Anyway in the file /boot/grub/menu.lst where all the menu-options are listed a the resume parameter contained a reference to sda5: resume=/dev/sda5. I changed this to resume=/dev/sdb5 and now my systems happily suspends!

Friday 16 May 2008

My Vision on SOA, part 2.

I just realize that maybe I have to explain my earlier post on my vision on SOA. I stated that it is all about: "Don't postpone to tomorrow what you can do today".

A few years ago I had a discussion with a colleague that resulted in an article in our consulting-magazine. He asked me if I would use InterConnect for an interface that processes 1000000 records in batch every night, were the receiving application is not interested in the records real-time.
But then your only argument to use an EAI-tool like InterConnect, Tibco or ESB that the receiving application needs the application realtime.

But it results in a costly batch that has to be maintained. The batch has to fit in the batch-window. There is no reuse of the code (transformations and data-enrichments in the batch). And also the providing application is pressurized because of requirements of the remote application. When you're able to get the change-events in the source application in real-time then you have all the information at hand at the moment the event occurs. Then you can do the transformations and enrichments at that very moment. You could do that asynchronously when these actions would cause the End-user-session to be less responsive.
Doing so you can subscribe multiple applications/services to the events. Also after processing the event the publishing application got rid of the responsibility.

If your receiving application is not able to get the mutations real-time, you can collect the mutations in a staging table. And then you only need a very light batch that just processes each mutation from the staging table in the receiving application. Since all the transformations and enrichments are done at real-time the mutations are in a processable state for the batch.

When you are to soa-enable an enterprise that uses packaged apps like Oracle E-business suite or conventional (Designer/Developer) custom-apps than you may have to break up the conventional way of working with batches. Possibly you can copy and paste transformation and data-enrichment code from the batches. But big chance that you have to rebuild it with technologies as XSLT.

When you have to build or maintain a custom-app or you work as a developer at a packaged-app-provider then also keep this in mind. Try to work event-driven. See that on every mutation event you're able to put a message on a queue (for example AQ) or publish an event to an ESB-product (Oracle SoaSuite).

Oracle Workflow had the Business Event System, which is a really nice system for publishing and subscribing to events. It is AQ based and available with every main product of Oracle (database, AS). It mainly executes in the database so for custom Forms applications, especially when they're based on Designer/Headstart/CDM Ruleframe, the ideal way to expose change-events asynchronously.
Very unfortunately Oracle decided to de-support Workflow (and thus BES). It is supported as long as the product that it's shipped with is supported. So as long as Oracle DB 10g or Oracle AS 10g is supported you can use Workflow/BES.

Actually it is quite remarkable that they de-support it. Because BES used to be written in Pl/Sql but in the very latest release (2.6.3 or 2.6.4 that shipped with 10gR2) they re-build it into a J2EE container! I wonder why they did that, because soon after that the Statement of Directoy noticed the de-support. I have two possible explanations:
  1. E-Business Suite still ships with embedded workflow. Release 12 is OC4J based (R11 is still based on the formally for customers desupported old Oracle 9i Application Server version 1.0.2.2). In R12 the Oracle embedded Workflow will still be available and so the BES can be J2EE based. Also it makes it simpler to have Java-calls on events. In 2.6.2 it used some kind of D-tour-solution from Pl/Sql to java.
  2. Did you ever took a glance at the datamodel of Oracle SoaSuite ESB 10.1.3? You will see some tables of ... indeed: Oracle Workflow/BES!

Yes! OpenSuse 10.3 on my laptop

Yes! Finally I succeeded in getting OpenSuse 10.3 86_64 on my laptop. I think it sounds silly since it's one of those Linux distro's that should install simply and just work. And actually it did but there were some issues that kept me struggling for two weeks and several re-installs (I think I re-installed linux about 5 times the last two weeks). Apparently my Dell Latitude D830 is a very special one ;-).

Since I have this laptop I worked with Ubuntu 7.10 Gutsy Gibbon. And really enjoyed it. However there were also some things that I found not so obvious as expected in Ubuntu:
  1. My soundcard did not work natively. I had to re-install the alsa-drivers and change the mixer settings to get the Front-part of the volume controls under the volume buttons on my laptop.
  2. My Nvidia-card is a Quadro NVS 135M. And apparently due some license-issues the native-propietry driver is not shipped with the distribution. (This also counts for OpenSuse 10.3). So I had to install the propietry driver. Luckily this is very simple in Ubuntu. Just enable it in the propietry driver screen. But changing resulution settings is not so simple. Actually it seems simple with the Screen Resolution in the administration menu. But when I wanted to have another external screen attached to my laptop it is a crime to get the correctl resolution and also get it back to the native resolution of my laptop.
  3. I work extensively with VMWare Server. Ubuntu works with a Debian-based packagemanger for which often no package exist for many commercial software like VMWare. Nowadays it is in the repository but that was the 1.04 version, while the current version 1.0.5 is not yet (that is: two weeks ago it was not). Having it installed it works fine, except for suspend and resume. It is terribly, unworkable, slow. So under Ubuntu: just startup and shutdown your guest, then it works fine.
  4. Ubuntu uses Gnome. And that is a fine windows-manager. But I got a glance at KDE and that has many more shortcuts, richer pop-up menus (right-click), and just looks and feels "opener". Also I missed the "windows active desktop" in Gnome that seems to exist in KDE (I've seem something that suggest those capabilities but did not have it working).
  5. I had the 32 bit version of Gnome. I tried the 64 bit versions of both Ubuntu 7.10 (Gnome) and Kubuntu 8.04 (KDE). But the 7.10 version I could not get started normally (you had to remove the splash screen in the startup otherwise you did not get a "visual"). The Kubuntu 8.0.4 had some other issues. Mainly I could not get the Nvidia propietry driver and VMware Server working properly. I wanted to have the 64 bit because I have a 4 GB laptop and a 32-bit OS just addresses 3.5 GB of it, because of some address-lines that have to be reserved for peripherals.
An (ex-)colleague of mine uses OpenSuse 10.3 86_64 for a while on his D630 laptop with great sattisfaction. He uses OpenSuse for ages, so I figured: then it should be easy to get it working on my laptop. And actually it comes with a nice graphical installer (like Ubuntu 7.10, but unlike Kubuntu 8.04 amd64 which has a character-based one) and all my laptop-hardware is recognised. So Happy? Well then begins the configuration-issues.

Nvidia driver
Like Ubuntu also OpenSuse lacks the propietry driver for Nvidia due to License Issues. To me it seems that they could have put the Nvidia-software repository to the repository list and give the choice to install it for you. Then they could have presented the EULA and let you agree to it. The opensource driver nv works but is very slow. Scrolling with it in a large document or Web-page is not convenient. Luckily on the net are a few sources that explain how to replace the driver.
There is a nice one-click install on http://en.opensuse.org/NVIDIA. Unfortunately I found this one just the second try. The first try I had another source (which I can't remember and see no need to give here). It looked well (just a little less easy: near-one-click install). But something went terribly wrong during a reboot that I did a short while after that. My complete file system messed up unrepairably.

VMWare Server 1.0.5
Works very good. It is fast, also in suspend and resume. Just like I was used to under Windows.
I would like to get my windows-partition booted under VMWare Server. That should be possible, but when I tried I hit some access-right restrictions on the partition.

Wireless
The wireless drivers that get installed were the ipw3945 drivers. (I have an Intel Pro/Wireless 3945 ABG card). These drivers don't work that good. I just get a connection once in a while and it is then very unstable. There are also iwl drivers (iwlwifi, iwl3945-ucode). Just search on 'iwl' in YaST2. What I had to do was to uncheck/uninstall the ipw3945 modules and make sure that iwlwifi and iwl3945-ucode are installed. Now my wireless work just fine with the iwl-driver. I did not have to couple my wireless to the drivers. It just worked.

NTFS partitions
I have a dual boot machine. There are some things that just only work with windows (my Nokia N73, my Nikon D40+, and Netsupport a remote-desktop tool that they use at Oracle University). Ubuntu natively give read-write-support on ntfs-partions and usb-disks.
But OpenSuse does not. I had to made sure that the ntfs-3g drivers and mount tools were installed. Then I had to change the mount rule in /etc/fstab:
/dev/disk/by-id/scsi-SATA_ST9160823AS_5NK0BXV1-part1 /windows/C ntfs-3g user,users,gid=users 0 0
Also check that /windows/c has the users group and read/write on group level:
chown root:users /windows/C
chmod g+w /windows/C


Suspend to disk
Well this is the only main-thing I have left. It just does not work. I got this error in /var/log/pm-suspend.log:
ERROR: resume partition '/dev/sda5' not active, can not suspend
WARNING: /var/run/pm-utils.inhibit will be created to prevent suspending!
I searched and searched on Google but could not find a proper solution. It seems that I'm the only one in the Linux world that has this...

Conclusion
Well in the end I'm very happy with my OpenSuse install. Although I still would also recommend Ubuntu to others. Both are really fine systems. I think Ubuntu is especially strong for less experienced Linux users, people that just want to have a very stable system or have less up-to-date hardware. It's very easy to install and have in use.
OpenSuse also works very good with some refinements like explained above. KDE is really a pleasure to me.
If you have a good solution for my Suspend problem or know how to have a windows-partion booted under VMWare Server then please give me a comment. Thanks in advance.