跳至内容
菜单
此问题已终结
2 回复
8141 查看

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?

形象
丢弃
最佳答案

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.

形象
丢弃
最佳答案

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.


形象
丢弃
相关帖文 回复 查看 活动
0
12月 20
1439
0
11月 24
824
0
6月 23
1618
1
9月 24
4239
1
8月 24
7090