MultiViews with Apache 2.2

megahost

Verified User
Joined
Jun 21, 2006
Messages
21
I'm having some troubles getting MultiViews to work. I've tested and it doesn't seem to be installed. I've tried Options MultiViews and Options +MultiViews in .htaccess (and yes, I'm sure the .htaccess file was being read). I also tried to enable MultiViews for my vhost configuration in apache. To my understanding, MultiViews uses the mod_negotiation.so module. I've tried to load this in apache via LoadModule mod_negotation <file_location_here> but I have been unsuccessful. I've tried both with an apache 1.3 module and 2.2 module (I figured the 1.3 module wouldn't work, but I tried because the 2.2 one didn't work and I was out of ideas). Anyone have any ideas as to why apache won't load the mod_negotation.so module? I get this error when I try with the 2.2 module I have here /usr/lib/apache2/modules/mod_negotiation.so

httpd: Syntax error on line 20 of /etc/httpd/conf/httpd.conf: Can't locate API module structure `mod_negotiation' in file /usr/lib/apache2/modules/mod_negotiation.so: /usr/lib/apache2/modules/mod_negotiation.so: undefined symbol: mod_negotiation

Thanks in advance

Some info:

Debian Etch

# httpd -V
Server version: Apache/2.2.6 (Unix)
Server built: Nov 12 2007 19:51:52
Server's Module Magic Number: 20051115:5
Server loaded: APR 1.2.11, APR-Util 1.2.10
Compiled using: APR 1.2.11, APR-Util 1.2.10
Architecture: 32-bit
Server MPM: Prefork
threaded: no
forked: yes (variable process count)
Server compiled with....
-D APACHE_MPM_DIR="server/mpm/prefork"
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=128
-D HTTPD_ROOT="/etc/httpd"
-D SUEXEC_BIN="/usr/sbin/suexec"
-D DEFAULT_PIDLOG="/var/logs/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_LOCKFILE="/var/logs/accept.lock"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"
 
Last edited:
No, there are only these:

# find / -iname mod_negotiation.so
/usr/lib/apache/1.3/mod_negotiation.so
/usr/lib/apache2/modules/mod_negotiation.so

I installed apache2-common to get the apache2 mod_negotation, but that doesn't seem to work. I'm wondering if directadmin has a custom build of apache that isn't allowing me to load the common mod_negotiation? Hm, thanks.
 
Do a :

ls -la /etc/httpd/

you will see that :

modules -> /usr/local/libexec/apache2

so you have to copy the .so to the directory /usr/local/libexec/apache2 (if that directory is your ls result) In this directory you will see all of the other .so files that apache uses.

Then loadmodule it as the other modules
 
I installed apache2-common to get the apache2 mod_negotation, but that doesn't seem to work. I'm wondering if directadmin has a custom build of apache that isn't allowing me to load the common mod_negotiation? Hm, thanks.

No, DA cant forbid something. It may just use other directories from your system defaults...
 
tsiuo, thanks, but I don't have a modules directory. Let me be more verbose, as I should have done from the start...

# ls -la /etc/httpd
total 20
drwxr-xr-x 5 root root 4096 2007-11-12 15:24 .
drwxr-xr-x 71 root root 4096 2008-07-23 00:11 ..
drwxr-xr-x 6 root root 4096 2008-07-23 01:29 conf
drwxr-xr-x 3 root root 4096 2007-11-12 19:51 lib
drwxr-xr-x 4 root root 4096 2007-11-12 15:24 man

I only have those 3 folders in /etc/httpd.

When I've tried to load the mod_negotation.so, I've done it by specifying the location:


LoadModule mod_negotiation /usr/lib/apache2/modules/mod_negotiation.so

That's when I get the error.

It's not a location issue. If it was, the error would reflect that... which is why I'm so confused as to why this isn't working. Any ideas?
 
You must have :
LoadModule negotiation_module /pathtotyourmodule/mod_negotiation.so

and not LoadModule mod_negotiation.
 
Last edited:
Thanks, but I tried that and received this:

httpd: Syntax error on line 20 of /etc/httpd/conf/httpd.conf: module negotiation_module is built-in and can't be loaded.

Any other ideas? :) Thanks!
 
