Ticket #932 (new enhancement)

Opened 2 years ago

Per Site Configuration for Lighttpd

Reported by: js@2s-it.de Assigned to: jan
Priority: normal Milestone:
Component: mod_simple_vhost Version:
Severity: normal Keywords:
Cc: Blocking:
Need Feedback:

Description

With just a little bit of work it is possible to get per-site config files for use with virtual hosting. To do so I wrote a simple script and added it in lighttpd.conf:

lighttpd.conf:

include_shell "/etc/lighttpd/read-sites.sh"

read-sites.sh:

#!/bin/bash for i in ls /etc/lighttpd/sites/; do echo "\$HTTP[\"host\"] =~ \"$i\" {"; cat /etc/lighttpd/sites/$i; echo; echo }; done

# ls /etc/lighttpd/sites/

domain1.com domain2.com domain3.com

#cat /etc/lighttpd/sites/domain1.com

url.rewrite-once = ( "/([0-9]+)(.*)$" => "/index.php?page=list_products&cat_id=$1&$2", "/page_([a-z0-9_]*)" => "/index.php?page=$1" )

Something like this could find its way to documentation, I think. However, more useful would be if there was a possibility to define such configs on a per site basis without the need of restarting the webserver. Hope you guys will understand my ugly English, thx.

Jo

Attachments


Add/Change #932 (Per Site Configuration for Lighttpd)




Change Properties