Skip to Content
Odoo Menu
  • Log ind
  • Prøv gratis
  • Apps
    Økonomi
    • Bogføring
    • Fakturering
    • Udgifter
    • Regneark (BI)
    • Dokumenter
    • e-Signatur
    Salg
    • CRM
    • Salg
    • POS Butik
    • POS Restaurant
    • Abonnementer
    • Udlejning
    Hjemmeside
    • Hjemmesidebygger
    • e-Handel
    • Blog
    • Forum
    • LiveChat
    • e-Læring
    Forsyningskæde
    • Lagerbeholdning
    • Produktion
    • PLM
    • Indkøb
    • Vedligeholdelse
    • Kvalitet
    HR
    • Medarbejdere
    • Rekruttering
    • Fravær
    • Medarbejdersamtaler
    • Anbefalinger
    • Flåde
    Marketing
    • Markedsføring på sociale medier
    • E-mailmarketing
    • SMS-marketing
    • Arrangementer
    • Automatiseret marketing
    • Spørgeundersøgelser
    Tjenester
    • Projekt
    • Timesedler
    • Udkørende Service
    • Kundeservice
    • Planlægning
    • Aftaler
    Produktivitet
    • Dialog
    • Godkendelser
    • IoT
    • VoIP
    • Vidensdeling
    • WhatsApp
    Tredjepartsapps Odoo Studio Odoo Cloud-platform
  • Brancher
    Detailhandel
    • Boghandel
    • Tøjforretning
    • Møbelforretning
    • Dagligvarebutik
    • Byggemarked
    • Legetøjsforretning
    Mad og værtsskab
    • Bar og pub
    • Restaurant
    • Fastfood
    • Gæstehus
    • Drikkevareforhandler
    • Hotel
    Ejendom
    • Ejendomsmægler
    • Arkitektfirma
    • Byggeri
    • Ejendomsadministration
    • Havearbejde
    • Boligejerforening
    Rådgivning
    • Regnskabsfirma
    • Odoo-partner
    • Marketingbureau
    • Advokatfirma
    • Rekruttering
    • Audit & certificering
    Produktion
    • Tekstil
    • Metal
    • Møbler
    • Fødevareproduktion
    • Bryggeri
    • Firmagave
    Heldbred & Fitness
    • Sportsklub
    • Optiker
    • Fitnesscenter
    • Kosmetolog
    • Apotek
    • Frisør
    Håndværk
    • Handyman
    • IT-hardware og support
    • Solenergisystemer
    • Skomager
    • Rengøringsservicer
    • VVS- og ventilationsservice
    Andet
    • Nonprofitorganisation
    • Miljøagentur
    • Udlejning af billboards
    • Fotografi
    • Cykeludlejning
    • Softwareforhandler
    Gennemse alle brancher
  • Community
    Få mere at vide
    • Tutorials
    • Dokumentation
    • Certificeringer
    • Oplæring
    • Blog
    • Podcast
    Bliv klogere
    • Udannelselsesprogram
    • Scale Up!-virksomhedsspillet
    • Besøg Odoo
    Få softwaren
    • Download
    • Sammenlign versioner
    • Udgaver
    Samarbejde
    • Github
    • Forum
    • Arrangementer
    • Oversættelser
    • Bliv partner
    • Tjenester til partnere
    • Registrér dit regnskabsfirma
    Modtag tjenester
    • Find en partner
    • Find en bogholder
    • Kontakt en rådgiver
    • Implementeringstjenester
    • Kundereferencer
    • Support
    • Opgraderinger
    Github Youtube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Få en demo
  • Prissætning
  • Hjælp

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

  • CRM
  • e-Commerce
  • Bogføring
  • Lager
  • PoS
  • Projekt
  • MRP
All apps
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Hjælp

Subdomain filtering databases does not work

Tilmeld

Få besked, når der er aktivitet på dette indlæg

Dette spørgsmål er blevet anmeldt
db_filtersubdomainapache2odooV8
3 Besvarelser
8968 Visninger
Avatar
Andrius Laukavičius

I'm trying to configure domain in a way, so I could use subdomain for accessing database. For example if my domain is `domain.com` and I have databases `demo` and `demo2`. Then I should be able to access it by writing `demo.domain.com` and `demo2.domain.com`. But none of this work. I followed this guide: http://opensourceholic.com/2014/05/09/deploy-openerp-using-mod_proxy-and-mod_wsgi-on-linux-server/

After doing everything by the guide, what I was able to do, was I can only access Odoo web by writing `domain.com`, but if I write `demo.domain.com`, I will only get this message `This webpage is not available`.

So what I did:

My apache2 configuration files:

`openerp.conf`

    <VirtualHost *:80>
        ServerName domain.com
        ServerAlias *.domain.com // 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://domain.com:8069/
        ProxyPassReverse / http://domain.com:8069/
        ProxyVia On
        LogLevel warn
    </VirtualHost>

