Antonio Gallo | 19 Feb 2010 12:16
Face

[webmin-devel] using port 10.000 for ssl and 10.001 for http

Is there a way to have webmin running in both SSL and normal mode?
Even using the "stunnel" method described into the docs the normal mode 
will no longer work.

Antonio

------------------------------------------------------------------------------
Download Intel® 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 webmin-devel <at> webmin.com
To remove yourself from this list, go to
http://lists.sourceforge.net/lists/listinfo/webadmin-devel

Jamie Cameron | 19 Feb 2010 17:28

Re: [webmin-devel] using port 10.000 for ssl and 10.001 for http

On 19/Feb/2010 03:16 Antonio Gallo <gallo <at> mctelefonia.com> wrote ..
> Is there a way to have webmin running in both SSL and normal mode?
> Even using the "stunnel" method described into the docs the normal mode 
> will no longer work.

There's no built-in way to do this in Webmin yet, but you could run in
non-SSL mode on port 10000 and then setup stunnel to accept encrypted
connections on port 10001 and forward those to port 10000.

 - 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 webmin-devel <at> webmin.com
To remove yourself from this list, go to
http://lists.sourceforge.net/lists/listinfo/webadmin-devel

Chris Wik | 2 Mar 2010 20:35

[webmin-devel] Integrate with Apache module?

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?

Chris

--

-- 
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 webmin-devel <at> webmin.com
To remove yourself from this list, go to
http://lists.sourceforge.net/lists/listinfo/webadmin-devel

(Continue reading)

Jamie Cameron | 2 Mar 2010 22:03

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

On 02/Mar/2010 11:35 Chris Wik <chris <at> anu.net> 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();
 <at> vhosts = apache::find_directive_struct("VirtualHost", $conf);
foreach $v ( <at> vhosts) {
  $sn = apache::find_directive("ServerName", $v->{'members'});
  if ($sn eq "whatever.com") {
     <at> includes = apache::find_directive("Include", $v->{'members'});
    push( <at> includes, "/path/to/file.lasso");
    apache::save_directive("Include", \ <at> includes, $v->{'members'}, $conf);
    flush_file_lines($v->{'file'});
    }
  }

 - Jamie
(Continue reading)

