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

Chris Wik <[email protected]> Tue, 02 Mar 2010 23:06:02 +0100
Newsgroups gmane.comp.web.webmin.devel
Message-ID <[email protected]>
Thanks for the quick response. Already got a select-list displayed with
a list of the defined virtual hosts. It's easy when you know how!

Chris


On 02.03.10 22:03, Jamie Cameron wrote:
> 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

-- 
Chris Wik
Anu Internet Services Ltd

------------------------------------------------------------------------------
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