Odoo Help
Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM
|
e-Commerce
|
Accounting
|
Inventory
|
PoS
|
Project management
|
MRP
|
etc.
How to setup apache2 and openerp to match subdomains with databases ?
Hello there !
First of all, I'm kind of new to virtual hosts and redirecting urls.
I am trying to setup apache to redirect a subdomain to a matching openerp database on my server. Example: http://foo.mydomain.com will call the database foo.
I'm testing with localhost, so I edited /etc/hosts with something like this:
127.0.0.1 foo.localhost 127.0.0.1 bar.localhost
Here is my virtual host declaration in /etc/apache2/sites-available/openerp.conf:
<VirtualHost *:80> ServerName localhost ServerAlias *.localhost // 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>
After that, I wrote dbfilter = ^%d$ in my openerp.conf file. After apache2 and openerp were restarted, I started testing it.
The thing is, the first time I try to reach a new database, I have to explicitely write http://database-name.localhost?db=name-of-the-new-db. After the first login/logout, I just have to type http://database-name.localhost, as expected. I'm not sure if I have to do it on all computers (no tested yet) but it's kinda weird I think.
Is it part of openrp mechanism to bound a subdomain to a database, or just a bug, or something I've done wrong ?
Thanks
(my edit was a clarification one)
No one ?
Check this for your answer https://www.odoo.com/forum/help-1/question/how-to-set-database-filter-on-sub-domain-for-odoo-website-using-apache-web-server-64935#answer-65100
This is exactly what I have in my config files... But I still have to write subdomain.localhost/?db=subdomain the first time for each new database. The second time and later, I just need subdomain.localhost, and it will write the ?db= part itself.
maybe you can use port redirect in apache vhost instead of using your method
becoz i use port redirect for my case
maybe you can try my conf
<VirtualHost *:80>
ServerName mydomain.com
Redirect 8069 / http://mydomain.com:8069/
</VirtualHost>
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.
RegisterOdoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.
Test it nowQuestion tools
Stats
Asked: 10/2/14, 4:44 AM |
Seen: 3496 times |
Last updated: 5/19/15, 12:43 PM |