Sunday, February 27, 2011

Apache, Plugin, and WebSphere Application Server 7 on LINUX

Install apache 2.2 on Linux.
sudo apt-get install apache2
Download and install the plugin.

/etc/apache2/apache2.conf includes the /etc/apache2/httpd.conf file.
# Include all the user configurations:
Include httpd.conf
/etc/apache2/httpd.conf file includes the following codes. 
  • LoadModule was_ap22_module /opt/IBM/WebSphere/Plugins/bin/mod_was_ap22_http.so
  • WebSpherePluginConfig /opt/IBM/WebSphere/Plugins/config/apache01/plugin-cfg.xml
Note that it is was_ap22_mode, not was_ap20_mode. Otherwise, you may have an error complaining about a socket address format.

The .so file is the actually native code module performing the plugin function. The LoadModule directive is to load the native code at the initiation of the plugin proram. The second directive is telling the web server and plugin program where to find the configuration of the plugin program.

For example, when the web server gets a request:
http://DFAPP01.com/hello
The request is sent to the web server. However, as soon as the plugin is installed, according to IBM documentation, the plugin examines all the incoming requests for the web server and forward requests for static contents to the web server and dynamic pages to the app server. The plugin sends right page back the requesting browser.

Two more notes -
  1. Installing IBM HTTP server 7 can encounter Java incompatibility, you may have to run the following, sometimes, without success. 
    java -cp `pwd`/setup.jar -Xms48m -Xmx384m run
  2. Also, in Windows, running genPluginCfg.bat may run into a run time exception PLGC0033E that requires you to open an IBM PMR to manage.
"PLGC0033E: A run-time exception occurred while generating the plug-in configuration:
Explanation: A problem resulted from generating the configuration file.
User Response: Examine the exception for nested exceptions and error codes. Rerun the GenPluginCfg script with the -debug option set to yes (GenPluginCfg -debug yes), to see trace details. If the problem persists, see the problem determination on the WebSphere Application Server Support Web page on http://www.ibm.com/software/webservers/appserv/was/support/."
You can test the web server and web server plugin installation and cnfiguration, by using browser to bring up WAS default applications via the web server default transport 80. http://DFAPP01.com:80/hello

Star, stop, and restart and configuration change
sudo /etc/init.d/apache2 stop
sudo /etc/init.d/apache2 start
sudo /etc/init.d/apache2 restart
Recycle the application server after web server plugin changes.

    No comments: