DRAFT
{| border=“1” cellpadding=“2”
! id !! parent !! directive !! value
1 | NULL | VirtualHost | |||
2 | 1 | IfModule | |||
{| border=“1” cellpadding=“2”
!id !! directive_id !! key !! position !! value
1 | 1 | ServerName | 1 | |||||
2 | 1 | DocumentRoot | 2 | |||||
3 | 2 | RewriteEngine | 1 | |||||
4 | 2 | RewriteRule | 2 | |||||
vhost generation:
$vhosts = SELECT * FROM vhost_directives WHERE directive="VirtualHost"; foreach $vhosts as $vhost { <code> start_vhost(); $settings = SELECT * FROM vhost_settings WHERE directive_id=$vhost[['id']]; add_settings($settings); $directives = SELECT * FROM vhost_directives WHERE parent=$vhost[['id']]; foreach $directives as $directive { start_directive(); $sub_settings = SELECT * FROM vhost_settings WHERE directive_id=$directive[['id']] ORDER by position; add_settings($sub_settings); end_directive(); } end_vhost();
} </code>
<VirtualHost *:80> <code> ServerName schiffbauer.net DocumentRoot /home/htdocs/schiffbauer.net/ <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^/logs[[/]]*$ /cgi-bin/awstats.pl [[R]] </IfModule>
</VirtualHost> </code>
–mschiff 11:47, 10 Jun 2005 (CEST)