Siirry sisältöön
Odoo Menu
  • Kirjaudu sisään
  • Kokeile ilmaiseksi
  • Sovellukset
    Talous
    • Kirjanpito
    • Laskutus
    • Kulut
    • Datataulukot (BI)
    • Asiakirjat
    • Allekirjoita
    Myynti
    • CRM
    • Myynti
    • Kassajärjestelmä myymälään
    • Kassajärjestelmä ravintolaan
    • Tilaukset
    • Vuokraus
    Verkkosivut
    • Verkkosivun Rakennustyökalu
    • Verkkokauppa
    • Blogi
    • Foorumi
    • Livechat
    • Verkko-oppiminen
    Toimitusketju
    • Varastointi
    • Tuotanto
    • Tuotteen elinkaaren hallinta (PLM)
    • Ostot
    • Huolto
    • Laatu
    Henkilöstöhallinto
    • Työntekijät
    • Rekrytointi
    • Vapaat
    • Arvioinnit
    • Suositukset
    • Kuljetuskalusto
    Markkinointi
    • Somemarkkinointi
    • Sähköpostimarkkinointi
    • Tekstiviestimarkkinointi
    • Tapahtumat
    • Markkinoinnin automaatio
    • Kyselyt
    Palvelut
    • Projekti
    • Työaikakirjaukset
    • Kenttähuolto
    • Asiakaspalvelu
    • Suunnittelu
    • Ajanvaraukset
    Tuottavuus
    • Viestintä
    • Hyväksynnät
    • IoT
    • IP-puhe
    • Tietokirjasto
    • WhatsApp
    Kolmannen osapuolen sovellukset Odoo-Studio Odoo-Pilvialusta
  • Toimialat
    Vähittäiskauppa
    • Kirjakauppa
    • Vaatekauppa
    • Huonekaluliike
    • Ruokakauppa
    • Laitteistokauppa
    • Lelukauppa
    Ruoka & Majoitus
    • Baari ja Pubi
    • Ravintola
    • Pikaruoka
    • Majatalo
    • Juomien jakelija
    • Hotelli
    Kiinteistöt
    • Kiinteistönvälitystoimisto
    • Arkkitehtitoimisto
    • Rakentaminen
    • Kiinteistönhallinta
    • Puutarhanhoito
    • Kiinteistön omistajien yhdistys
    Konsultointi
    • Tilitoimisto
    • Odoo-kumppani
    • Markkinointitoimisto
    • Lakitoimisto
    • Osaajahankinta
    • Tilintarkastus & sertifiointi
    Tuotanto
    • Tekstiili
    • Metalli
    • Huonekalut
    • Ruoka
    • Panimo
    • Yrityslahjat
    Terveys & Liikunta
    • Urheiluseura
    • Silmälasiliike
    • Kuntokeskus
    • Hyvinvointialan ammattilaiset
    • Apteekki
    • Kampaamo
    Kaupat
    • Yleismies
    • IT-laitteisto & Tuki
    • Aurinkoenergiajärjestelmät
    • Suutari
    • Siivouspalvelut
    • LVI-palvelut
    Muut
    • Voittoa tavoittelematon järjestö
    • Ympäristötoimisto
    • Mainostaulujen vuokraus  
    • Valokuvaus
    • Leasing-pyörät
    • Ohjelmistojen jälleenmyyjä
    Selaa kaikkia toimialoja
  • Yhteisö
    Opi
    • Kurssit
    • Dokumentaatio
    • Todistukset
    • Koulutus
    • Blogi
    • Podcast
    Kannusta kouluttautumaan
    • Koulutusohjelmat
    • Scale Up! Liiketoimintapeli
    • Vieraile Odoolla
    Hanki ohjelmisto
    • Lataa
    • Vertaile versioita
    • Julkaisut
    Tee yhteistyötä
    • Github
    • Foorumi
    • Tapahtumat
    • Käännökset
    • Ryhdy kumppaniksi
    • Kumppanipalvelut
    • Rekisteröi tilitoimistosi
    Hanki palveluja
    • Löydä kumppani
    • Löydä kirjanpitäjä
    • Varaa asiantuntijatapaaminen
    • Implementaatiopalvelut
    • Asiakasreferenssit
    • Tuki
    • Versionkorotukset
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Varaa demo
  • Hinnoittelu
  • Asiakaspalvelu

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

  • CRM
  • e-Commerce
  • Kirjanpito
  • Varastointi
  • PoS
  • Projekti
  • MRP
