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.

2 comments :

Frits Hoogland said...

Hi martien!

The apache root/nobody confusion is because of the following reason:

when apache is started, it is started with the same uid/gid as the process which starts the httpd daemon. this is the httpd parent process, which has init as parent. this daemon reads the httpd.conf and looks for the "User" and "Group" directives. The apache childs use the User and Group for uid and gid.

provided all the php modules are available, it should be easy to run typo3 with the OHS

If you've managed to get typo3 working with XE, the steps should be the same for other oracle database versions.

Martien van den Akker said...

Hey Frits,

Thanks. I'm going to look at that. Quick response I must say! Just wrote it this morning.

Indeed I should think that it would not be so hard to get it under OHS and DB EE. But I just want to see it working. It just slightly different and I know from experience that "slightly different" may cost "a lot of time and frustration". ;-)

Regards,
Martien