lighttpd and server-side includes

Hi, I'm trying out lighttpd as a possible replacement for Apache. Thanks to all the tutorials that are out there in the web, I finally got it running – fastcgi with individual permissions and all. The only problem I'm having is that I just can't get server-side includes to work.

I'm using Ubuntu 8.04 with lighttpd 1.4.19 (latest stable release).

Both of the following lines are in my config file, which means that server-side includes are enabled:

server.modules = ( ..., "mod_ssi", ... )
ssi.extension = ( "shtml" )

More accurately, they're in a config file which is linked from the main config file, and which is also a symlink to another file. But I know that this config file is being used by lighty, because if I put garbage in it, lighty would throw an error. I also tried moving the directives to the main config file, with no effect whatsoever.

The file containing the ssi directive is named "index.shtml", and the directive itself is:

Now, when I point my browser to index.shtml, and view the source code, the line above (the ssi directive) appears as part of the source code, whereas it's supposed to have been replaced by the contents of cpright.html.

The file cpright.html exists in the same directory, and it is readable by the lighttpd user. But there is no sign in the access log / error log that lighty has ever looked up that file.

I've spent some time Googling, and it seems that lighty won't parse ssi includes if the included file also contains ssi includes. This is not the case with my site. cpright.html is just a plain html file with some copyright and contact information which I stick into every page of the site. The exact same files worked flawlessly in Apache.

Of course I've tried restarting / reloading lighttpd a number of times.

According to The following thread, this seems to be a recognized bug, but I'm surprised at the lack of any other information on this problem. Are lighty folks too sophisticated to care about primitive stuff like ssi at all?

http://trac.lighttpd.net/trac/ticket/1101

Any help would be appreciated.

3 Replies

I absolutely love Lighttpd, but I don't know anything about your issue. I do, however, have it working with php as a fastcgi :)

if you're looking for a (light-weight) apache replacement have a look at nginx. it can do fastcgi, ssi an all that and is tiny compared to apache (and easy to set up).

That should work. I'm using Lighttpd 1.4.19 on Debian and your code example works when I'm using the same configuration as above. Do you get the same result if you move your SSI configuration into your main configuration file?

If you installed it using apt you could also try to compile it yourself and override your old version and see if that helps.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct