Recompiling apache and php for webclient use

Zachariah Mully zmully-kolab at smartbrief.com
Fri Dec 17 01:41:45 CET 2004


All-

I found that the directions for installing the webclient were rather
vague, in particular, as to how to compile a new apache binary with the
proper DB support as Horde requires. Now I would not have had a problem
with this normally, but I'm still learning the openpkg system and I
wanted to recompile it within the openpkg system, so if this is obvious
to others, excuse my newb-ness with yet another package system.  I am
running this all on Debian stable.

First, export the root env variable for openpkg, this'll prevent a lot
of headaches since openpkg defaults to /openpkg without it:
#export opkg_root=/kolab

Also add openpkg to your path:
#export PATH=$PATH:/kolab/bin:/kolab/sbin

You'll need to install any dependencies for the new modules beforehand,
so get them from the openpkg.org site. In my case I needed mysql, mhash,
libmcrypt. The mhash and libmcrypt are only available from openpkg as
source rpms, so download them, build them and install the binary rpms:
#openpkg rpm --rebuild libmcrypt-2.5.7-20040207.src.rpm 
#openpkg rpm --rebuild mhash-0.9.1-20040513.src.rpm
#openpkg rpm
-Uvh /kolab/RPM/PKG/mhash-0.9.1-20040513.ix86-debian3.0-kolab.rpm 
#openpkg rpm
-Uvh /kolab/RPM/PKG/libmcrypt-2.5.7-20040207.ix86-debian3.0-kolab.rpm 

I recompiled mysql from source as well:
#openpkg rpm --rebuild mysql-4.0.21-2.2.0.src.rpm
#openpkg rpm -Uvh mysql-4.0.21-2.2.0.ix86-debian3.0-kolab.rpm

I already have a mysql server on another server, so you might want to
tweak the spec file for mysql if you're going to use this install for
the webclient. In my case I only needed it to satisfy a dependancy.

Next I recompiled php to include mysql support (it doesn't appear that
the php rpm distributed on the kolab mirrors has any db support
built-in), so download the src rpm from the kolab mirrors, install it
and edit the php.spec file in /kolab/RPM/SRC/php:

%option       with_dom                  yes
%option       with_gettext              yes
%option       with_imap                 yes
%option       with_mcrypt               yes
%option       with_mhash                yes
%option       with_mm                   yes
%option       with_mysql                yes
%option       with_openldap             yes
%option       with_pcre                 yes
%option       with_ssl                  yes
%option       with_xml                  yes
%option       with_zlib                 yes

Next, build the rpm:
#openpkg rpm -bb php.spec

Then install it:
#openpkg rpm -Uvh
--force /kolab/RPM/PKG/php-4.3.9-2.2.0.ix86-debian3.0-kolab.rpm

Next go grab the apache src rpm from one of the Kolab mirrors and
install it:
#openpkg rpm -Uvh apache-1.3.31-2.2.1_kolab.src.rpm

You'll find the apache source in /kolab/RPM/SRC/.

I edited the apache.spec in /kolab/RPM/SRC/apache, and enabled the
following:
%option       with_mod_ssl              yes
%option       with_mod_php              yes
%option       with_mod_dav              yes
%option       with_mod_auth_ldap        yes
%option       with_mod_gzip             yes
%option       with_mod_php_mysql        yes
%option       with_mod_php_zlib         yes
%option       with_mod_php_openldap     yes
%option       with_mod_php_gettext      yes
%option       with_mod_php_imap         yes
%option       with_mod_php_xml          yes
%option       with_mod_php_dom          yes
%option       with_mod_php_mhash        yes
%option       with_mod_php_mcrypt       yes
%option       with_mod_php_gdbm         yes

You can get the defaults that the binary was built with by querying it:
#openpkg rpm
-qip /PATH2BIN/apache-1.3.31-2.2.1_kolab.ix86-debian3.0-kolab.rpm
That will give you a starting point for enabling other modules (note
that the spec file in the src rpm does not have any of the defaults
enabled!)

Next, build the rpm:
#openpkg rpm -bb apache.spec

And install it:
#openpkg rpm -Uvh
--force /kolab/RPM/PKG/apache-1.3.31-2.2.1_kolab.ix86-debian3.0-kolab.rpm

At this point you should be good to go and continue with the webclient
install directions on the kolab website. Remember to configure the
datatree in Horde, as the calendar/notes/tasks will not work without
it. 

If I messed something up, please correct me! I was recreating the
process after many hours of compiling and recompiling unsuccessfully.

Thanks,
Zack




More information about the users mailing list