All apps
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Kaikki kirjoitukset Ihmiset Merkit
Tunnisteet (Näytä kaikki)
odoo accounting v14 pos v15
Tietoa tästä foorumista
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Kaikki kirjoitukset Ihmiset Merkit
Tunnisteet (Näytä kaikki)
odoo accounting v14 pos v15
Tietoa tästä foorumista
Apua

[Odoo 8.0 - apache2] How to configure a proxy from an url to a specific database, in a multi-database setup ?

Tilaa

Saat ilmoituksen, kun tähän viestiin ilmaantuu aktiviteettia

Tämä kysymys on merkitty
apache2odooV8
12 Vastaukset
18745 Näkymät
Avatar
PY

Hi !


Given the standard multi-db configuration:

# wildcard proxy for odoo:
# one subdomain -> one database

<VirtualHost *:80>
 ServerName mydomain.fr
 ServerAlias *.mydomain.fr

 ErrorLog /var/log/odoo/odoo-error.log
 CustomLog /var/log/odoo/odoo-access.log combined
 LogLevel warn

 <Proxy *>
  Order deny,allow
  Allow from all
 </Proxy>

 ProxyRequests Off
 ProxyPass / http://mydomain.fr:8089/
 ProxyPassReverse / http://mydomain.fr:8089/

 ProxyVia On
</VirtualHost>

So I already know how to serve database 'foo' with url http://foo.mydomain.com.

In my Odoo config, the dbfilter is set to ^%d$.

How one would add a domain which point to a specific database ?

Example:

  • user access to http://bar.com/web/login

  • apache proxies to http://quz.mydomain.fr/web/login

  • then the config already in place do its job like for other databases: proxy to http://mydomain.fr:8089/ with previous url given to Odoo, so that it serves the db matching the subdomain (here database_of_another_domain)

0
Avatar
Hylkää
Avatar
PY
Tekijä Paras vastaus

Finally, I came up with this:

################
# welcome page #
################

<VirtualHost *:80>
    ServerName mydomain.fr
    ServerAlias www.mydomain.fr
    DocumentRoot /var/www/odoo
</VirtualHost>


#################
# wilcard proxy #
#################

<VirtualHost *:80>
    ServerName mydomain.fr
    ServerAlias *.mydomain.fr

    ErrorLog /var/log/odoo/odoo-error.log
    CustomLog /var/log/odoo/odoo-access.log combined
    LogLevel warn

    <Proxy *>
        Order deny,allow
        Allow from all
    </Proxy>

    ProxyRequests Off
    ProxyPreserveHost On
    ProxyPass / http://mydomain.fr:8089/
    ProxyPassReverse / http://mydomain.fr:8089/

    ProxyVia On
</VirtualHost>


##################
# customer proxy #
##################

<VirtualHost *:80>
    ServerName other-domain.com
    ServerAlias www.other-domain.com

    ProxyRequests Off
    ProxyPass / http://other-domain.mydomain.fr/
    ProxyPassReverse / http://other-domain.mydomain.fr/

    ProxyVia On
</VirtualHost>


################
# restrictions #
################

<Location /web/database>
    Order deny,allow
    Deny from all
    Allow from 1.2.3.4
    Allow from 5.6.7.8
</Location>

Thanks to you, Ermin Travisan for your help.

0
Avatar
Hylkää
Avatar
Ermin Trevisan
Paras vastaus

1. Use the dbfilter parameter in the openerp-server.conf file. You have 2 options:

- %d: Odoo extracts the subdomain of a hostname except of "www". Examples: "www.subdomain.domain.tld" results in the database name "subdomain". "subdomain.domain.tld" results i the same database name "subdomain". "www.domain.tld" results in the database name "domain"!

- %h: Odoo takes the FQDN. Examples: "www.subdomain.domain.tld" results in the database name "www-subdomain-domain-tld". "subdomain.domain.tld" results in "subdomain-domain-tld" and so on.

