Jérôme Renard wrote:
Good afternoon,
I have been developping an Apache module which uses the DBD framework.
I get the following issue :
If I call a URL which "belongs" to my test virtual host, like
http://myvhost.lo/test/foo-bar
everything works fine.
However if I try a completely different URL which points to location
externel to the
vhost, say http://localhost/path/to/a/folder/not/in/a/vhost I get the
following message in the
error_log :
[Sun May 17 16:55:46 2009] [error] DBD: not configured
[Sun May 17 16:55:46 2009] [error] [client ::1] Unable to acquire a
database connection
- mod_dbd and my module are loaded in httpd.conf
- the configuration for my VirtualHost is the following :
<VirtualHost *:81>
ServerName modurlalias.loc
DocumentRoot /path/to/my/virtualhost/
<IfModule mod_url_alias.c>
URLAliasEngine On
DBDriver mysql
DBDParams "host=myhost port=3306 user=foo pass=bar
dbname=modurlalias"
</IfModule>
</VirtualHost>
- there is not other DBD* calls in httpd.conf or in any other
configuration file.
What can be the source of such log messages ?
Maybe I did something wrong in the module's code but I did not find
where yet.
The code is accessibile here :
-
http://code.google.com/p/modurlalias/source/browse/trunk/src/mod_url_alias.c
Thanks in advance for any help.
Best Regards.
:)
Hi Jerome,
When your DBDriver and DBDParams directives are inside a <VirtualHost> block, they apply only to
that virtual host. You might try moving these directives to be outside all your <VirtualHost>
blocks. The database should then be available to all your virtual hosts.
-tom-
p.s. You might want to take a look at mod_vhost_dbd at http://dbd-modules.googlecode.com which is a
similar module to yours.