Bỏ qua để đến Nội dung
Odoo Menu
  • Đăng nhập
  • Dùng thử miễn phí
  • Ứng dụng
    Tài chính
    • Kế toán
    • Hóa đơn
    • Chi phí
    • Bảng tính (BI)
    • Tài liệu
    • Ký tên
    Bán hàng
    • CRM
    • Bán hàng
    • POS Cửa hàng
    • POS Nhà hàng
    • Đăng ký
    • Cho thuê
    Trang web
    • Trình tạo trang web
    • Thương mại điện tử
    • Blog
    • Diễn đàn
    • Trò chuyện trực tiếp
    • Học trực tuyến
    Chuỗi cung ứng
    • Tồn kho
    • Sản xuất
    • PLM
    • Mua hàng
    • Bảo dưỡng
    • Chất lượng
    Nhân sự
    • Nhân viên
    • Tuyển dụng
    • Ngày nghỉ
    • Đánh giá
    • Giới thiệu
    • Đội xe
    Marketing
    • Marketing trên MXH
    • Marketing qua email
    • Marketing qua SMS
    • Sự kiện
    • Tự động hóa Marketing
    • Khảo sát
    Dịch vụ
    • Dự án
    • Bảng chấm công
    • Dịch vụ hiện trường
    • Hỗ trợ
    • Kế hoạch
    • Lịch hẹn
    Năng suất
    • Thảo luận
    • Phê duyệt
    • IoT
    • VoIP
    • Kiến thức
    • WhatsApp
    Ứng dụng của bên thứ ba Studio Odoo Nền tảng Đám mây Odoo
  • Ngành
    Bán lẻ
    • Nhà sách
    • Cửa hàng quần áo
    • Cửa hàng nội thất
    • Cửa hàng tạp hóa
    • Cửa hàng đồ kim khí
    • Cửa hàng đồ chơi
    Ẩm thực & Dịch vụ lưu trú
    • Bar và quán rượu
    • Nhà hàng
    • Đồ ăn nhanh
    • Guest house
    • Nhà phân phối đồ uống
    • Khách sạn
    Bất động sản
    • Công ty môi giới bất động sản
    • Công ty kiến trúc
    • Xây dựng
    • Quản lý bất động sản
    • Làm vườn
    • Hiệp hội chủ sở hữu bất động sản
    Tư vấn
    • Công ty kế toán
    • Đối tác Odoo
    • Công ty marketing
    • Công ty luật
    • Tuyển dụng
    • Thanh tra & chứng nhận
    Sản xuất
    • Dệt may
    • Kim loại
    • Nội thất
    • Ẩm thực
    • Nhà máy bia
    • Quà tặng doanh nghiệp
    Sức khoẻ & fitness
    • CLB thể thao
    • Cửa hàng kính mắt
    • Trung tâm fitness
    • Chuyên gia chăm sóc sức khỏe
    • Hiệu thuốc
    • Tiệm làm tóc
    Thương mại
    • Dịch vụ sửa chữa
    • Phần cứng CNTT & Hỗ trợ
    • Hệ thống năng lượng mặt trời
    • Công ty sản xuất giày
    • Dịch vụ vệ sinh
    • Dịch vụ HVAC
    Khác
    • Tổ chức phi lợi nhuận
    • Cơ quan môi trường
    • Cho thuê biển quảng cáo
    • Nhiếp ảnh
    • Cho thuê xe đạp
    • Đại lý phần mềm
    Xem tất cả ngành
  • Cộng đồng
    Học tập
    • Khóa học
    • Tài liệu
    • Chứng chỉ
    • Đào tạo
    • Blog
    • Podcast
    Thúc đẩy đào tạo
    • Chương trình đào tạo
    • Trò chơi kinh doanh Scale Up!
    • Tham quan Odoo
    Nhận phần mềm
    • Tải xuống
    • So sánh các phiên bản
    • Phiên bản
    Hợp tác
    • Github
    • Diễn đàn
    • Sự kiện
    • Dịch thuật
    • Trở thành đối tác
    • Dịch vụ dành cho Đối tác
    • Đăng ký công ty kế toán của bạn
    Nhận dịch vụ
    • Tìm đối tác
    • Tìm kế toán
    • Gặp chuyên gia hỗ trợ
    • Dịch vụ Triển khai
    • Khách hàng tham khảo
    • Hỗ trợ
    • Nâng cấp
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Nhận một buổi demo
  • Bảng giá
  • Trợ giúp

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

  • CRM
  • e-Commerce
  • Kế toán
  • Tồn kho
  • PoS
  • Dự án
  • MRP
All apps
Bạn cần phải đăng ký để tương tác với cộng đồng.
Tất cả bài viết Người Huy hiệu
Thẻ (Xem tất cả)
odoo accounting v14 pos v15
Về diễn đàn này
Bạn cần phải đăng ký để tương tác với cộng đồng.
Tất cả bài viết Người Huy hiệu
Thẻ (Xem tất cả)
odoo accounting v14 pos v15
Về diễn đàn này
Hỗ trợ

