Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • 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
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

How do I use openERP with multiple domains on single server?

Subscribe

Get notified when there's activity on this post

This question has been flagged
v7
9 Replies
40026 Views
Avatar
Boyd Lynn Gerber

I have over 40 domains and I would like to have a specific database associated with each domain. Do I have to have multiple installs? I know how to use a specific database. But I cannot seem to control. I have tried having apache2 listen to specific 8069 ports for the domains. But I always seem to have issues.

I use apache2 named services. I have in /etc/apache2/vhosts a file

name-vitrual-host.XXX.XXX.XXX.XX9.80.conf
name-vitrual-host-XXX.XXX.XXX.XX2.80.conf
name-vitrual-host-XXX.XXX.XXX.XX9.443.conf
name-vitrual-host-XXX.XXX.XXX.XX2.443.conf

with

name-vitrual-host-XXX.XXX.XXX.XX9.8069.conf
name-vitrual-host-XXX.XXX.XXX.XX2.8069.conf

or name-vitrual-host-XXX.XXX.XXX.XX9.8069.conf.org name-vitrual-host-XXX.XXX.XXX.XX2.8069.conf.org

I have apache2 setup to only read and use a .conf So I am doing it with and without I have also tried using in my /srv/apache2/listen.conf a global *:8069

The above file has a different location for each openerp config in a domain. I have linked the source code from /usr/share/openerp to each domain.

cd /srv/www/vhosts/domain_name/
ln -s /usr/share/openerp openerp
cd /srv/www/vhosts/domain_name/
ln -s /usr/share/openerp openerp
...
cd /srv/www/vhosts/domain_name#/
ln -s /usr/share/openerp openerp

I have in each index.html or apporiate html file

Note each below have a http: in front //www.sample.com:8069/?db=openerp //www.sample1.com:8069/?db=openerp1 //www.sample2.com:8069/?db=openerp2 //www.sample3.com:8069/?db=openerp3

It is getting the openerp working. Seems openERP wants to bind to the IP:Port and not the domainname:Port

Been trying to get customized config files working. What I do for other programs is for example put the source in /usr/share/openerp with links in all the virtual hosts as shown above.

Each .conf file has the following in them [options] addons_path = /usr/share/openerp/addons or /srv/www/vhosts/domain_name/addons

then a specific db db_name=openerp db_name=openerp1 db_name=openerp2 db_name=openerp3

all have the same db_user = openerp

My problem is I get post already in use. I do the following:

/location_domain/openerp/openerp-server -c /location_domain/openerp.cfg &

Then on the next add using the -c with a different cfg and location I get the already in use. I have different names in the config file but they are using the same IP. Making use of the apache2 named configurations. So if the system uses the name it should work, but if using IP it will fail

Any known way to do this?

14
Avatar
Discard
Avatar
Olivier Dony (odo)
Best Answer

You can perfectly well serve all the databases with a single OpenERP server on your machine. Unfortunately you did not mention what error you were seeing and what you expected as a result - makes it a bit harder to help you ;-)

Anyway, here are some random ideas based on the information you provided:

  • If you have a problem with OpenERP not listening on all interfaces, try to specify 0.0.0.0 as the xmlrpc_interface in the configuration file, this should have OpenERP listen on 8069 on all IPs.
  • Note that Apache is not relevant if you're connecting to e.g. http://www.sample.com:8069/?db=openerp because you're directly connecting to OpenERP. If you want to go through Apache, you need to setup ReverseProxy rules in your vhost configs, and OpenERP does not need to listen to all public IPs then.
  • OpenERP 6.1 and later can autodetect the database name based on the virtual host name, and filter the name of the available databases: you need to start it with the --db-filter parameter, which represents a pattern used to filter the list of available databases. %h represents the domain name and %d is the first domain component of that domain. So for example with --db-filter=^%d$ I will only see the test database if I end up on the server using http://test.example.com:8069. If there's only one database match, the list is not displayed and the user will directly end up on the right database. This works even behind Apache reverse proxies if you make sure that OpenERP see the external hostname, i.e. by setting a X-Forwarded-Host header in your Apache proxy config and enabling the --proxy mode of OpenERP.

