/var/log/apache2/error_log /var/log/apache2/access_log /var/log/apache2/mod_jk.log

Integrating the Apache Web Server and PHP

The Apache Web server that is shipped with the supported Linux distribution includes a built-in PHP module. Therefore, no extra configuration is required for Apache. Use the following procedure to configure PHP:

1.Verify that PHP is installed by entering the following command:

# rpm -q php5 apache2-mod_php5

2.Create the following test file:

/srv/www/htdocs/test.php

Add the following lines to the preceding file:

<?

## test.php phpinfo(); ?>

3.Verify that PHP works by opening a browser and navigating to the following website : http://<YOUR_HOSTNAME>/test.php

A web page containing the PHP version and license numbers is displayed.

Integrating the Apache Web Server and Perl

The apache2–mod_perlmodule integrates a Perl interpreter into the Apache Web server, allowing you to use Perl when creating web applications. Use the apache2–mod_perlmodule provided by the Linux distribution.

To test the installation, perform the following steps:

1.Verify that the apache2–mod_perlmodule is installed by entering the following command:

#rpm -q php5 apache2-mod_php5

2.Create a sample file test file named /srv/www/cgi-bin/test.pland add the following lines:

#!/usr/bin/perl

print "Content-type: text/plain\n\n"; print "Hello World!\n";

3.Assign execute permissions to the file by entering the following command:

#chmod +x /srv/www/cgi-bin/test.pl

4.Edit the /etc/sysconfig/apache2 file by adding perl to the line with APACHE_MODULES. After completing this edit, the line should look like the following:

APACHE_MODULES=”... ... perl”

5.Restart Apache by entering the following command:

#/etc/init.d/apache2 restart

If there are any errors, check the following log files:

/var/log/apache2/error_log /var/log/apache2/access_log

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