0

Here is my server modules list (modules.conf), its working without any problems, and lighttpd is running correctly while using this list:

server.modules = (
  "mod_access",
#  "mod_alias",
#  "mod_auth",
#  "mod_evasive",
#  "mod_redirect",
#  "mod_rewrite",
#  "mod_setenv",
#  "mod_usertrack",
)

The problem appears, when I want to uncomment the mod_rewrite module:

server.modules = (
  "mod_access",
#  "mod_alias",
#  "mod_auth",
#  "mod_evasive",
#  "mod_redirect",
   "mod_rewrite",
#  "mod_setenv",
#  "mod_usertrack",
)

Then I'm getting the following message, when I want to run my web server:

2012-05-01 15:01:18: (plugin.c.169) dlopen() failed for: /usr/local/lib/lighttpd/mod_indexfile, mod_access.so Cannot open "/usr/local/lib/lighttpd/mod_indexfile, mod_access.so"

2012-05-01 15:01:18: (server.c.656) loading plugins finally failed /usr/local/etc/rc.d/lighttpd: WARNING: failed to start lighttpd

As you can see, it does have some problems with the mod_access module, but its strange a little bit, especially when I comment back the mod_rewrite module then its working.

Where is the problem?

Cyclone
  • 250
  • 1
  • 6
  • 20
  • Please don't [cross-post](http://stackoverflow.com/questions/10398141/lighttpd-can-not-start-when-including-mod-rewrite). Can you provide your entire config? – Shane Madden May 01 '12 at 16:50
  • @ShaneMadden Here, http://pastebin.com/raw.php?i=ze3LsifH. – Cyclone May 01 '12 at 20:15

1 Answers1

1
$HTTP["host"] =~ "(^|\.)mywebsite\.com$" {
    server.modules += ( "mod_rewrite" )

That's the problem. Don't modify server.modules within a conditional block. See here.

Shane Madden
  • 112,982
  • 12
  • 174
  • 248
  • Then what I have to do? And how comes this one `server.modules += ( "mod_fastcgi" )` at the bottom is working correctly? – Cyclone May 01 '12 at 20:35
  • Move it outside of the `$HTTP["host"]` block. The `mod_fastcgi` append works because it's not in a conditional block. – Shane Madden May 01 '12 at 21:23
  • Oh, well.. I'd never though something like this may happend.. that really doesn't make any difference at all. But I'm happy its finally working. Thank you. – Cyclone May 01 '12 at 21:28
  • @Cyclone Yeah, that's an absolutely unhelpful error message that it gives in this case. Glad it's working now! – Shane Madden May 01 '12 at 21:30