Bug#231134: Wish: Dummy LoadModule directive in apache2.conf to ease module installations through apxs (e.g. PHP5)
Package: apache2-common
Version: 2.0.48-7
Severity: wishlist
Other software used:
PHP version 5.0.0b3 available from http://www.php.net/downloads.php
When installing PHP5 into Apache 2 as a SAPI module, the 'make install'
target of PHP5 calls instdso.sh, which in turn uses apxs to install the
PHP5 SAPI module.
However, because the default apache2.conf shipped with the apache2-common
package does not contain any LoadModule directives, the installation
fails:
gloomy:~/software/php-5.0.0b3# make install
Installing PHP SAPI module: apache2handler
/usr/share/apache2/build/instdso.sh SH_LIBTOOL='/usr/bin/libtool'
libphp5.la /usr/lib/apache2/modules
/usr/bin/libtool --mode=install cp libphp5.la /usr/lib/apache2/modules/
cp .libs/libphp5.so /usr/lib/apache2/modules/libphp5.so
cp .libs/libphp5.lai /usr/lib/apache2/modules/libphp5.la
libtool: install: warning: remember to run `libtool --finish
/root/software/php-5.0.0b3/libs'
chmod 755 /usr/lib/apache2/modules/libphp5.so
apxs:Error: Activation failed for custom /etc/apache2/apache2.conf
file..
apxs:Error: At least one `LoadModule' directive already has to exist..
make: *** [install-sapi] Error 1
A simple fix is to add a commented(!) dummy LoadModule directive to
apache2.conf, which then acts as a placeholder for the new LoadModule
directive needed for PHP5:
[excerpt from apache2.conf]
# Include module configuration:
Include /etc/apache2/mods-enabled/*.load
Include /etc/apache2/mods-enabled/*.conf
# Dummy LoadModule directive to aid module installations
#LoadModule dummy_module /usr/lib/apache2/modules/mod_dummy.so
# Include all the user configurations:
Include /etc/apache2/httpd.conf
[end excerpt from apache2.conf]
Doing so, the PHP5 'make install' works just fine:
gloomy:~/software/php-5.0.0b3# make install
Installing PHP SAPI module: apache2handler
/usr/share/apache2/build/instdso.sh SH_LIBTOOL='/usr/bin/libtool'
libphp5.la /usr/lib/apache2/modules
/usr/bin/libtool --mode=install cp libphp5.la /usr/lib/apache2/modules/
cp .libs/libphp5.so /usr/lib/apache2/modules/libphp5.so
cp .libs/libphp5.lai /usr/lib/apache2/modules/libphp5.la
libtool: install: warning: remember to run `libtool --finish
/root/software/php-5.0.0b3/libs'
chmod 755 /usr/lib/apache2/modules/libphp5.so
[activating module `php5' in /etc/apache2/apache2.conf]
(... snip ...)
gloomy:~/software/php-5.0.0b3#
Afterwards, apache2.conf looks like this:
[excerpt from apache2.conf]
# Dummy LoadModule directive to aid module installations
#LoadModule dummy_module /usr/lib/apache2/modules/mod_dummy.so
LoadModule php5_module /usr/lib/apache2/modules/libphp5.so
[end excerpt from apache2.conf]
That is, the new LoadModule directive gets added after the dummy
directive.
Perhaps such a dummy LoadModule directive could be added to apache2.conf
by default, to make installation of PHP (and other modules) easier?
Best regards,
Björn
--
Björn Wiberg (bjorn.wiberg@home.se)
Homepage: http://bwiberg.dyndns.org/
Reply to: