Přejít na obsah
Odoo Menu
  • Přihlásit se
  • Vyzkoušejte zdarma
  • Aplikace
    Finance
    • Účetnictví
    • Fakturace
    • Výdaje
    • Spreadsheet (BI)
    • Dokumenty
    • Podpisy
    Prodej
    • CRM
    • Prodej
    • POS Obchod
    • POS Restaurace
    • Předplatné
    • Pronájem
    Webové stránky
    • Webové stránky
    • E-shop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Dodavatelský řetězec
    • Sklad
    • Výroba
    • PLM
    • Nákup
    • Údržba
    • Kvalita
    Lidské zdroje
    • Zaměstnanci
    • Nábor
    • Volno
    • Hodnocení zaměstnanců
    • Doporučení
    • Vozový park
    Marketing
    • Marketing sociálních sítí
    • Emailový marketing
    • SMS Marketing
    • Události
    • Marketingová automatizace
    • Dotazníky
    Služby
    • Projekt
    • Časové výkazy
    • Práce v terénu
    • Helpdesk
    • Plánování
    • Schůzky
    Produktivita
    • Diskuze
    • Schvalování
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Aplikace třetích stran Odoo Studio Odoo cloudová platforma
  • Branže
    Maloobchod
    • Knihkupectví
    • Obchod s oblečením
    • Obchod s nábytkem
    • Potraviny
    • Obchod s hardwarem
    • Hračkářství
    Jídlo a pohostinství
    • Bar a Pub
    • Restaurace
    • Fast Food
    • Penzion
    • Distributor nápojů
    • Hotel
    Nemovitost
    • Realitní kancelář
    • Architektonická firma
    • Stavba
    • Správa nemovitostí
    • Zahradnictví
    • Asociace vlastníků nemovitosti
    Poradenství
    • Účetní firma
    • Odoo Partner
    • Marketingová agentura
    • Právník
    • Akvizice talentů
    • Audit a certifikace
    Výroba
    • Textile
    • Kov
    • Nábytek
    • Jídlo
    • Brewery
    • Korporátní dárky
    Zdraví a fitness
    • Sportovní klub
    • Prodejna brýli
    • Fitness Centrum
    • Wellness praktikové
    • Lékárna
    • Kadeřnictví
    Transakce
    • Údržbář
    • IT hardware a podpora
    • Systémy solární energie
    • Výrobce obuvi
    • Úklidové služby
    • Služby HVAC
    Ostatní
    • Nezisková organizace
    • Agentura pro životní prostředí
    • Pronájem billboardů
    • Fotografování
    • Leasing jízdních kol
    • Prodejce softwaru
    Browse all Industries
  • Komunita
    Edukační program
    • Tutoriály
    • Dokumentace
    • Certifikace
    • Vzdělávání
    • Blog
    • Podcast
    Podpora vzdělávání
    • Vzdělávací program
    • Scale Up! Hra na firmu
    • Navštivte Odoo
    Získat software
    • Stáhnout
    • Porovnejte edice
    • Verze
    Spolupráce
    • Github
    • Fórum
    • Události
    • Překlady
    • Stát se partnerem
    • Services for Partners
    • Registrujte svou účetní firmu
    Získat služby
    • Najít partnera
    • Najít účetní
    • Setkejte se s poradcem
    • Implementační služby
    • Zákaznické reference
    • Podpora
    • Upgrady
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dohodnout demo
  • Ceník
  • Pomoc

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Účetnictví
  • Sklad
  • PoS
  • Projekty
  • MRP
All apps
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
Pomoc

[Fixed] v10 - Multiple Domains with one Odoo Install

Odebírat

Get notified when there's activity on this post

This question has been flagged
multipledomains
10 Odpovědi
14561 Zobrazení
Avatar
Sean Donovan

