Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
8146 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit
Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
0
pro 20
1455
0
lis 24
848
0
čvn 23
1629
1
zář 24
4261
1
srp 24
7114