Author |
|
blaze
Joined: 14 Aug 2008 Posts: 2
|
Posted: Thu 14 Aug '08 11:22 Post subject: How to store VirtualHosts in MySQL |
|
|
Hello!
Please, help me to solve the problem, how to store VitrualHosts in MySQL?
Apache: 2.2.9
OS: Windows
I saw that Apache has module mod_dbd, but I couldn't find any helpful information about that. If you know how does it works, or any other ways, please tell me!
Thank you! |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
|
Back to top |
|
blaze
Joined: 14 Aug 2008 Posts: 2
|
Posted: Fri 15 Aug '08 11:17 Post subject: |
|
|
Thank you!
I found that topic very useful!
But I have a question.
How can I store other parameters of VirtualHost?
For example I have this VitrualHost:
Code: | <VirtualHost example.com:80>
ServerAdmin administrator@example.com
ServerName example.com
ServerAlias www.example.com
DocumentRoot C:/Apache/htdocs/example.com/www
<Directory C:/Apache/htdocs/example.com/www>
AllowOverride All
</Directory>
php_admin_value open_basedir C:/Apache/htdocs/example.com/www
</VirtualHost>
|
How can I store this data in MySQL? |
|
Back to top |
|
tdonovan Moderator
Joined: 17 Dec 2005 Posts: 611 Location: Milford, MA, USA
|
Posted: Sat 16 Aug '08 15:37 Post subject: |
|
|
If you use mod_vhost_dbd, you can only set the document root from the database.
ServerAlias is easily handled by creating two rows in the database: one for example.com and another row for www.example.com.
Both should return the same document root: C:/Apache/htdocs/example.com/www.
For directives which can accept httpd environment variables, like Header and Allow from env=, you can return extra columns in your SQL queries which are converted into environment variables.
Unfortunately, PHP directives like php_admin_value can only be set at Apache startup. They cannot be changed "on-the-fly" by a module like mod_vhost_dbd. That is why you cannot put php_admin_value in a .htaccess file either.
-tom- |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Sat 16 Aug '08 20:50 Post subject: |
|
|
For me mod_macro was a good start for some fast standart configuration. There is only the pitty a of restart. |
|
Back to top |
|
randriese
Joined: 09 Sep 2008 Posts: 1
|
Posted: Tue 09 Sep '08 10:34 Post subject: |
|
|
i'm having problems with the AllowOverride All.
i understand that the mod_vhost_dbd.so only adds the DocumentRoot, but is it also possible to add the AllowOverride directive? I really need it because otherwise this whole system doesn't work for me
I need to have dynamic vhosts, based on a MySQL result and each dynamic host should read the .htaccess file in it's folder.
anyone got any idea's? |
|
Back to top |
|