Forum Moderators: phranque
On my Debian Etch server, I use a rewritemap:
###########################################################################
# Multiple rewrite maps are allowed.
RewriteMap lowercase int:tolower
RewriteMap SUB dbm:/home/jdm/WWW/poweron/server/poweron.rewritemap.dbm
###########################################################################
The rewritemap maps a subdomain to a number.
This works and performs the correct mapping.
The dbm files are generated by a script that runs when a new subdomain is added.
The script creates the dbm files. Bascially, the script calls the /usr/sbin/httxt2dbm script that came with this version of Apache. Of course, it supplies the key/values needed.
The problem is that the mtime of the dbm files change, but the dbm file does not reload.
I thought that this was auto 'magic', from:
[httpd.apache.org...]
"Note
For plain text and DBM format files the looked-up keys are cached in-core until the mtime of the mapfile changes or the server does a restart. This way you can have map-functions in rules which are used for every request. This is no problem, because the external lookup only happens once!"
I wait ten minutes to see if the new map is working. No luck. The server (web and physical server) are very lightly loaded.
If I restart Apache, then the new mapping is seen.
Anyone have any ideas of what to check?
Thanks
The only work-around I can think of would be to change the Map type to "prg" and use a small script to read the text file and return the correct URL.
When you use this method, the script starts at Apache restart and stays resident and running, so there's not too much of a performance hit, assuming the script is tightly-coded.
Jim
I did notice, for the first time (!), that the docs say that the rewritemap text files are also reloaded. I switched my vhost file and my script to text...and changes to mtime are seen in the text file. I do not wait at all.
This is really strange to me. On the development server there are only a few subdomains for testing. We add/delete them regularly. The switch to a text file solved my immediate need.
Yet it does not solve the real problem. If I find an answer, I will post it here.
The strange thing is I do not see this problem on any other of my servers. I run Ubuntu 8.04 (64 bit) exclusively in-house, and Debian 4 on all external servers (development and production).