HP 5991-5565 manual HP Open Source Web Server Middleware Stack, Web Server Stack Architecture

Page 11

HP Open Source Web Server Middleware Stack

The following components comprise the HP OSMS Web Server Middleware Stack:

Apache Web Server

The Apache Web Server is a mature open source web server that has

 

become the de facto standard because of its high adoption rate on

 

the Internet.

Apache Tomcat

Apache Tomcat (or Tomcat) is a J2EE servlet and JavaServer Pages

 

(JSP) engine for developing and deploying web applications. It also

 

includes other features, such as an embedded web server.

Hibernate

Hibernate is an object/relational persistence and query service for

 

Java. Hibernate provides support for collections and object relations,

 

and composite types. In addition to persisting objects, Hibernate

 

provides a rich query language to retrieve objects from the database,

 

and an efficient caching layer and Java Management Extensions (JMX)

 

support. User-defined data types and composite primary keys give

 

additional flexibility to support legacy applications.

mod_jk

The mod_jk module is commonly used to allow Tomcat to handle

 

Java Servlet and JSP requests while Apache httpd handles requests

 

for static and dynamic contents implemented in PHP, Perl, or Python.

mod_ssl

The mod_ssl module provides a Secure Sockets Layer (SSL) and

 

Transport Layer Security (TLS) implementation that allows web

 

applications running within the Apache Web Server to communicate

 

securely with their respective clients. Communication can still occur

 

over standard HTTP while running mod_ssl.

Perl

Perl (Practical Extraction and Report Language) has long been a

 

popular text-processing language. Recently, Perl has become popular

 

for the development and deployment of web applications.

PHP

PHP is a scripting language that can be embedded in HTML pages,

 

allowing developers to add more dynamic contents to their web

 

applications. A large portion of the PHP syntax is similar to C and

 

Java.

Python

Python is an object-oriented language that has a clean, straightforward

 

syntax. Python can be extended to exploit facilities implemented in

 

other programming languages, such as C and C++.

JDK

The Java Platform Standard Edition Development Kit (JDK) is a

 

development platform for building Java-based applications and

 

components.

Web Server Stack Architecture

This section provides architecture, configuration, and the software environment for a web server stack. Figure 1 shows the logical architecture of the stack.

HP Open Source Web Server Middleware Stack 11

Image 11
Contents HP Open Source Middleware Stacks Blueprint Copyright 2007 Hewlett-Packard Development Company, L.P Table of Contents Monitor Tomcat with OpenView Tomcat SPI Oracle Database Test Webalizer Usage ReportPage List of Tables Page Intended Audience HP ServicesIntroduction Executive SummaryFeedback@fc.hp.com Typographic ConventionsHP Encourages Your Comments UserInputWeb Server Stack Architecture HP Open Source Web Server Middleware StackWeb Server Stack Architecture Required Packages and Installation Recommendations Installing and Verifying the Linux DistributionInstalling the Linux Distribution YaST Software Selection and System Tasks Verifying the Linux Distribution Installation# /etc/init.d/apache2 start Configuring the Basic Apache Http ServerInstalling and Configuring Sun JDK on an HP Proliant System TomcatFor the alljava.csh file, add the following lines # ln -s /usr/java/jdk1.5.010 /usr/local/jdkFor the alljava.sh file, add the following lines # /usr/local/apache-tomcat/bin/startup.sh Installing and Configuring Tomcat# java -version Following messages appear# /usr/local/apache-tomcat/bin/shutdown.sh Advanced Apache Http Server FeaturesUsing the Apache Http Server Benchmarking Tool If necessary, stop Tomcat by entering the following commandRestart the Apache Http Server for the changes take effect You can correct the error by entering the followingApache Http Server Status and Information Apachemodules definition should now look like the followingApache Server Information web page opens, as shown in Figure Apache Server Status web page opens, as shown in Figure# webalizer Apache Http Server Log# /etc/init.d/apache2 restart Create the following file Using Virtual Host SupportFor detailed information, see the Webalizer website at On the second server, create the following Html file Using Apache Http Server URL RedirectionConfigure virtual hosting by creating a file named Add the following lines to the preceding file Using Apache Http Server Proxy FeaturesEdit the following configuration file Add the following line to the preceding fileCreate the following Html file Error Responses and RedirectsPopulate the preceding file with the following lines Using Per-User Web DirectoriesIntegrating the Web Server Stack Components Configuring the Apache and Tomcat ConnectorHttp//YOURHOSTNAME/jsp-examples Restart Apache by entering the following commandIf there are any errors, check the following log files Insert the following line below the DocumentRoot lineCreate the following test file Integrating the Apache Web Server and PHPIntegrating the Apache Web Server and Perl # rpm -q php5 apache2-modphp5Web page displays the following text Connecting Tomcat to a DatabaseIntegrating the Apache Web Server and Python # tar zxf mysql-connector-java-version.tar.gz Connecting Tomcat and MySQL# /etc/init.d/mysql start # mysqladmin -u root -p create osmsdb# $CATALINAHOME/bin/startup.sh # ps -efgrep mysqldTest page opens as shown in Figure Connecting Tomcat and OracleIf needed, start Tomcat by entering the following command Http//YOURHOSTNAME8080/mysqltest.jspCreating an Oracle Data Source Obtaining and Installing the Oracle Jdbc DriverConfiguring the Oracle Server Testing the Oracle Database ConnectivityOracle Database Test Http//YOURHOSTNAME8080/oracleTest.jsp# mysql -u root -p Password Connecting Tomcat to MySQL or Oracle Using HibernateInstalling Hibernate, Tomcat, and JDK Configuring a Database Driver in TomcatFor an Oracle database server Creating a Simple Application in Tomcat# sqlplus osmsusr/osmspass@osmsdbora For a MySQL database serverAsm.jar asm-attrs.jar antlr-2.7.6rc1.jar File HibernateSessionFactory.class is generated This directory, create a Hibernate Pojo file named Preceding command creates a class file namedHttp//YOURHOSTNAME8080/SimpleDemo/hibernate.jsp Verifying the Simple Application OperationRestart Apache by entering the following Secure the Web Server StackEnabling Https Support in the Apache Http Server Create the following test Html file Apache Http Server AuthorizationApache default document root is Verify that the certificate is displayed as in FigureIf the login fails, the following message appears Protecting Apache Http Server Authorization with Symas CDSConfiguring Apache Http Server Services Html Head Protecting Tomcat Authorization with Symas CDSHtml Head # $CATALINA/bin/shutdown.sh # $CATALINA/bin/startup.sh Monitor Tomcat with OpenView Tomcat SPITomcat SPI Components Software Prerequisites and Reference GuidesPolicies ToolsComplete these steps Complete these steps # /sbin/SuSEfirewall2 stop Appendix B Frequently Asked QuestionsAppendix C Vendor Information Reference Appendix D Hibernate Test Application Source Code Following are the contents of the hibernate.jsp filePage Appendix D Hibernate Test Application Source Code