That means that you have already built in negotiation in apache and you don't have to install it as a DSO.

You should be able to use the features without mentioning it in httpd.conf, so try to remove any loadmodule negotiation_module from httpd.conf (even remove it as a package) and things should work..
 
If it was that simple, I wouldn't be here asking questions :) Removing mod_negotation.so "as a package" removes apache2-utils. I don't think that's necessary (besides, I installed that after I was already having this problem). I've tried without trying to manually load mod_negotation and that didn't work... which is why I tried LoadModule.

Ok, so let me explain how I'm testing it. I have a directory called "a" in the webroot. Inside that I put .htaccess with this: Options +MultiViews (I have also tried Options MultiViews and I've tried switching the case around, none seem to help). I make a directory under that called "b" and put a file called testthis.html in there. I then try to access /a/b/testthis in my browser and I get a 404. If I try /a/b/testthis.html ... it works, I can see my file (as it naturally would).

Any other ideas?
 
The only thing i can tell you then is to recompile apache without mod_negotiation build in and use the loadmodule...
 
Thanks. By default, does directadmin come with it's own compiled version of apache?
 
As far as i know you can use a custombuild that uses DA's setup for all the services but i dont know how its done. I use my system's version of apache...
 
I'd prefer to use debian's version of apache. It's apache 2.2 as well, which is what we have installed. However, I can't just move from one to the other, right? Can I? Do I need to tell directadmin where the new version of apache will be located? Does directadmin come with a precompiled version of apache?

Thanks
 
DA is using only it's startup script which starts apache with conf under /etc/httpd/conf etc.
If you replace it you can use your own setup.

That's what i did with my own setup (some details could be missing and my system is freebsd so you have to fit it to your own system with changes):

removed da's apache package if it shows in your package system or delete DA's apache binaries
install my system's apache

Let's say that your system installs httpd.conf and other conf files in /usr/local/etc/apache
you move /usr/local/etc/apache /usr/local/etc/apache.old
ln -s /etc/httpd/conf /usr/local/etc/apache
now your system uses debians binaries with DA's confs

Let's say that your startup scripts are in /usr/local/etc/rc.d and debian's startup script is named apache2.sh
cd /usr/local/etc/rc.d
rm httpd (DA's startup script)
ln -s apache2.sh httpd
now DA is running debian's script to do restarts etc

cd /etc/httpd
my ls -la is :
drwxr-xr-x 10 root wheel 1024 Jul 30 15:10 conf
lrwxr-xr-x 1 root wheel 22 Jul 31 00:44 lib -> /usr/local/lib/apache2
drwxr-xr-x 2 root wheel 512 Jul 5 2007 lib.old
lrwxr-xr-x 1 root wheel 18 Jul 5 2007 libexec -> /usr/local/libexec
lrwxr-xr-x 1 root wheel 19 Sep 18 2006 logs -> ../../var/log/httpd
drwxr-xr-x 4 root wheel 512 Sep 18 2006 man
lrwxr-xr-x 1 root wheel 26 Jul 5 2007 modules -> /usr/local/libexec/apache2

what i did is find where my system's apache directories are and make a link for them.
Do for your system's too.
That should be it...
 
Last edited:
Thank you! That's very helpful. If I install debian's version of apache2, can I use fresh configs? Or do I need to use configs from the old httpd that directadmin used/was configured for? I see an include to include httpd.conf in all the user's home directories, for instance. I'm sure there might be some others.

Everything else makes sense. Thanks again!
 
It's better to modify DA's httpd.conf and apply any of your system directives...
All of the includes are needed..
Just be sure that you have a 2.2 DA's httpd.conf...
 
Back
Top