- implemented 'Create vHost-Container' and 'Own vHost-Settings' for lighttpd

- implemented Froxlor-directory protection (apache and lighttpd), fixes #72
- enable `vhostcontainer` and `vhostcontainer_servername_statement` by default
This commit is contained in:
Michael Kaufmann (d00p)
2010-03-19 17:29:31 +00:00
parent 1db572e010
commit 660bede9c5
4 changed files with 56 additions and 11 deletions

View File

@@ -121,11 +121,33 @@ class apache
{
$this->virtualhosts_data[$vhosts_filename].= '<VirtualHost ' . $ipport . '>' . "\n";
/**
* add 'real'-vhost content here, like doc-root :)
*/
$mypath = makeCorrectDir(dirname(dirname(dirname(__FILE__))));
$this->virtualhosts_data[$vhosts_filename].= 'DocumentRoot "'.$mypath.'"'."\n";
if($row_ipsandports['vhostcontainer_servername_statement'] == '1')
{
$this->virtualhosts_data[$vhosts_filename].= ' ServerName ' . $this->settings['system']['hostname'] . "\n";
}
/**
* dirprotection, see #72
*/
$this->virtualhosts_data[$vhosts_filename].= "\t<Directory \"'.$mypath.'(images|packages|templates)\">\n";
$this->virtualhosts_data[$vhosts_filename].= "\t\tAllow from all\n";
$this->virtualhosts_data[$vhosts_filename].= "\t\tOptions -Indexes\n";
$this->virtualhosts_data[$vhosts_filename].= "\t</Directory>\n";
$this->virtualhosts_data[$vhosts_filename].= "\t<Directory \"'.$mypath.'*\">\n";
$this->virtualhosts_data[$vhosts_filename].= "\t\tOrder Deny,Allow\n";
$this->virtualhosts_data[$vhosts_filename].= "\t\tDeny from All\n";
$this->virtualhosts_data[$vhosts_filename].= "\t</Directory>\n";
/**
* end of dirprotection
*/
if($row_ipsandports['specialsettings'] != '')
{
$this->virtualhosts_data[$vhosts_filename].= $row_ipsandports['specialsettings'] . "\n";