Re: [webmin-devel] Integrate with Apache module?

"Jamie Cameron" <[email protected]> Tue, 02 Mar 2010 13:03:11 -0800 (PST)
Newsgroups gmane.comp.web.webmin.devel
Message-ID <[email protected]>
On 02/Mar/2010 11:35 Chris Wik <[email protected]> wrote ..
> I've written a module for managing multiple installations of Lasso
> Server 9 (www.lassosoft.com)
> 
> Lasso Server integrates with Apache via FastCGI
> 
> I would like my module to be able to insert an Include directive into a
> selected virtual host in order to allow that virtual host to hand off
> requests for .lasso files to an instance of Lasso Server
> 
> Is there an easy way to do this by utilising the existing functions in
> the Apache module? Or would I have to write my own code to parse the
> virtual host entry and insert the directive?

Yes, absolutely - you can use code like this :

foreign_require("apache");
$conf = apache::get_config();
@vhosts = apache::find_directive_struct("VirtualHost", $conf);
foreach $v (@vhosts) {
  $sn = apache::find_directive("ServerName", $v->{'members'});
  if ($sn eq "whatever.com") {
    @includes = apache::find_directive("Include", $v->{'members'});
    push(@includes, "/path/to/file.lasso");
    apache::save_directive("Include", \@includes, $v->{'members'}, $conf);
    flush_file_lines($v->{'file'});
    }
  }

 - Jamie

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
-
Forwarded by the Webmin development list at [email protected]
To remove yourself from this list, go to
http://lists.sourceforge.net/lists/listinfo/webadmin-devel