Securing-Optimizing-RH-Linux-1_2_413
Comments and suggestions concerning this book should be mailed to gmourani@videotron.ca
© Copyright 1999-2000 Gerhard Mourani and Open Network Architecture ®
413
containing settings that will define the behavior of phplib and follow its instruction to define the
storage container you'll want to uncomment.
[root@deep /]# cp /home/httpd/horde/phplib/horde_phplib.inc /home/httpd/php/local.inc
cp: overwrite `/home/httpd/php/local.inc'? y
Edit the local.inc file (vi /home/httpd/php/local.inc) then uncomment and set the following lines to
define SQL as your default database:
/* To use an SQL database, uncomment and edit the following: */
class HordeDB extends DB_Sql {
var $Host = 'localhost';
var $Database = 'horde';
var $User = 'www';
var $Password = 'some-password';
var $Port = '5432';
function halt($msg) {
printf("<b>Database error (HordeDB):</b> %s<br>\n", $msg);
}
}
class HordeCT extends CT_Sql {
var $database_class = 'HordeDB'; // Which database class to use...
var $database_table = 'active_sessions'; // and find our data in this table.
}
NOTE: Dont forget to uncomment in this file the type of storage container you want to use for
Webmail IMP. Remember to uncomment only one type. In our case we chose to use SQL. Also
the parameters you must set for SQL database are the var $User =, var $Password =, and
var $Port =. The var $User = correspond to yours httpd username in our case www, var
$Password = corespond to the password for the user www you have defined in PostgreSQL,
and var $Port = is the IP port number to connect to your SQL database.
Step 6
Finally edit the /home/httpd/php/prepend.php3 file and specifies your default database type.
Edit the prepend.php3 file (vi /home/httpd/php/prepend.php3) then change the following line to
define PostgreSQL as your database type:
require($_PHPLIB["libdir"] . "db_mysql.inc");
To read:
require($_PHPLIB["libdir"] . "db_pgsql.inc");
Configure your php.ini configuration file of PHP4
Another setting you need to make is in your PHP4 configuration file /etc/httpd/php.ini. This
adjustment is require to define which features such as IMAP, PostgreSQL and other you want to
support and be loaded automaticly by PHP4. Since we decide to use PostgreSQL as our
database and need to use IMAP feature in our Webmail software, we must define them in the
php.ini configuration file of PHP4.
Step 1
Edit the php.ini file (vi /etc/httpd/php.ini) and add under the Dynamic Extensions section your
desired choices. In our case we chose IMAP and PostgreSQL support:
extension=imap.so
; Added for IMAP support