Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
8061 Vistas

WIth dbfilter = ^%d$ and reverse proxy: http://<databasename>.domain.com works great.

 <VirtualHost *:80> 
ServerName domain.com ServerAlias *.domain.com // Use this if you want dbfillter on subdomain ErrorLog /var/log/openerp/openerp-error.log CustomLog /var/log/openerp/openerp-access.log combined <Proxy *> Order deny,allow Allow from all </Proxy> ProxyRequests Off ProxyPass / http://localhost:8069/
ProxyPassReverse / http://localhost:8069/
ProxyVia On LogLevel warn </VirtualHost>

What I also want is this:

www.website1.com => database: website1

www.website2.com => database: website2


But how to deal with dbfilter and reverse proxy?

Avatar
Descartar
Mejor respuesta

As "dbfilter = ^%d$" is automatically cutting off "www." it works the same way if you define a virtual host for each domain name, such as one virtual host with ServerName www.website1.com and another one with ServerName www.website2.com, means www.website1.com becomes database website1 and www.website2.com becomes database website2.

Avatar
Descartar
Mejor respuesta

This is my Apache configuration (sub1 is the name of the database). What you are looking for is the X-ODOO_DBFILTER variable. dbfilter will pick this up. Adapted for your example:

<VirtualHost *:80>
ServerName www.website1.com
ErrorLog /var/log/httpd/www.website1.com-error.log
CustomLog /var/log/httpd/www.website1.com-access.log combined
ProxyRequests Off
Header add X-ODOO_DBFILTER "website1"
RequestHeader add X-ODOO_DBFILTER "website1"
LogLevel warn
<Location /web/database>
Order Deny,Allow
Deny from all
Allow from my.home.ip.address
</Location>
ProxyPass /server-info !
ProxyPass /server-status !
ProxyPass / http://localhost:8069/
ProxyPassReverse / http://localhost:8069/
ProxyVia On
ProxyTimeout 300
</VirtualHost>

And you can repeat this section for every new domain.


Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
0
dic 20
1395
0
nov 24
619
0
jun 23
1509
1
sept 24
4057
1
ago 24
6930