HP Open Source Middleware Stacks Blueprint: LAMP Architecture on HP ProLiant BladeSystem Servers on SLES HP Part Number: 5992-4863 Published: September 2008 Edition: 1.
© Copyright 2008 Hewlett-Packard Development Company, L.P. Legal Notice Confidential computer software. Valid license from HP required for possession, use or copying. Consistent with FAR 12.211 and 12.212, Commercial Computer Software, Computer Software Documentation, and Technical Data for Commercial Items are licensed to the U.S. Government under vendor's standard commercial license. The information contained herein is subject to change without notice.
Table of Contents Introduction ...........................................................................................................................................7 Executive Summary...........................................................................................................................7 Intended Audience............................................................................................................................7 Scope and Purpose......................................
List of Figures 1 2 3 4 5 4 LAMP Environment Architecture...................................................................................................9 Apache Server Status.....................................................................................................................12 Apache Server Information...........................................................................................................13 Webalizer Usage Report.......................................................
List of Tables 1 Software Test Configuration...........................................................................................................
Introduction Executive Summary The HP Open Source Integrated Portfolio (HP OSIP) comprises a range of products and services designed to ensure that customers can successfully realize the cost and feature benefits of adopting open source software in their IT environments. HP Open Source Foundation components include the base components of an open source-based ecosystem: HP servers and storage are validated to run the Linux operating system together with commercial Linux distributions from Red Hat.
Typographic Conventions This document uses the following typographical conventions. Command ComputerOut Ctrl-x ENVIRONVAR [ERRORNAME] Key Term UserInput VARIABLE \ (continuation character) ... | A command name or qualified command phrase. Text displayed by the computer. A key sequence. A sequence such as Ctrl-x indicates that you must hold down the key labeled Ctrl while you press another key or button. The name of an environment variable, for example, PATH.
Figure 1 LAMP Environment Architecture Table 1 lists the software this is used to test the configurations described in this blueprint. Table 1 Software Test Configuration Software Package Version Package Name Distributor Website Link Apache httpd 2.2.3-16.9 apache2-2.2.3-16.9.x86_64.rpm Novell Apache httpd website MySQL 5.0.26 mysql-5.0.26-12.8.x86_64.rpm Novell MySQL website mod_ssl 2.2.3-16.9 Included with Novell apache2-prefork-2.2.3-16.9.x86_64.rpm mod_ssl website mod_perl 2.0.2-14.
1. Start Apache by entering the following command: # /etc/init.d/apache2 start 2. Verify that Apache starts successfully by verifying that messages similar to the following appear in the /var/log/apache2/error_log log file: [Tue Jul 29 14:57:17 2008] [notice] Apache/2.2.3 (Linux/SUSE) configured -- resuming normal operations 3. Create a file named /srv/www/htdocs/apache.
4. To monitor the access status on the test system, display the end of the access log file by entering the following command: # tail -f /var/log/apache2/access_log The system displays a message similar to the following: 10.101.1.84 10.101.1.84 10.101.1.84 10.101.1.84 10.101.1.84 - - [10/May/2007:12:00:46 [10/May/2007:12:00:46 [10/May/2007:12:00:46 [10/May/2007:12:00:46 [10/May/2007:12:00:46 +0800] +0800] +0800] +0800] +0800] "GET "GET "GET "GET "GET /abtest.html /abtest.html /abtest.html /abtest.
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. 5. Restart your Apache HTTP Server for the changes to take effect. Verify that the /etc/apache2/sysconfig.d/loadmodule.conf file contains the following lines: LoadModule info_module /usr/lib64/apache2-prefork/mod_info.
2. Display the server information web page by opening a browser and entering the following website: http:///server-info The Apache Server Information web page opens, as shown in Figure 3. Figure 3 Apache Server Information Apache HTTP Server Log The Apache HTTP Server provides a detailed and flexible information-logging mechanism. The two most important log files are the error and access logs. The default location for the Apache HTTP Server log files is the /var/log/apache2 directory.
1. Verify that the Webalizer packages are installed by entering the following command: # rpm –q | grep webalizer If the package is not installed, locate the RPM package on the Linux distribution media and install it. 2. Modify the Webalizer configuration file /etc/webalizer.conf by adding the following lines: LogFile /var/log/apache2/access_log OutputDir /srv/www/htdocs/webalizer 3. Restart the Apache server by entering the following: # /etc/init.d/apache2 restart 4.
NOTE: file. For Windows systems, edit the C:\WINDOWS\system32\drivers\etc\hosts www.website1.com www.website2.com 2. Verify that both websites are resolved to the same IP address by entering the following commands: # ping www.website1.com # ping www.website2.com 3. Create the following two directories: /srv/www/htdocs/website1 /srv/www/htdocs/website2 4. Create a file named /srv/www/htdocs/website1/index.
The following message appears: This is www.website1.com In a second browser, enter the following URL: http://www.website2.com The following message appears: This is www.website2.com Using Apache HTTP Server URL Redirection The following procedure illustrates the use of the URL redirection feature which allows you to configure the Apache HTTP server to send requests for one URL to another URL. This requires the use of two servers that are both running Apache HTTP server. 1. 2. 3.
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 proxy proxy_connect proxy_ftp proxy_http" 3. On the second system, which acts as the Apache Proxy server, edit the following file: /etc/ apache2/default-server.
3. Verify the custom text error message by opening a browser and entering the following website: http:///non-exist The following message appears: The page you requested does not exist! Plain text example Customizing Local URL Redirect Responses The following procedure is an example showing how to customize a local URL redirect error message. 1. Edit the file /etc/apache2/errors.conf (or add it if it does not already exist) by entering the following line: ErrorDocument 404 "/missing.