Linux, FreeBSD, Juniper, Cisco / Network security articles and troubleshooting guides
https://forum.ivorde.com/

Invalid command 'AddHandler', perhaps misspelled or defined by a module not included in the server..
https://forum.ivorde.com/invalid-command-addhandler-perhaps-misspelled-or-defined-by-a-module-not-included-in-the-server-t108.html
Page 1 of 1

Author:  debuser [ Thu Jul 22, 2010 2:30 pm ]
Post subject:  Invalid command 'AddHandler', perhaps misspelled or defined by a module not included in the server..

Quote:
Syntax error on line 428 of /opt/apache-2.2.15_9/etc/apache22/httpd.conf:
Invalid command 'AddHandler', perhaps misspelled or defined by a module not included in the server configuration


I started compiling apache from scratch (I removed almost all the modules). The error above was expected when installing php module.

Fix is to use apche APXS utility to install modules without recompiling apache:

Code:
# /opt/apache-2.2.15_9/sbin/apxs -c -i mod_mime.c


Caution: Use apxs from the version of Apache you want the module installed for (in case you have multiple apache instances).

Code:
# cd /usr/ports/www/apache22/work/httpd-2.2.15/modules/http
# /opt/apache-2.2.15_9/sbin/apxs -c -i mod_mime.c
/usr/local/share/apr/build-1/libtool --silent --mode=compile cc -prefer-pic -O2 -pipe -funroll-loops -march=pentium4 -I/usr/local/include -fno-strict-aliasing   -O2 -pipe -funroll-loops -march=pentium4 -I/usr/local/include -fno-strict-aliasing -g -I/opt/apache-2.2.15_9/include/apache22  -I/usr/local/include/apr-1   -I/usr/local/include/apr-1 -I/usr/local/include  -c -o mod_mime.lo mod_mime.c && touch mod_mime.slo
/usr/local/share/apr/build-1/libtool --silent --mode=link cc -o mod_mime.la  -rpath /opt/apache-2.2.15_9/libexec/apache22 -module -avoid-version    mod_mime.lo
/opt/apache-2.2.15_9/share/apache22/build/instdso.sh SH_LIBTOOL='/usr/local/share/apr/build-1/libtool' mod_mime.la /opt/apache-2.2.15_9/libexec/apache22
/usr/local/share/apr/build-1/libtool --mode=install cp mod_mime.la /opt/apache-2.2.15_9/libexec/apache22/
libtool: install: cp .libs/mod_mime.so /opt/apache-2.2.15_9/libexec/apache22/mod_mime.so
libtool: install: cp .libs/mod_mime.lai /opt/apache-2.2.15_9/libexec/apache22/mod_mime.la
libtool: install: cp .libs/mod_mime.a /opt/apache-2.2.15_9/libexec/apache22/mod_mime.a
libtool: install: chmod 644 /opt/apache-2.2.15_9/libexec/apache22/mod_mime.a
libtool: install: ranlib /opt/apache-2.2.15_9/libexec/apache22/mod_mime.a
----------------------------------------------------------------------
Libraries have been installed in:
   /opt/apache-2.2.15_9/libexec/apache22

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
chmod 755 /opt/apache-2.2.15_9/libexec/apache22/mod_mime.so


Now apache 2.2 starts without problems.

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/