Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
8145 Visualizzazioni

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
Abbandona
Risposta migliore

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
Abbandona
Risposta migliore

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
0
dic 20
1447
0
nov 24
837
0
giu 23
1622
1
set 24
4242
1
ago 24
7093