Re: mod_vhost_dbd

2009-02-15 Thread Dave Ingram
Hi Jorge,

Something with the same name:

http://code.google.com/p/dbd-modules/wiki/mod_vhost_dbd

self-promotion
I don't know if that's what you're after, but I've written something
vaguely similar but more flexible:

http://www.dmi.me.uk/code/apache/mod_sqltemplate/
/self-promotion

Hope this helps!


Dave


Jorge Bastos wrote:
 Hi people,

 I just signed up, to report a typo.

  

 http://modules.apache.org/search.php?id=1753

  

 the link is broken.

 I'd love to test this, I'm looking for it for some time.

 Is the maintainer out there? J

  

 Jorge


   



RE: mod_vhost_dbd

2009-02-15 Thread Jorge Bastos
Hi dave,
Thanks,

I'm looking at your proj also.

What I am looking is, a completely independent module, so that I can create,
decreate any virtualhost, just inserting and removing records from the DB.
The values can be apache configurations, or any other.
Yours can? I didn't got time to look at it.




 -Original Message-
 From: Dave Ingram [mailto:d...@dmi.me.uk]
 Sent: domingo, 15 de Fevereiro de 2009 20:03
 To: modules-dev@httpd.apache.org
 Subject: Re: mod_vhost_dbd
 
 Hi Jorge,
 
 Something with the same name:
 
 http://code.google.com/p/dbd-modules/wiki/mod_vhost_dbd
 
 self-promotion
 I don't know if that's what you're after, but I've written something
 vaguely similar but more flexible:
 
 http://www.dmi.me.uk/code/apache/mod_sqltemplate/
 /self-promotion
 
 Hope this helps!
 
 
 Dave
 
 
 Jorge Bastos wrote:
  Hi people,
 
  I just signed up, to report a typo.
 
 
 
  http://modules.apache.org/search.php?id=1753
 
 
 
  the link is broken.
 
  I'd love to test this, I'm looking for it for some time.
 
  Is the maintainer out there? J
 
 
 
  Jorge
 
 
 




RE: mod_vhost_dbd

2009-02-15 Thread Jorge Bastos
 Thanks -- it's always nice to be appreciated. Let me know if you hit
 any
 problems, as I don't have the resources to test it in lots of different
 situations.

I'll :)

 This is possible using mod_sqltemplate. Suppose in your database, you
 have a php_register_globals column, which is either On or Off.
 Then this will work:
 
 SQLRepeat  blah sql to select virtualhosts... 
 VirtualHost *:80
 # ...
 php_flag register_globals ${php_register_globals}
 # ...
 /VirtualHost
 /SQLRepeat
 
  When I say this values for php, it may happen that other ones appear.
 
 You can use a similar method for any directives. You can even have
 fully
 custom directives:
 
 SQLRepeat...
 VirtualHost *:80
 #...
 ${custom}
 #...
 /VirtualHost
 /SQLRepeat

So I think my problem is resolved!
Resuming, I can have as many columns I want in the hosts table, correct? If
so, I can have the config I want!!! That's fantastic, I've been looking for
something like this for some years!

 You can tell Apache to perform a config reload (e.g. via apache2ctl
 graceful), which will force the configuration to be re-read from the
 database.

Hum but this only via commandline correct?



Another thing, apache read's this, when it loads and stays with this info on
memory correct?
The existing virtualhosts that I have, I can leave that intact, and start
using the new virtualhosts with this configuration, correct?



Re: mod_vhost_dbd

2009-02-15 Thread Dave Ingram
Jorge Bastos wrote:
 This is possible using mod_sqltemplate. Suppose in your database, you
 have a php_register_globals column, which is either On or Off.
 Then this will work:

 [snip]

 So I think my problem is resolved!
 Resuming, I can have as many columns I want in the hosts table, correct? If
 so, I can have the config I want!!! That's fantastic, I've been looking for
 something like this for some years!
   
Yup. I place no restrictions at all. It doesn't even have to be a single
table -- it can be the result of a multi-table join, as long as all of
the columns have different names. They can be renamed using AS, like
SELECT a.id, a.name, h.name AS hname FROM table1 a, table2 h for
example, which would then be accessed as ${id}, ${name}, ${hname}. Take
a quick glance at the sample configuration
http://www.dmi.me.uk/code/apache/mod_sqltemplate/99_mod_sqltemplate.conf
from the mod_sqltemplate site.

 You can tell Apache to perform a config reload (e.g. via apache2ctl
 graceful), which will force the configuration to be re-read from the
 database.
 

 Hum but this only via commandline correct?
   
It can be from anything that can send Apache a signal (USR1 causes a
graceful restart) as well. Running apache2ctl can be done from anything
that has the right permissions to signal Apache.

As an incidental note, I'm planning on writing a PHP patch that allows
you to force Apache to do a graceful restart, but I haven't had the time
to think about the best way to do this yet.

 Another thing, apache read's this, when it loads and stays with this info on
 memory correct?
   
That's correct.

 The existing virtualhosts that I have, I can leave that intact, and start
 using the new virtualhosts with this configuration, correct?
   
You can leave your existing configuration files and create a completely
new one that handles all of your new virtualhosts.


Dave


Re: mod_vhost_dbd

2009-02-15 Thread Dave Ingram
Jorge Bastos wrote:
 Dave,
 You could have a Install.txt file to explain how to compile.
 I'm not very familiar with apxs2 :)

 Can you post here?
   

Erm. I think all you need to use is:

apxs2 -i -c mod_sqltemplate.c

as root, to compile and install in one step. Don't forget to add the
LoadModule line!


Dave


RE: mod_vhost_dbd

2009-02-15 Thread Jorge Bastos
 
 Erm. I think all you need to use is:
 
 apxs2 -i -c mod_sqltemplate.c
 
 as root, to compile and install in one step. Don't forget to add the
 LoadModule line!

I won't!

Sorry about apxs.
I'm just curious, libmysql shouldn't be linked agains the .so module?



Re: mod_vhost_dbd

2009-02-15 Thread Dave Ingram
Jorge Bastos wrote:
 Sorry about apxs.
   
That's fine -- everyone has to learn somewhere.

 I'm just curious, libmysql shouldn't be linked agains the .so module
Nope - it uses the built-in APR DBD in Apache, which already links
against MySQL.


Dave


RE: mod_vhost_dbd

2009-02-15 Thread Jorge Bastos
  I'm just curious, libmysql shouldn't be linked agains the .so module
 Nope - it uses the built-in APR DBD in Apache, which already links
 against MySQL.
 

Oh right. Stupid question, and I saw it on the source the apr_dbd, I'm
sleepy :|
I do use mod_dbd for http auth, stupid question :P

Ok going to test this and let you know the success/something not right with
it.
Thank's a lot Dave.

Jorge



mod_vhost_dbd

2009-02-14 Thread Jorge Bastos
Hi people,

I just signed up, to report a typo.

 

http://modules.apache.org/search.php?id=1753

 

the link is broken.

I'd love to test this, I'm looking for it for some time.

Is the maintainer out there? J

 

Jorge