`openerp-wsgi.conf`:

    <VirtualHost *:80>
        ServerName domain.com
        ServerAlias *.domain.com // Use this if you want dbfillter on subdomain
        WSGIScriptAlias / /opt/openerp/server/openerp-wsgi.py
        WSGIDaemonProcess oe user=user group=oerp processes=2 python-path=/opt/openerp/server/ display-name=apache-openerp
        WSGIProcessGroup oe
        ErrorLog /var/log/openerp/openerp-error.log
        CustomLog /var/log/openerp/openerp-access.log combined
        <Directory /opt/openerp/server>
            Order allow,deny
            Allow from all
        </Directory>
    </VirtualHost>

My `openerp-wsgi.py` configuration:

    import openerp
    
    #----------------------------------------------------------
    # Common
    #----------------------------------------------------------
    openerp.multi_process = True # Nah!
    
    # Equivalent of --load command-line option
    openerp.conf.server_wide_modules = ['web']
    conf = openerp.tools.config
    
    # Path to the OpenERP Addons repository (comma-separated for
    # multiple locations)
    
    conf['addons_path'] = '/opt/openerp/server/addons/,/opt/openerp/server/openerp/addons/'
    
    # Optional database config if not using local socket
    #conf['db_name'] = 'demo'
    conf['db_host'] = '127.0.0.1'
    conf['db_user'] = 'user'
    conf['db_port'] = 5433
    conf['db_password'] = 'password'
    #conf['dbfilter'] = '%d'
    #----------------------------------------------------------
    # Generic WSGI handlers application
    #----------------------------------------------------------
    application = openerp.service.wsgi_server.application
    
    openerp.service.server.load_server_wide_modules()
    
    #----------------------------------------------------------
    # Gunicorn
    #----------------------------------------------------------
    # Standard OpenERP XML-RPC port is 8069
    bind = '0.0.0.0:8069'
    pidfile = '.gunicorn.pid'
    workers = 4
    timeout = 240
    max_requests = 2000

And even after doing this, it still was not working, so I added this line in /etc/hosts:

`127.0.0.1 domain.com` Then I was able to access OpenERP when entering domain.com address, but only this. If I add suggested filter (either directly in config file or in openerp-wsgi.py file), then system does not find any database and I can't access any of it, even in the list not to mention the main reason I'm doing this to access by subdomain (as written in an example).

So what is wrong here?

Note. I'm trying this on Odoo v8. 

1
Avatar
Kassér
Avatar
Andrius Laukavičius
Forfatter Bedste svar

I figured I need to manually enter every subdomain in /etc/hosts, only then it starts working I expect.

1
Avatar
Kassér
Avatar
swapnil wagh
Bedste svar

Hi Andrius Laukavičius,

If you are working on local machine you should edit /etc/hosts with something like this:

127.0.0.1 foo.localhost

127.0.0.1 bar.localhost

where foo and bar are the db names.

Your virtual host file should look like this:

<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  write dbfilter = ^%d$ in your openerp/tools/config.py file. After that restart apache2 and openerp.

In case you are doing all this on VPS and you bough a domain from domian provider, then you dont need to edit /etc/hosts file.

 

7
Avatar
Kassér
Avatar
Andrius Laukavičius
Forfatter Bedste svar

I figured I need to manually enter every subdomain in /etc/hosts, only then it starts working I expect.

0
Avatar
Kassér
Enjoying the discussion? Don't just read, join in!

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

Tilmeld dig
Related Posts Besvarelser Visninger Aktivitet
[Odoo 8.0 - apache2] How to configure a proxy from an url to a specific database, in a multi-database setup ? Løst
apache2 odooV8
Avatar
Avatar
12
nov. 23
18723
Odoo on different URL Path
apache2 odooV8
Avatar
0
maj 15
5466
Odoo Apache2 SSL connection Glitch
ssl apache2 odooV8
Avatar
Avatar
1
apr. 16
6163
Why SSL Subdomain dbfilter not working ? Løst
database ssl db_filter subdomain
Avatar
Avatar
2
nov. 19
8617
How to access database with sub subdomain in odoo? Løst
nginx db_filter hosting odooV8
Avatar
Avatar
1
jan. 16
10184
Community
  • Tutorials
  • Dokumentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Oversættelser
Tjenester
  • Odoo.sh-hosting
  • Support
  • Opgradere
  • Individuelt tilpasset udvikling
  • Uddannelse
  • Find en bogholder
  • Find en partner
  • Bliv partner
Om os
  • Vores virksomhed
  • Brandaktiver
  • Kontakt os
  • Stillinger
  • Arrangementer
  • Podcast
  • Blog
  • Kunder
  • Juridiske dokumenter • Privatlivspolitik
  • Sikkerhedspolitik
الْعَرَبيّة 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 er en samling open source-forretningsapps, der dækker alle dine virksomhedsbehov – lige fra CRM, e-handel og bogføring til lagerstyring, POS, projektledelse og meget mere.

Det unikke ved Odoo er, at systemet både er brugervenligt og fuldt integreret.

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