%d or %h are regex expressions, in my setup I use dbfilter = ^%d$.

2. In your Apache vhost definition proxy to the IP address and port of your Odoo server and forward the request headers:

You can either use the directive "ProxyReserveHost" or the options X-Forwarded-For (see http://stackoverflow.com/questions/6070335/retain-original-request-url-on-mod-proxy-redirect)  

If it is not possible to match database names from the host/domain name, you can use the module https://www.odoo.com/apps/modules/9.0/dbfilter_from_header/


2
Avatar
Hylkää
PY
Tekijä

I already know about the dbfilter, and all that works perfectly.

What I miss, is how to proxy from "bar.com/web" to "quz.mydomain.fr/web", so that "quz.mydomain.fr/web" gets in turn proxied to "mydomain.fr:8069/web" by the already in place configuration.

Ermin Trevisan

What is the name of the database you want to connect to? Is it "bar" or "quz"? I'm not sure if it has to be that complicated. Anyway, with a proper rewrite you should be able to achieve your goal.

PY
Tekijä

The database is "quz", and "bar.com" is the domain that should be visible.

Ermin Trevisan

See my amended answer.

PY
Tekijä

So, it isn't possible, on a single Odoo (8.0 by the way, forgot to mention) instance, to :

- proxy "foo.mydomain.fr", "xyz.mydomain.fr" to "mydomain.fr:8069" with respectively databses "foo" and "xyz" ;

- proxy "bar.com" to "mydomain.fr:8069" with database "quz" (can be anything, really) with or without the intermediate proxy "quz.mydomain.fr"

?

Ermin Trevisan

The first one is for sure easily possible, because that's the common dbfilter use case. The second one might be possible with proper URL rewriting. But I do not understand why you don't want to name the database "bar" instead of "quz" in the first place.

PY
Tekijä

It's just an example. In fact it is the same. But since the config file allow only one dbfilter, it doesn't really matter.

Or does it ? Can a dbfilter have an OR condition ? Like: ^%d$ | ^%h$

Ermin Trevisan

No

Ermin Trevisan

The result of the dbfilter operation should match a single database which would not be the case in your example.

PY
Tekijä

Thanks for your help. I'll try some rewrite rules and all that good stuff then.

Nautitko keskustelusta? Älä vain lue, vaan osallistu!

Luo tili jo tänään nauttiaksesi yksinoikeusominaisuuksista ja osallistuaksesi mahtavaan yhteisöömme!

Rekisteröidy
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
Odoo on different URL Path
apache2 odooV8
Avatar
0
toukok. 15
5489
Odoo Apache2 SSL connection Glitch
ssl apache2 odooV8
Avatar
Avatar
1
huhtik. 16
6173
CONFIGURACION DE CORREO PROPIO POR PRUMERA VEZ
odooV8
Avatar
0
maalisk. 25
2017
How to remove model if not in the py files anymore
odooV8
Avatar
0
tammik. 25
4293
Start odoo server automatically in Ubuntu 14.04 on reboot Ratkaistu
odooV8
Avatar
Avatar
1
elok. 23
15931
Yhteisö
  • Kurssit
  • Dokumentaatio
  • Foorumi
Avoin lähdekoodi
  • Lataa
  • Github
  • Runbot
  • Käännökset
Palvelut
  • Odoo.sh hosting
  • Tuki
  • Versionkorotus
  • Räätälöidyt kehitykset
  • Koulutus
  • Löydä kirjanpitäjä
  • Löydä kumppani
  • Ryhdy kumppaniksi
Meistä
  • Yrityksemme
  • Tavaramerkki
  • Ota yhteyttä
  • Työpaikat
  • Tapahtumat
  • Podcast
  • Blogi
  • Asiakkaat
  • Oikeudellinen ilmoitus • Yksityisyys
  • Tietoturva
الْعَرَبيّة 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 on kokoelma avoimen lähdekoodin yrityssovelluksia, jotka kattavat kaikki yrityksesi tarpeet: asiakkuudenhallinta eli CRM, verkkokauppa, kirjanpito, varastointi, kassajärjestelmä, projektinhallinta, jne.

Odoon uniikki arvolupaus on olla samanaikaisesti erittäin helppokäyttöinen ja täysin integroitu.

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