I wanted one Odoo server to handle multiple low traffic sites on different domains.  Because multi-company is not well supported in the Community version (either it doesn't work or is not clearly documented), the best I could do was run Odoo against multiple databases, one for each domain.  I wanted the setup as simple as possible and with luck I found a way that doesn't require modifying source code (changing h.partition in "http.py") or setting up Apache as a proxy.

Here is how:

  1. Install Odoo as you normally would.

  2. Using iptables ("iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8069") point 8069 to 80 (if you are using UFW - make sure to open both ports! - "ufw allow 8069", and add the iptables line to /etc/rc.local to make it stick around after a reboot)

  3. Create the databases for your domains, but the database name *has* to take the form of "<domainname>_<TLD>", for example "yourdomain.com" should have a database named "yourdomain_com" with an underscore between the domain name and TLD.  If you try to use a dash instead of an underline, Odoo says it is not an allowed character, which must have been a change with v10 because everywhere else said use a dash.

  4. Then edit "/etc/odoo/odoo.conf" and add "dbfilter = %h" (I did it before the addons_path, but I don't think it matters)  There is endless documentation for using "%d" for subdomains, but very little for domains.

  5. Restart Odoo ("service odoo restart")

  6. Point your domain A records at Odoo and each site will then pick up it's respective database. 

You can actually do all this in reverse and it will still work, i.e. add dbfilter to odoo.conf, then visit each domain and create their respective databases (still appropriately named with underscores) for each domain.

A few caveats:

  1. You will notice that if you go to the database manager, it will only show you the database for the current domain, i.e. if you have two databases, one "myfirstdomain_com" and "mysecondomain_org", if you visit /web/database/manager from myfirstdomain.com, you will only see the myfirstdomain_com database.  The "mysecondomain_org" will be hidden.  You also can't fool Odoo by going to the database selector with an IP address, the only way to manage all the databases at once is to comment out the "dbfilter" code in odoo.conf.

  2. The domain must remove the "www" otherwise, it will fail.

  3. If you messed something up, you will get the database creation page popping back up.

It took me most of the day, but I figured it out with a lot of googling and just trying random things.  Someone else might as well save the hours if it takes me a half hour to document it.

Sean.

3
Avatar
Zrušit
Hilar Andikkadavath

Nice work.

Sudhir Arya (ERP Harbor Consulting Services)

Good job!!!

Avatar
Sean Donovan
Autor Nejlepší odpověď

(Since I can't delete this misthreaded answer) Odoo v10 does not allow dashes in the database name and why install any webserver when Odoo can do it by adding a single line to the configuration line.

0
Avatar
Zrušit
Ermin Trevisan

I did not test it yet, but you could also use underscores, IIRC.

Ermin Trevisan

But I would use %d instead of %h anyway. This works fine for the most cases because the www. gets stripped off.

Ermin Trevisan

Also it is not good practice to be forced to remove "www." from a FQDN. Keeping the "www." subdomain is mostly recommended for convenience and SEO reasons.

Avatar
calvin
Nejlepší odpověď

 Is it  possible to add domain filter on the odoo which running subdomain filter?.

0
Avatar
Zrušit
Avatar
Roberto Zanardo
Nejlepší odpověď

I've setup the environment using your suggestions and works on Odoo 11 too, also on windows:

http://robertozanardo.com/blog/2017/10/06/testing-odoo-11-port-80-with-multi-web-site-windows-server/

0
Avatar
Zrušit
Avatar
Ermin Trevisan
Nejlepší odpověď

I do not recommend your setup. A proper multi-domain deployment is a set-up with proxy server and SSL. How to do that is truly well documented, see for example here: https://www.odoo.com/forum/help-1/question/odoo-nginx-configuration-with-domain-name-and-db-filtering-for-multiple-domain-name-114775#answer-114777

0
Avatar
Zrušit
Sean Donovan
Autor

I followed your links, and what you recommend (https://www.odoo.com/forum/help-1/question/odoo-8-0-apache2-how-to-configure-a-proxy-from-an-url-to-a-specific-database-in-a-multi-database-setup-110545#answer-110604) doesn't work with v10 because dashes are no longer allowed in the database name.

Why install any webserver when Odoo can do it by adding a single line to the configuration file.

As for SSL - use Cloudflare with a "Flexible" certificate or "Full" with a server side Let's Encrypt cert.

Ermin Trevisan

Generally, it is definitely not a general use case or recommended procedure to rely on a freemium service for vital deployments if it is not necessary. Additionally I do not consider it as an elegant solution in a multi-tenant multi-client environment, which it is usually the case when using dbfilter.

Ermin Trevisan

As this obviously still gets attention, I have to confirm my critic. A Flexible Cloudflare-Certificate is not a solution as stated by Cloudflare themselves: https://support.cloudflare.com/hc/en-us/articles/200170416-What-do-the-SSL-options-mean-

and if you want to use Full encryption on Cloudflare, you have to show how to install and deploy a certificate on your server using your approach. My recommendation remain: stay away from such advise, set up a proper reverse proxy, meanwhile this is very easy to install and it does not justify to use such flawed methods as presented here.

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

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

Přihlásit se
Related Posts Odpovědi Zobrazení Aktivita
i need to connect odoo with my private domain
domains
Avatar
Avatar
1
led 19
7746
how to redirect a domain to odoo website? Vyřešeno
domains
Avatar
Avatar
Avatar
2
led 24
14385
How to run multiple websites, stores, domains with Odoo 8
v8 store multiple multicompany domains
Avatar
0
úno 16
5708
Configure different domains for multi companies
multicompany domains
Avatar
0
říj 25
4383
Can I bring my web design agency to Odoo?
webservices domains
Avatar
0
lis 24
1183
Komunita
  • Tutoriály
  • Dokumentace
  • Fórum
Open Source
  • Stáhnout
  • Github
  • Runbot
  • Překlady
Služby
  • Odoo.sh hostování
  • Podpora
  • Upgrade
  • Nestandardní vývoj
  • Edukační program
  • Najít účetní
  • Najít partnera
  • Stát se partnerem
O nás
  • Naše společnost
  • Podklady značky
  • Kontakujte nás
  • Práce
  • Události
  • Podcast
  • Blog
  • Zákazníci
  • Právní dokumenty • Soukromí
  • Zabezpečení
الْعَرَبيّة 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 je balíček open-source aplikací, které pokrývají všechny potřeby vaší společnosti: CRM, e-shop, účetnictví, sklady, kasy, projektové řízení a další.

Unikátní nabídka od Odoo poskytuje velmi jednoduché uživatelské rozhraní a vše je integrované na jednom místě.

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