Chris Wik | 2 Mar 2010 23:06

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

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 <chris <at> anu.net> 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();
>  <at> vhosts = apache::find_directive_struct("VirtualHost", $conf);
> foreach $v ( <at> vhosts) {
>   $sn = apache::find_directive("ServerName", $v->{'members'});
>   if ($sn eq "whatever.com") {
>      <at> includes = apache::find_directive("Include", $v->{'members'});
>     push( <at> includes, "/path/to/file.lasso");
(Continue reading)

Chris Wik | 3 Mar 2010 01:04

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

On 02.03.10 22:03, Jamie Cameron wrote:
> Yes, absolutely - you can use code like this :
> 
> foreign_require("apache");
> $conf = apache::get_config();
>  <at> vhosts = apache::find_directive_struct("VirtualHost", $conf);
> foreach $v ( <at> vhosts) {
>   $sn = apache::find_directive("ServerName", $v->{'members'});
>   if ($sn eq "whatever.com") {
>      <at> includes = apache::find_directive("Include", $v->{'members'});
>     push( <at> includes, "/path/to/file.lasso");
>     apache::save_directive("Include", \ <at> includes, $v->{'members'}, $conf);
>     flush_file_lines($v->{'file'});
>     }
>   }

I'm stuck, hopefully something stupid you can easily spot..

I'm getting 'Failed to save Site : flush_file_lines called on non-loaded
file /etc/httpd/conf.d/ssl.conf' when running:

sub update_apache_vhosts {
	my ($site) =  <at> _;
	my $conf_path	= $site->{'directory'} . '/lasso/fastcgi.conf';
	
	# servernames from ui_select (multiple) on edit form
	my  <at> servernames	= split(/\0/, $site->{'servername'});
	
	foreach $servername( <at> servernames) {
		foreign_require("apache");
(Continue reading)

Jamie Cameron | 3 Mar 2010 01:09

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

On 02/Mar/2010 16:04 Chris Wik <chris <at> anu.net> wrote ..
> On 02.03.10 22:03, Jamie Cameron wrote:
> > Yes, absolutely - you can use code like this :
> > 
> > foreign_require("apache");
> > $conf = apache::get_config();
> >  <at> vhosts = apache::find_directive_struct("VirtualHost", $conf);
> > foreach $v ( <at> vhosts) {
> >   $sn = apache::find_directive("ServerName", $v->{'members'});
> >   if ($sn eq "whatever.com") {
> >      <at> includes = apache::find_directive("Include", $v->{'members'});
> >     push( <at> includes, "/path/to/file.lasso");
> >     apache::save_directive("Include", \ <at> includes, $v->{'members'}, $conf);
> >     flush_file_lines($v->{'file'});
> >     }
> >   }
> 
> I'm stuck, hopefully something stupid you can easily spot..
> 
> I'm getting 'Failed to save Site : flush_file_lines called on non-loaded
> file /etc/httpd/conf.d/ssl.conf' when running:
> 
> 
> sub update_apache_vhosts {
> 	my ($site) =  <at> _;
> 	my $conf_path	= $site->{'directory'} . '/lasso/fastcgi.conf';
> 	
> 	# servernames from ui_select (multiple) on edit form
> 	my  <at> servernames	= split(/\0/, $site->{'servername'});
> 	
(Continue reading)

Chris Wik | 3 Mar 2010 01:16

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

On 03.03.10 01:09, Jamie Cameron wrote:
> You don't want to call flush_file_lines unless you have actually added to or removed
> something from the  <at> includes list.

Ah, OK, that makes sense. Thanks.

--

-- 
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 webmin-devel <at> webmin.com
To remove yourself from this list, go to
http://lists.sourceforge.net/lists/listinfo/webadmin-devel

Chris Wik | 3 Mar 2010 09:19

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

I ended up setting a flag if something is changed. Here's the final
version that seems to be working great so far:

sub update_apache_vhosts {
	my ($site) =  <at> _;
	my $conf_path	= $site->{'directory'} . '/lasso/fastcgi.conf';
	
	my  <at> servernames	= split(/\0/, $site->{'servername'});
	
	foreign_require("apache");
	$conf = apache::get_config();
	 <at> vhosts = apache::find_directive_struct("VirtualHost", $conf);
	foreach $v ( <at> vhosts) {
		$sn = apache::find_directive("ServerName", $v->{'members'});
		 <at> includes = apache::find_directive("Include", $v->{'members'});
		my($changed,$match1,$match2) = 0;
		foreach $inc( <at> includes) {
			if($inc eq $conf_path) { $match1 = 1; }
		}
		foreach $servername( <at> servernames) {
			if($servername eq $sn) { $match2 = 1; }
		}
		# If Include is not present, but servernames match
		if($match1 == 0 && $match2 == 1) {
			push( <at> includes, $conf_path);
			$changed = 1;
		
		# If include is present, but no match on servername
		} elsif($match1 == 1 && $match2 == 0) {
			delete $includes[$inc];
(Continue reading)

Jamie Cameron | 3 Mar 2010 19:13

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

Cool, looks good to me!

On 03/Mar/2010 00:19 Chris Wik <chris <at> anu.net> wrote ..
> I ended up setting a flag if something is changed. Here's the final
> version that seems to be working great so far:
> 
> 
> sub update_apache_vhosts {
> 	my ($site) =  <at> _;
> 	my $conf_path	= $site->{'directory'} . '/lasso/fastcgi.conf';
> 	
> 	my  <at> servernames	= split(/\0/, $site->{'servername'});
> 	
> 	foreign_require("apache");
> 	$conf = apache::get_config();
> 	 <at> vhosts = apache::find_directive_struct("VirtualHost", $conf);
> 	foreach $v ( <at> vhosts) {
> 		$sn = apache::find_directive("ServerName", $v->{'members'});
> 		 <at> includes = apache::find_directive("Include", $v->{'members'});
> 		my($changed,$match1,$match2) = 0;
> 		foreach $inc( <at> includes) {
> 			if($inc eq $conf_path) { $match1 = 1; }
> 		}
> 		foreach $servername( <at> servernames) {
> 			if($servername eq $sn) { $match2 = 1; }
> 		}
> 		# If Include is not present, but servernames match
> 		if($match1 == 0 && $match2 == 1) {
> 			push( <at> includes, $conf_path);
> 			$changed = 1;
(Continue reading)


Gmane