Installation of Other Packages needed by ActionApps

From ActionApps Documentation
Jump to: navigation, search

These instructions will help you get APC-AA running on a bare-bones linux box, if you are running apc-aa on a system provided by an ISP then none of this should be needed, just check that they are running PHP 4.1.0 or later, and a reasonably up to date version of MySQL.
Note that it's beyond the scope of this document to give you a detailed information about the installation of production Apache/Mysql hosting environment. Instead, we just want to outline the installation process - for further reading check installation documentation for each component (Apache, Mysql, PHP) .

A quick test is to upload the apc-aa (as described in install-4.html and then go to http://your.host/apc-aa/test.php3, if that works ok and gives you detailed information on your PHP installation, then everything else SHOULD be fine.

Platform

The installation instructions given here are intended for use with RedHat Linux. We used version 7.3 in this example. This specifically means that the rpm tool is used wherever possible.

If your system does not support the rpm tool, most procedures will be quite different from what is shown here. You will probably have to do most installations by building the software itself. It is beyond the scope of this document to describe that although necessary configurations options will be mentioned.

MySQL database back end

Check if you have already MySQL 3.22.32 or newer installed:

% rpm -q MySQL

If MySQL has been installed from source ,then RPM will report it is not installed, try "ps efax | grep mysql" to see if it is running, and if it is then either "/usr/sbin/mysqld -V" will report the version on newer versions. If this doesn't exist then running the client with, "mysql" should report the version number it is connected to.

If it is not installed or if the version used is too old, install it. The MySQL is now a part of a standard RedHat distribution, so you should be able to find necessary packages on your RedHat CD-ROM under /RedHat/RPMS, or download them via FTP from your nearest mirror site. You can also download RPM packages directly from http://www.mysql.com/downloads/mysql.html, but be aware that these packages are different from the ones that ships with RedHat distributions, so you will have to keep them up to date manually (they won't update with the OS updates). Use the stable release version, you probably won't need MAX (version that supports transactions etc..).

The following instructions assume that you have downloaded RedHat packages:

As root, install the RPMs:

# rpm -Uvh mysql-3.23.49-3.i386.rpm
# rpm -Uvh mysql-server-3.23.49-3.i386.rpm
# rpm -Uvh mysql-devel-3.23.49-3.i386.rpm

This command will install the MySQL database server, shared libraray, client program and headers, create some administrative tables. It also creates a file /etc/rc.d/init.d/mysqld

Use the script to start the server:

# /etc/init.d/mysqld start

Since the server is now running, it can be accessed. It is a good idea to immediately set a password for the MySQL root user. Remind the password - better not use mysqlpass for obvious reasons. We will refer to this password as the mysql root password.

# mysqladmin -u root password 'mysqlpass'

You probably want the mysql server to start automatically with the system boot up. To achieve this, use chkconfig to create symbolic links and symbolic links in /etc/rc.d/rc?.d/ so the server is started and stopped properly on system start and shutdown.

# chkconfig --level 345 mysqld on
# chkconfig --level 0126 mysqld off

OpenLDAP

Package Installation

Note: You only need the OpenLDAP server if you decided to use LDAP as the permission system. Only do this if you know what you are doing. Generally, people use mysql as their permission system

If you want to install OpenLDAP, see the [ldap.html apc-aa LDAP page]

Installing the Apache Web Server

Use the RPM that comes from RedHat. We have had success with many of the the versions since 1.3.9. You need to install the "devel" packages, too.

To find out which version of apache httpd you have, use:

% httpd -v
Server version: Apache/1.3.9 (Unix)  (Red Hat/Linux)
Server built:   Apr  7 1999 17:17:41

To install the apache web server, use these commands. Not that in this example, the apache itself was already installed, but the development package was missing (this is the default case for RedHat Linux).

# rpm -Uvh /mnt/cdrom/RedHat/RPMS/apache-1.3.23-14.i386.rpm
package apache-1.3.23-14 is already installed
# rpm -Uvh /mnt/cdrom/RedHat/RPMS/apache-devel-1.3.23-14.i386.rpm
apache-devel-1.3.23-14

Configuring the web server is a task for a later point in time because RPM will do part of this work.

PHP

PHP installation

PHP runs within the apache web server as a module. We need a version of php which includes support for two optional php modules, namely ldap and mysql. These modules provide access to ldap and mysql databases, respectively, from php programs. (If you don't use ldap with the ActionApps, you will not need the ldap php support.)

There are many ways to install all this, and many can generate a lot of trouble. The cleanest and easiest way is, again, to use RPMs.

# rpm -Uvh php-4.1.2-7
# rpm -Uvh php-mysql-4.1.2-7.i386.rpm
# rpm -Uvh php-ldap-4.1.2-7.i386.rpm

Testing php installation

First, create a test WWW page to find out the status of php support on your system. This can be done easily by executing this command (assuming /home/httpd/html is your DocumentRoot directory:

echo "<?php phpinfo() ?>" > /home/httpd/html/test.php

Access the page with a web browser (http://localhost/test.php).

  • If you see a page beginning with PHP Version, you have a working php. Browse through the Configuration section. Look for an extension named MySQL and, if you are using the LDAP permission system, for one named LDAP. If both are there, you are lucky because the php setup is complete; otherwise, you must install the missing parts.
  • If you see the string php phpinfo() ?, you do not have php4 installed or at least it is not enabled. In which case, you can try again with a test file test.php3 which will work if the PHP3 is installed. APC-AA should work with this.

Configuring the apache web server

RedHat >= 8.0 now comes with Apache 2 by default. There are some major changes in Apache 2 configuration that this guide doen't reflect. We have several production systems running under Apache 2, however there were few issues with compatibility between Apache 2 and PHP. Check out the [install-7.html Troubleshooting section] of this guide and also mailinglists on Sourceforge for the latest information about Apache 2 issues.
During the PHP installation using RPMs, most of the configuration work for the web server is already done. If you didn't use RPM to install PHP, you might have to do the following steps. (It does no harm to double check if everything is configured correctly anyway.)

The configuration for the apache takes place in the file /etc/httpd/conf/httpd.conf.

You will need the statement Options +Includes there. This enables the so-called server side includes (SSI) which are used by the page the users read (which contain the actual content). This can be a security problem because whoever can edit these pages can run any command on your web server. (IncludesNOEXEC is not enough.) You might want to consider to enable this only for the directories where it is needed with <Directory> statements. See also the chapter on [install-6.html#security security] .

In /etc/httpd/conf/httpd.conf, make sure these lines are not commented out:

AddType application/x-httpd-php .php .php4 .php3 .phtml

and

 AddType text/html .shtml
AddHandler server-parsed .shtml

"Commented out" means That they are prepended by a "#". Remove the leading "#" from the lines if it is there.

Add index.php3 to the DirectoryIndex line:

DirectoryIndex index.html index.shtml index.cgi index.php3

Restart the web server to reread the configuration files:

# /etc/rc.d/init.d/httpd restart

After these configuration steps, PHP and server side includes should work. You can test PHP by browsing to your test page ( http://localhost/test.php3) again.

To test if SSI works, create sample .shtml file. This can be for example done by executing this command (assuming /home/httpd/html is your DocumentRoot directory:

echo "" > /home/httpd/html/test.shtml

Now test it by browsing to your test page ( http://localhost/test.shtml). You should see the same output as when browsing test.php3 page. If not, reffer to the SSI documentation http://httpd.apache.org/docs/howto/ssi.html.

PHP.INI and PHPLIB installation

Installing PHP lib is no longer necessary, it comes with APC-AA software now.

However, there are still some informations about the php engine setting, which APC-AA software requires at the moment (will not in future releases) . First use the php test page ( http://localhost/test.php) you have to check what the current values are. If some of the values is not in order (see below), you may need to edit the php.ini (or php3.ini) or httpd.conf, and change few configuration lines, this file is typically /etc/httpd/php.ini or /etc/php.ini or /usr/local/lib/php.ini

Edit php.ini so the lines looks something like this:

allow_call_time_pass_reference = On
register_globals = On ; needed so that POST parameters end up in global variables
magic_quotes_gpc = On ; needed to avoid various bugs with untested code!
file_uploads= On

Alternatively, you can set these up localy in the corresponding section of apache configuration, in /etc/httpd/conf/httpd.conf

php_flag allow_call_time_pass_reference  On
php_flag register_globals  On
php_flag magic_quotes_gpc  On
php_flag file_uploads On

Restart the webserver to use the new settings file.