Odoo 14 Multi-site, Multi-company, Same Server, Shared Database - not forwarding traffic to the correct domain!

Đăng ký nhận tin

Nhận thông báo khi có hoạt động trên bài viết này

Câu hỏi này đã bị gắn cờ
2 Trả lời
13679 Lượt xem
Ảnh đại diện
West Budreau

This is the first time reaching out to the community, and only after months of trial and error, a ton of googling, reading 4 of the Odoo textbooks, and all the documentation I can find I still haven't been able to figure this out this problem - and I think it's probably something simple, so I figured I'd reach out.

Here's the scenario:

-Odoo 14 Community edition running on an AWS EC2 instance

-9 Separate Companies

-9 Public Facing Websites

-All Websites / Companies Sharing the Same Database

-VM Running on Debian 10


The Problem:

Despite my best efforts, I can't seem to get web traffic to route to the front-end websites correctly! Everything routes to the "main" website when typing any of the domains for the 9 publicly facing websites... and I can't seem to figure out how to configure the web servers to work properly.


Configurations:

I used one of Bitnami's EC2 stacks to provision the instance to get started with the Apache2 as the web server, of which I've installed Nginx to act as a reverse proxy after researching the performance / security improvements while possibly solving this domain redirection problem but have not had any luck. From my understanding, with the Multi-site configurations in Odoo 14, this shouldn't be a problem - yet it persists.

-web.base.url points to the default localhost:8069, I've tried the approach of "logging into each site as the admin" and setting the "web.base.url.freeze" to True, which has yet to work correctly, and also have tried changing the localhost:8069 to point to a "odoo.website.com" type name, thinking it might avoid conflicts with the front-end side with no luck

-httpd.conf: Prior to installing Nginx, I configured the main file to point to the httpd-vhosts.conf file

-httpd-vhosts.conf: I've tried setting this file up with the *:80 & *:443, for each of the 9 domains in the same file. I've tried replacing the * with localhost, the public / static IP for 80 & 127.0.0.1 for 443, using the proxy pass directive to point to the respective localhost:8069 addresses, and longpolling addresses on port 8072, and and just about everything else you can think of with no luck in resolving the domains

-odoo-server.conf: I'm still confused on the whole "db filter" thing, since I have one database I'm not sure this would matter, is there is something I need to change here? Maybe with the %h or #d? I've tried setting the proxy to Yes and No, and ya - totally lost.

-Nginx: When setting up nginx.conf, I changed the ports of apache to :8080 & :8443, and configured he t9 individual server blocks in the sites-enabled folder for each site based on documentation, and also provisioned the ssl certs or Nginx as well - but am still not sure if I did it correctly.

-"Proxy" vs "SSL" configuration with Nginx: Perhaps I'm doing something wrong here with the directives in the Nginx Server Blocks, I've been getting errors relating to "multiple longpolling addresses", but since that's only used for the chat I wouldn't think it would impact my domain redirection problem - but regardless, it does seem I might be confused on how to properly configure Nginx on the "proxy" side of things vs the "SSL" side of things.


An Easy Problem to fix:

From what I can tell, my problem comes from my lack of knowledge as a developer / programmer / server admin / etc... And it seems there is a simple solution that would take 5 minutes if I just knew the way to configure these dang web servers correctly!

My background is on the entrepreneurial side of things, Odoo after researching many ERP solutions over the past 4 years, it seems - if configured properly - it could solve all of my problems and help manage all of these ventures I plan on building in the most cost-effective approach! 

My main objective is to get these websites up and running so I can begin preparing for a major funding round in the next 3 months and have the technology infrastructure put together so I can organize these businesses and properly delegate the functions and get everything in operation! I've been down many rabbit holes, and I'd say I've learned enough about the enterprise architecture side of things, but through this "cowboy development" approach - I'm at a roadblock until I figure out how to properly direct traffic to these damn domains!


Possible Solutions / Guidance:

I feel like I'm "almost there" although I've been saying that for the past 2 months and after having destroyed something like 20+ virtual machines on multiple cloud platforms - but I feel confident in my knowledge of what I've learned about how all this stuff ought to work. Perhaps, the best way someone could help would be to clarify the best practices around:

-How to properly configure the odoo-server.conf file to work with nginx in this scenerio

-What is the role of apache in all this? Doesn't Odoo have its own built-in webserver? Do I even need apache? If so, what do I need to do with apache's httpd.conf / httpd-vhosts.conf files?

-If I do need apache, how do I configure the server blocks with Nginx - how might they relate to vhosts in apache? Do I need to assign different internal IP addresses to the same port? Do I need one vhost in apache and multiple in Nginx? What are the directives / relationships between proxy server vs the ssl side of things and how might they be configured properly?

-What is the best practices in terms of databases? Should I have a different database for each site? Different databases for each company? It seems the simplest approach is my current configuration, as it seems having different databases would affect the tight integrations between the parent company(s) / subsidiaries between the front-end and back end... am I correct?