Update: The port reuse problem comes because you are trying to start multiple OpenERP servers on the same interface/port combination. This is simply not possible unless you are careful to start just one server per IP with the IP set in the xmlrpc_interface parameter, and I don't think you need that. The named-based virtual hosts that Apache supports are all handled by a single master process that listens on port 80 on all the interfaces. If you want to do the same with OpenERP you only need to start one OpenERP server for all your domains, and make it listen on 0.0.0.0, port 8069, as I explained above.
On top of that it's not clear what you would have set differently in the various config files. Running 40 different OpenERP servers on the same machine with identical code sounds like a lot of overkill. OpenERP is designed to be multi-tenant so that many (read: hundreds) of databases can be served from the same server.

12
Avatar
Discard
Boyd Lynn Gerber
Author

My problem is I get post already in use. I do the following. /location_domain/openerp/openerp-server -c /location_domain/openerp.cfg &

Boyd Lynn Gerber
Author

Then on the next add using the -c with a different cfg and location I get the already in use. I have different names in the config file but they are using the same IP. Making use of the apache2 named configurations. So if the system uses the name it should work, but if using IP it will fail as i

Olivier Dony (odo)

Thanks for the extra info, I updated my answer

Luis Leiva

Important note on using --db-filter=^%d$ Database names ARE case sensitive while URL is NOT case sensitive, so if you have uppercases on database names the --db-filter=^%d$ will not work as URL converts everything to lower cases. Conclusion: use only lowercases in database names to use this.

bino oetomo

Hi Oliver and All

I create 2 db : db1 and db2

I also have hostname setup on my dns server ; db1.erp.bno db2.erp.bno

and in my /etc/openerp/openerp-server.conf , I put :

  1. list_db = False To disable the DB choice list, and
  2. db_filter=^%d$ In hope that web UI will select the db in regards of hostname (first part of FQDN)

But both didn't work 1. when I try to open http://db2.erp.bno:8069 , web UI forwardme to http://db2.erp.bno:8069/?db=db1 2. the DB choice list still there.

My installation is in ubuntu using apt-get

Kindly please give me your enlighten

Sincerely -bino-

Michael Karrer

Same for me db_filter seems to be not working on OpenERP Version 7

Michael Karrer

db-filter is working if i use it as a startup command for the server BUT is not working if i use it in the server config file ?!?

FRACHT FWO CZECH

Olivier, thanks for the explanation. I believe that the --proxy setting is in fact called --proxy-mode? I see a problem with the --db-filter setting: we have to make database names always be exactly the same like subdomains - this might be for whatever reason not always possible and it would be much better to have some way of mapping subdomains to arbitrary db names, this could be achieved e.g. with an Apache environment variable. Is there any possibility of creating such a mapping (without patching the OE7 code?). Also it would be great to have this kind of configuration available via web.

FRACHT FWO CZECH

Yes, we could add a mod_rewrite rule to add / replace the query string on every request, but I do not know if this will work with every request that OE7 generates... so fixing this in config file would be the best way.

FRACHT FWO CZECH

Another problem with this approach: if %h is the domain name, like e.g. http://example.com - this can not be a PostgreSQL database name, as the dot is an illegal character. So it is not possible to use a dbfilter like e.g. %h_%d because it would result in example.com_subdomain - you can not add such a database via the database creation dialog.

www postgresql org / docs / current / interactive / sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS (can not post links)

Avatar
Abner Galeno Jr.
Best Answer

I have no idea yet how XML-RPC works, but it might be the answer you are looking for.

References:

https://accounts.openerp.com/forum/Help-1/question/336/ https://accounts.openerp.com/forum/Help-1/question/915/ https://accounts.openerp.com/forum/Help-1/question/429/ I would say doing multiple installs would be one hell of a installation+maintenance job.

2
Avatar
Discard
Avatar
test
Best Answer

Configure

I have try this and its working well.

