Apache/mod vhost dbi

From Segfault
Jump to: navigation, search

mod_dbi_pool

svn co http://svn.in.force-elite.com:8080/svn/mod_dbi_pool/trunk mod_dbi_pool-svn
cd mod_dbi_pool-svn
./configure --prefix=/usr/local/ --with-apxs=/usr/bin/apxs2
make
sudo make install

Load module:

$ cat /etc/apache2/mods-enabled/dbi_pool.load
LoadModule dbi_pool_module /usr/lib/apache2/modules/mod_dbi_pool.so
  • /etc/apache2/mods-enabled/dbi_pool.conf
PoolDbiDriver         Server1  mysql
PoolDbiHost           Server1  127.0.0.1
PoolDbiUsername       Server1  dbipooluser
PoolDbiPassword       Server1  PASSWORD
PoolDbiDBName         Server1  vhost_info

mod_vhost_dbi

svn co http://svn.in.force-elite.com:8080/svn/mod_vhost_dbi/trunk mod_vhost_dbi-svn
cd mod_vhost_dbi-svn
./configure --prefix=/usr/local/ --with-apxs=/usr/bin/apxs2
make
sudo make install

Load module:

$ cat /etc/apache2/mods-enabled/vhost_dbi.load
LoadModule vhost_dbi_module /usr/lib/apache2/modules/mod_vhost_dbi.so
  • /etc/apache2/sites-enabled/vhost-dbi
<VirtualHost *:80>
  VhostDbiEnabled       On
  VhostDbiConnName      Server1
  VhostDbiQuery         "SELECT ServerName, DocumentRoot, Username FROM \
                         Server1 WHERE ServerName = &{RequestHostname}"
</VirtualHost>