-What is the quickest and easiest way to make sure these domain addresses get resolved to the correct website? 

Please let me know if there are any recommendations or advice! I feel it's a simple thing to solve, but with all of this "cowboy development" type shenanigans I need help pulling myself out of the rabbit hole!

3
Ảnh đại diện
Huỷ bỏ
Ảnh đại diện
Ermin Trevisan
Câu trả lời hay nhất

Please excuse my quick browsing of you extensive text, but I hope I can point you to most important issues and show you, how I did it myself a similar setup, but even with multiple databases. The following describes how I made it work in my environment. There may be other ways, there may be flaws, but it works.

Remarks (or my personal opinions/experiences):

- You are correct, when using related companies and manage relations to a parent company, multi-company is the way to go
- Do not use a Bitnami image, install it yourself, it is easy enough (read the documentation).
- Do not use a VM (what for anyway?), if it is important, use Docker
- You are right, there is no need for Apache, Odoo has its inbuilt web server
- Use a reverse_proxy for SSL termination, but install it on a separate server in the subnet, which has a firewall open to the public (ports 80, 443). Depending on the traffic, a t2.nano EC2 is a good starter.
- install Odoo on a server in a private subnet without public access, allow access only to the reverse proxy
- if you don't understand nginx (for me it's too complicated), use a Caddy Server, which is much easier to use

dbfilter:


dbfilter is a Regex-based mechanism to translate the hostname of an incoming http-Request (i.e. https://www.example.com) to one or more database names. Please use Google to find more information. The most common use case is to set a database name, which relates to a subdomain of the hostname, example: database name is "odoo", the hostname is https://odoo.example.com.

In your case, you can set the dbfilter hardcoded to your database name, or you can use the OCA module dbfilter_from_header to keep the opportunity to still use more than one database. The module is available for Odoo 13.0, but you can simply change the version to 14 in the __manifest__.py file and it works.

How to do it:


- In Odoo Website Settings, set the proper domain name to each website, example: www.company1.com, this is also the vhost name you have to define in the reverse proxy

- In the odoo.conf file set dbfilter to your database name (dbfilter = databasename) or , when you use the module dbfilter_from_header, let pass everything (dbfilter = .*). Set proxy_mode = True. If you use dbfilter_from_header, add it to the list of serverwide modules.

- Here's the settings in the default odoo.conf file:

[options]
...
...
...

dbfilter = .*
proxy_mode = True

...
...
server_wide_modules = base,web,dbfilter_from_header
...
...

- and here is a sample vhost declaration (Caddyfile) you have to define for each website domain:

company1.com {
redir https://www.company1.com{uri}
}


www.company1.com {
reverse_proxy http://168.xxx.xxx.xxx:8069 

header_up X-Real-IP {remote}
header_up X-Forwarded-Proto https
header_up X-Forwarded-Host {host}
header_up X-Url-Scheme {scheme}
header_up X-Odoo-dbfilter databasename
}

encode gzip zstd
file_server
log {
output file /var/log/caddy/caddy.log
}
}

Please be aware that Caddy Server automatically provides and renews SSL certificates, so there is nothing else to do, it is as simple as that.

2
Ảnh đại diện
Huỷ bỏ
zahid

HI Ermin Trevisan,
I have a setting in V15,CE one shared database, two companies and two differente domains :
company1 .-> www.company1.com
company2 www.company2.com
I applied exactly the steps you described , but it is not working. www.company2.com always forwarding to www.company1.com.
Do you have any clue what i am missing here ?
Thanks

Ảnh đại diện
Adil Akbar
Câu trả lời hay nhất

Hi, 

You can see following for this:

https://youtu.be/GkNgc-fZO-I

Hope it helps,

Thanks

0
Ảnh đại diện
Huỷ bỏ
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!

Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!

Đăng ký
Cộng đồng
  • Khóa học
  • Tài liệu
  • Diễn đàn
Open source
  • Tải xuống
  • Github
  • Runbot
  • Dịch thuật
Dịch vụ
  • Lưu trữ Odoo.sh
  • Hỗ trợ
  • Nâng cấp
  • Phát triển tùy chỉnh
  • Đào tạo
  • Tìm kế toán
  • Tìm đối tác
  • Trở thành đối tác
Giới thiệu công ty
  • Công ty của chúng tôi
  • Tài sản thương hiệu
  • Liên hệ
  • Việc làm
  • Sự kiện
  • Podcast
  • Blog
  • Khách hàng
  • Pháp lý • Riêng tư
  • Bảo mật
الْعَرَبيّة 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 là bộ ứng dụng kinh doanh có open source đáp ứng tất cả các nhu cầu của công ty bạn: CRM, thương mại điện tử, kế toán, tồn kho, POS, quản lý dự án, v.v.

Định hướng giá trị riêng biệt của Odoo là tích hợp hoàn toàn và dễ dàng sử dụng.

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