http://tinyurl.com/oe-multi-domain-easy-config

This one of easy to setup.

0
Avatar
Discard
Patrice Gaillard

This one sounds great. How did you apply this patch ? I don't get it...

Avatar
Lucio
Best Answer

I think you can do the trick by launching different servers using the -c option when launching them.

With that option you can specify which configuration your server will use, in particular, which port to 'hear'.

For example, I am not sure but I think the default values in server.conf will be:

netrpc_port = 8070
...
smtp_port = 25
...
xmlrpc_port = 8069
...
xmlrpcs_port = 8071

By changing those you could specify which ports you want to use in every server process.

Hope it helps you!

-1
Avatar
Discard
Boyd Lynn Gerber
Author

Thanks, I should have been more explicit about what I have tried. Each doman has a config file with its database. My Problem is because I am using named services. I had over 750 public IP's but when my local phone company added Fiber their old DSL stopped working reliably. So Now I have to pay.

Boyd Lynn Gerber
Author

Problem is I now only have 5 public IP addresses. I am able to come in to any domain and not have a problem. Seem openERP does not like to share IP addresses and wants to bind to the IP rather than the name. Thanks

Avatar
Boyd Lynn Gerber
Author Best Answer

Sovled by using *:8069 in /etc/apache2/listen.conf Then adding to each domain where desire

www.sample.com:8069/?db=openerp having a unique db for each domain.

Having a goood generic config and uses and using it with the -c config.cfg file.

-1
Avatar
Discard
Olivier Dony (odo)

This makes no sense, why force Apache to listen to port 8069? If you're making Apache proxy requests to OpenERP, why don't you do it on the normal port (80/443)? Then just direct your customers to their own URL. So far it looks like you're just testing random things without trying to understand :-/

Avatar
Prosper G. Nitcheu
Best Answer

Have you tried apache "VirtualHost" configuration ?

-1
Avatar
Discard
Boyd Lynn Gerber
Author

Yes, I have that part working for the domains . It is getting the openerp working. Been trying to get customized config files working. What I do for other programs is put the source in /usr/share/openerp with links in all the virtual hosts. name-vitrual-host-168.103.176.49.8069.conf domains

Avatar
sepdau
Best Answer

Why don't use specific_url_db option. It must be easiest way to do this job.

specific_url_db=abc.com:sr4,cde.com:sr2

Use add this option in openerp-server config file

-1
Avatar
Discard
Felipe

I tried this in v8 with no result. specific_url_db=database1.mydomain.com.co:DatabaseName1,database2.mydomain.com.co:DatabaseName2

Avatar
Luis Leiva
Best Answer

Have you tried by redirecting subdomains to this: http://server:8069/?db=database

Almost works. For some thing I don't understand it seems to not recognize the database when redirected, but if you refresh the page with that URL the it does works fine.

Try it and tell me how it goes.

-1
Avatar
Discard
Boyd Lynn Gerber
Author

That is what I am doing. http://www.sample.com:8069/?db=openerp and so one for each domain and its database. The apache part is working. But the openERP with each having their own conig is not.

Avatar
Supreeth KV
Best Answer

hello can you please provide me all step of installing multiple instances of openerp

-1
Avatar
Discard
Supreeth KV

Please read bugs . launchpad . net /openobject-server/+bug/1195341

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Sign up
Related Posts Replies Views Activity
How to add a "Delete" button on the popup form? Solved
v7
Avatar
Avatar
1
Oct 25
5860
Minimum Lot Charge For Sales Order Line Items
v7
Avatar
0
Dec 24
10636
Record Rule to allow a User to update their own Employee object without belonging to Officer group Solved
v7
Avatar
Avatar
Avatar
Avatar
3
Sep 24
23177
How to activate the Technical Features? Solved
v7
Avatar
Avatar
Avatar
Avatar
Avatar
5
Dec 24
55451
Way to only allow a specific DB to be the default? Solved
v7
Avatar
Avatar
Avatar
Avatar
Avatar
4
Jul 24
11992
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now