for Sun Software Partners Web and more

Friday May 01, 2009

NetBeans 6.5 comes now with the PHP support, and OpenSolaris looks like a great development and deployment platforme for AMP (Apache, MySQL, PHP) developers. In order to confirm this (or not) I'm going to go through the full lifecycle of a real, thus complex PHP application.

For the hardware, I'll be simply using my laptop running OpenSolaris 2008.11 as my development and deployment machine.

Concerning the AMP stack I'll be using the Sun Glassfish Web Stack 1.4 that comes as an IPS package (called amp-dev) for OpenSolaris. The Web Stack, among other things, offers the Apache 2 http server, MySQL 5.0 and PHP 5, all nicely bundled together and fully optimized for OpenSolaris. It also comes with a very handy (and simple) GUI that allows you to start/stop easily your servers, but also to set some options for each component. You can also open directly the different configuration files (hhtp.conf, my.cnf, php.ini) directly from the GUI. I don't know about you, but I always tend to forget where all theses configuration files are after a while, so having everything under hand by a simple click is quite useful to me ! If you want more information on this topic you can go to one of my previous posts: OpenSolaris and the AMP stack.

As for the PHP application, I chose Olio which is a web2.0 toolkit to help evaluate the suitability, functionality and performance of web technologies. Olio defines an example web2.0 applications, so it should be a good candidate.

For a more detailed presentation of Olio you can check the following presentation.

Now that the stage has been set let the fun begin.

First step: Downloading Olio.

The instructions are quite clear for an anonymous access of the repository. I first go to the directory I wish downloading the sources to.

[/] # cd /export/home/Projects/End_To_End_PHP

Now I just need to download from the repository using subversion:

# svn checkout https://svn.apache.org/repos/asf/incubator/olio/ olio

That's pretty much it !

[/export/home/Projects/End_To_End_PHP/olio] # ls -l

total 9

drwxr-xr-x 3 aj210858 staff 7 2009-01-19 16:22 board
drwxr-xr-x 3 aj210858 staff 5 2009-01-19 16:22 docs
drwxr-xr-x 5 aj210858 staff 8 2009-01-19 16:22 geocoder
drwxr-xr-x 3 aj210858 staff 3 2009-01-19 16:22 import
drwxr-xr-x 5 aj210858 staff 5 2009-01-19 16:22 webapp
drwxr-xr-x 5 aj210858 staff 5 2009-01-19 16:20 workload

One first nice thing about OpenSolaris: the svn program (Subversion) was already there, (which is not the case on Solaris 10) so no hassle there. However I'm not quite sure if it comes directly with OpenSolaris, or if it was installed by the Web Stack (since the package SUNWsvn is part of Web Stack's dependencies).

Installing Faban

Reading Olio's documentation I find out that I need to set up the Faban workload tool first, before proceeding to build Olio itself.

Faban, is an open source framework for developing and running multi-tier server benchmarks (such as web/cache/database benchmarks).

Since I'm on OpenSolaris might as well check if I can get it from one of my favorite IPS repositories: Unfortunately not. I need to go with the manual download / installation process.

Installing Faban is quite straight forward (just follow the installation process) so I will not fo into details here.

I chose to install it under /export/home: A “faban” subdirectory is created and from now on we will refer to /export/home/faban as $FABAN_HOME

We can check that Faban is running fine by going on http://<my_host>:9980


Faban

Building the Faban benchmark in NetBeans

As we said Faban is now installed but we still need to install the load driver before installing the Web application itself.

What confuses me is, should I build it with NetBeans or not ? After reading the Olio documentation (under $OLIO_HOME/docs/php_setup.html), it's not necessary. You would just need a JRE and ant. By the way, I ran into a first issue here: I thought that ant came with NetBeans, but I didn't manage to find it. So had to install it from the OpenSolarisDeveloper repository. Not a big deal, but somehow surprising...

So using NetBeans to build Faban is not necessary but since all this post is about NetBeans lets give it a try.

Another thing confused me here: Faban is a Java application, however you will find the sources under workload/php !

Now let's create our Java project to host the Faban source files

At first I chose “New Java Project with Existing Sources”, and used the provided nbbuild.xml file as the build script. This was a bad option. As you can see here you can not choose the build.xml file that comes with the sources. NetBeans creates it's own nbbuild.xml file.

So I went back and chose to create a project as “New Java Free-Form Project”. In this case as you can see, I can choose the existing build.xml file, as well as the source location.



Finally, set the following jars in the project's classpaths in order to avoid the warning icons. However it works fine even without this trick since the classpaths are correctly set in the build.xml file.


Once this step done, the Faban sources are imported in NetBeans in new project. Just build the project to get  the finale JAR under $OLIO_HOME/workload/build/Web20Driver.jar

This jar must be copied to $FABAN_HOME/benchmarks directory, and you are all set.

At this point everything seems to be ready for the final steps: Importing Olio sources into a NetBeans project and building and deploying the system. I will discuss those steps in an upcoming post. 

So stay tuned ...

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed