HP 5991-5565 manual Apache Http Server Status and Information

Page 19

You can force a heavier load on the Apache HTTP Server by increasing the number of concurrency requests with the -coption, and by prolonging the testing round by increasing the number of requests with the -noption.

NOTE: If you encounter the following error:

socket: Too many open files (24)

You can correct the error by entering the following:

#ulimit -n <NUMBER>

This command increases the limit on the number of open files only for the current shell session. The increased limit is applicable to the newly launched commands on that shell after the change. Commands that you launched previously continue to use the previous limit.

Apache HTTP Server Status and Information

You can obtain various pieces of information regarding your Apache HTTP Server by configuring the mod_status and mod_info module requests within the httpd.conf configuration file. The mod_status module is configured using the server-statusrequest and the mod_info module is configured using the server-inforequest. For example, you can find out the current hosts and requests being processed, whether the server was started or restarted, and basic server configuration information. These two functions help you monitor your Apache HTTP Server.

Configuring and Using the Modules

Use the following steps to enable these two modules to collect and display information.

1.Edit the /etc/apache2/mod_status.conf file and add the following lines:

<IfModule mod_status.c> <Location /server-status>

SetHandler server-status Order deny,allow

Deny from all

Allow from YOUR_WEB_BROWSER_IP </Location>

</IfModule>

2.Edit the /etc/apache2/mod_info.conf file and add the following lines:

<IfModule mod_info.c> <Location /server-info>

SetHandler server-info Order deny,allow Deny from all

Allow from YOUR_WEB_BROWSER_IP </Location>

</IfModule>

3.Modify the /etc/sysconfig/apache2 file by appending the following to the

APACHE_MODULES definition: info status

The APACHE_MODULES definition should now look like the following:

APACHE_MODULES="actions alias auth_basic authn_file authz_host authz_groupfile authz_default authz_user authn_dbm autoindex cgi dir env expires include log_config mime negotiation setenvif ssl suexec userdir php5 info status"

4.Restart the Apache HTTP Server for the changes take effect.

Installing, Configuring, and Managing Web Server Middleware Stack Components 19

Image 19
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 Installing the Linux Distribution Installing and Verifying the Linux DistributionRequired Packages and Installation Recommendations 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.sh file, add the following lines # ln -s /usr/java/jdk1.5.010 /usr/local/jdkFor the alljava.csh 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# /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 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-modphp5Integrating the Apache Web Server and Python Connecting Tomcat to a DatabaseWeb page displays the following text # 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 OperationEnabling Https Support in the Apache Http Server Secure the Web Server StackRestart Apache by entering the following 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