HP 5991-5565 manual # ln -s /usr/java/jdk1.5.010 /usr/local/jdk

Page 16

1.Download the Sun JDK package from the Java website and install as follows (see Table 1 (page 12) for the correct version and website link):

Change to the Sun JDK install package directory, as appropriate for your system, and install the package by entering the following command:

#chmod 755 jdk-1_5_0_10-linux-amd64-rpm.bin

#./jdk-1_5_0_10-linux-amd64-rpm.bin

2.Create a symbolic link for Sun JDK by entering the following:

#ln -s /usr/java/jdk1.5.0_10 /usr/local/jdk

3.The JAVA_HOME environment variable must be properly set before stack components, such as Tomcat, can begin executing.

To export the JAVA_HOME environment variable, modify the system file that is appropriate for your shell, /etc/profile.d/alljava.sh or /etc/profile.d/alljava.csh:

For the alljava.sh file, add the following lines:

if [ -x /usr/local/jdk/bin/java ] ; then

export PATH=$PATH:/usr/local/jdk/bin export JAVA_BINDIR=/usr/local/jdk/bin

export JAVA_ROOT=/usr/local/jdk export JAVA_HOME=/usr/local/jdk export JRE_HOME=/usr/local/jdk unset JDK_HOME

unset SDK_HOME

export JDK_HOME=/usr/local/jdk export SDK_HOME=/usr/local/jdk

else

if [ -x /usr/lib/java/jre/bin/java ] ; then

#it is IBMJava2-JRE or SunJava2-JRE export PATH=$PATH:/usr/lib/java/jre/bin export JAVA_BINDIR=/usr/lib/java/jre/bin export JAVA_ROOT=/usr/lib/java

export JAVA_HOME=/usr/lib/java/jre export JRE_HOME=/usr/lib/java/jre unset JDK_HOME

unset SDK_HOME

fi

fi

For the alljava.csh file, add the following lines:

if ( -x /usr/local/jdk/bin/java ) then setenv PATH ${PATH}:/usr/local/jdk/bin setenv JAVA_BINDIR /usr/local/jdk/bin setenv JAVA_ROOT /usr/local/jdk setenv JAVA_HOME /usr/local/jdk setenv JRE_HOME /usr/local/jdk unsetenv JDK_HOME

unsetenv SDK_HOME

setenv JDK_HOME /usr/local/jdk setenv SDK_HOME /usr/local/jdk

else

if (-x /usr/lib/java/jre/bin/java)then #it is IBMJava2-JRE or SunJava2-JRE setenv PATH ${PATH}:/usr/lib/java/jre/bin setenv JAVA_BINDIR /usr/lib/java/jre/bin setenv JAVA_ROOT /usr/lib/java

setenv JAVA_HOME /usr/lib/java/jre setenv JRE_HOME /usr/lib/java/jre unsetenv JDK_HOME

unsetenv SDK_HOME endif

endif

16

Image 16
Contents HP Open Source Middleware Stacks Blueprint Copyright 2007 Hewlett-Packard Development Company, L.P Table of Contents Monitor Tomcat with OpenView Tomcat SPI Webalizer Usage Report Oracle Database TestPage List of Tables Page HP Services IntroductionExecutive Summary Intended AudienceTypographic Conventions HP Encourages Your CommentsUserInput Feedback@fc.hp.comHP Open Source Web Server Middleware Stack Web Server Stack ArchitectureWeb Server Stack Architecture Installing the Linux Distribution Installing and Verifying the Linux DistributionRequired Packages and Installation Recommendations Verifying the Linux Distribution Installation YaST Software Selection and System TasksConfiguring the Basic Apache Http Server Installing and Configuring Sun JDK on an HP Proliant SystemTomcat # /etc/init.d/apache2 startFor the alljava.sh file, add the following lines # ln -s /usr/java/jdk1.5.010 /usr/local/jdkFor the alljava.csh file, add the following lines Installing and Configuring Tomcat # java -versionFollowing messages appear # /usr/local/apache-tomcat/bin/startup.shAdvanced Apache Http Server Features Using the Apache Http Server Benchmarking ToolIf necessary, stop Tomcat by entering the following command # /usr/local/apache-tomcat/bin/shutdown.shYou can correct the error by entering the following Apache Http Server Status and InformationApachemodules definition should now look like the following Restart the Apache Http Server for the changes take effectApache Server Status web page opens, as shown in Figure Apache Server Information web page opens, as shown in Figure# /etc/init.d/apache2 restart Apache Http Server Log# webalizer For detailed information, see the Webalizer website at Using Virtual Host SupportCreate the following file Configure virtual hosting by creating a file named Using Apache Http Server URL RedirectionOn the second server, create the following Html file Using Apache Http Server Proxy Features Edit the following configuration fileAdd the following line to the preceding file Add the following lines to the preceding fileError Responses and Redirects Create the following Html fileUsing Per-User Web Directories Populate the preceding file with the following linesConfiguring the Apache and Tomcat Connector Integrating the Web Server Stack ComponentsRestart Apache by entering the following command If there are any errors, check the following log filesInsert the following line below the DocumentRoot line Http//YOURHOSTNAME/jsp-examplesIntegrating the Apache Web Server and PHP Integrating the Apache Web Server and Perl# rpm -q php5 apache2-modphp5 Create the following test fileIntegrating the Apache Web Server and Python Connecting Tomcat to a DatabaseWeb page displays the following text Connecting Tomcat and MySQL # tar zxf mysql-connector-java-version.tar.gz# mysqladmin -u root -p create osmsdb # $CATALINAHOME/bin/startup.sh# ps -efgrep mysqld # /etc/init.d/mysql startConnecting Tomcat and Oracle If needed, start Tomcat by entering the following commandHttp//YOURHOSTNAME8080/mysqltest.jsp Test page opens as shown in FigureObtaining and Installing the Oracle Jdbc Driver Configuring the Oracle ServerTesting the Oracle Database Connectivity Creating an Oracle Data SourceHttp//YOURHOSTNAME8080/oracleTest.jsp Oracle Database TestConnecting Tomcat to MySQL or Oracle Using Hibernate Installing Hibernate, Tomcat, and JDKConfiguring a Database Driver in Tomcat # mysql -u root -p PasswordCreating a Simple Application in Tomcat # sqlplus osmsusr/osmspass@osmsdboraFor a MySQL database server For an Oracle database serverAsm.jar asm-attrs.jar antlr-2.7.6rc1.jar File HibernateSessionFactory.class is generated Preceding command creates a class file named This directory, create a Hibernate Pojo file namedVerifying the Simple Application Operation Http//YOURHOSTNAME8080/SimpleDemo/hibernate.jspEnabling Https Support in the Apache Http Server Secure the Web Server StackRestart Apache by entering the following Apache Http Server Authorization Apache default document root isVerify that the certificate is displayed as in Figure Create the following test Html fileProtecting Apache Http Server Authorization with Symas CDS If the login fails, the following message appearsConfiguring Apache Http Server Services Protecting Tomcat Authorization with Symas CDS Html HeadHtml Head Monitor Tomcat with OpenView Tomcat SPI # $CATALINA/bin/shutdown.sh # $CATALINA/bin/startup.shSoftware Prerequisites and Reference Guides Tomcat SPI ComponentsTools PoliciesComplete these steps Complete these steps Appendix B Frequently Asked Questions # /sbin/SuSEfirewall2 stopAppendix C Vendor Information Reference Following are the contents of the hibernate.jsp file Appendix D Hibernate Test Application Source CodePage Appendix D Hibernate Test Application Source Code