7. Dec. 2008

Oracle’s BI Publisher which is part of the Oracle Business Intelligence Suit has at least within Enterprise Computing environment established as a reliable and preferable choice when it comes to replace the somewhat aged Oracle Reports.

Once being familiar with it you will ask yourself about why switching tool when it comes to the need of creating reports in a normal web design world mostly using MySQL Databases within a “LAMP” environment.

Written as an universal reporting tool BI Publishes does offer us a more or less universal data interface based on JDBC connections. And being able to act itself as a callable web service offering WEBDAV services based on XML data exchange it anyway seems to be an excellent choice for this world.

Already Oracle’s installation instructions does give you a quick idea about setting up BI Publisher working against some MySQL Database. But acting  in a Web environment you might find it cool integration the BI Publisher within an already existing Apache Tomcat environment and for exactly this environment I will give you a short explanation about getting things together and ready for work.

First we will pick the BI Publisher software itself by copying the xmlpserver.war file from the distribution DVD and throwing it into the webapps folder of our Apache Tomcat. Waiting a few seconds until the self-deploying mechanism of the Apache Tomcat has extracted the files for us, we need to specify the access path to our project and development repository within the file xmlp-server-config.xml.

Having done that, we need to add the MySQL JDBC driver to our system and making it known within the environment of the Apache Tomcat. (The MySQL JDBC driver can be downloaded from: http://www.mysql.com/products/connector/j/.)

So with the downloaded fileready, we have to extract it to any place we like onto our disk. Just I would recommend you to put it somewhere close to your MySQL installation for you being able to later on remember it again. Finally extracted and ready to use, we have to add the information about the mysql-connector-java- -bin.jar file to the Java Classpath of the Apache Tomcat and finally restarting it:

Configuring Java Classpath 

Having this set, as a last step we have to invoke the BI Publisher itself, in which we then will configure the new JDBC data source within the Admin region of it:

Configuring JDBC Data Source 

And now with this tweaking ready, MySQL DB should connect, open and work for you like a charm.

10. Nov. 2008

As for todays hosting is mainly done on UNIX systems transfering websites can be done quick and reliable using UNIX commands. And therefore a changing your Hosting Provider can become fairly easy.

Instead of downloading all content from Server A to your local system using a however clever FTP Client and later uploading it again to Server B, this whole file transfer can be done within one step using a server to server copying command.

As a basic requirement to use this feature, you have to have secure shell access onto both servers. Being logged in to one server (it doesn’t matter which one) you can use SCP command to transfer all your files. The syntax of the command is fairly easy and it is part of the command to specify source and target system and therefore is doesn’t matter if you are pulling or pushing the files.

Easy command line examples for an SCP command would be:

Copying file to host:

scp SourceFile user@host:directory/TargetFile

Copying file from host:

scp user@host:directory/SourceFile TargetFile

Using the -R option as well will allow you to transfer whole directory trees within one single copy command.

While transfering all files and perhaps several domain can take up several days depending on the size and complexity of your hosting, it can occur that parts of the original files are already changed again until the final go life.

To prevent differences in between source and new target system a final update of both system shortly before switching over does make sense. Here now the command RSYNC will help us.

With RSYNC you can syncronize files and folders between systems.

Again an easy command line example would be:

rsync -r user@host:directory/SourceFolder TargetFolder

Also here source and target system needs to be specified and therefore both sending and receiving are possible.

7. Nov. 2008

Working with LAMP (Linux, Apache, MySQL and PHP) Applications we sooner or later do run into the need to change our actual runtime environment for it. Mostly based on specific PHP settings an application does need to be able to run first, we have to specify, change or increase PHP default settings, but do feel somewhat handicapped within a shared hosting environment. Usually Admins there do not allow everybody allow to modify or hack their central configuration files on the server.

But also for this situation clever developers have thought about a trick to help their community to overcome such hassle.

As a matter of fact it is possible to change PHP configuration settings within .htaccess very easily for everyone.

For example it is possible to

Prevent Global Variable Injection Attacks with:

    • php_flag register_globals off

    Prevent Cross Site Scripting (XSS) Attacks with:

      • php_flag allow_url_fopen off

      Prevent Code Injection Attacks with:

        • php_flag magic_quotes_gpc on

        To do so

        1. Open the .htaccess file located in your site’s home directory, or if you don’t have one, create a blank one now.

        2. Add any of the following code samples to your .htaccess file, each on it’s own line.

        « previousnext »