Skip to Content
Odoo Menu
  • Prijavi
  • Try it free
  • Aplikacije
    Finance
    • Knjigovodstvo
    • Obračun
    • Stroški
    • Spreadsheet (BI)
    • Dokumenti
    • Podpisovanje
    Prodaja
    • CRM
    • Prodaja
    • POS Shop
    • POS Restaurant
    • Naročnine
    • Najem
    Spletne strani
    • Website Builder
    • Spletna trgovina
    • Blog
    • Forum
    • Pogovor v živo
    • eUčenje
    Dobavna veriga
    • Zaloga
    • Proizvodnja
    • PLM
    • Nabava
    • Vzdrževanje
    • Kakovost
    Kadri
    • Kadri
    • Kadrovanje
    • Odsotnost
    • Ocenjevanja
    • Priporočila
    • Vozni park
    Marketing
    • Družbeno Trženje
    • Email Marketing
    • SMS Marketing
    • Dogodki
    • Avtomatizacija trženja
    • Ankete
    Storitve
    • Projekt
    • Časovnice
    • Storitve na terenu
    • Služba za pomoč
    • Načrtovanje
    • Termini
    Produktivnost
    • Razprave
    • Odobritve
    • IoT
    • Voip
    • Znanje
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industrije
    Trgovina na drobno
    • Book Store
    • Trgovina z oblačili
    • Trgovina s pohištvom
    • Grocery Store
    • Trgovina s strojno opremo računalnikov
    • Trgovina z igračami
    Food & Hospitality
    • Bar and Pub
    • Restavracija
    • Hitra hrana
    • Guest House
    • Beverage Distributor
    • Hotel
    Nepremičnine
    • Real Estate Agency
    • Arhitekturno podjetje
    • Gradbeništvo
    • Estate Management
    • Vrtnarjenje
    • Združenje lastnikov nepremičnin
    Svetovanje
    • Računovodsko podjetje
    • Odoo Partner
    • Marketinška agencija
    • Law firm
    • Pridobivanje talentov
    • Audit & Certification
    Proizvodnja
    • Tekstil
    • Metal
    • Pohištvo
    • Hrana
    • Brewery
    • Poslovna darila
    Health & Fitness
    • Športni klub
    • Trgovina z očali
    • Fitnes center
    • Wellness Practitioners
    • Lekarna
    • Frizerski salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Sistemi sončne energije
    • Izdelovalec čevljev
    • Čistilne storitve
    • HVAC Services
    Ostali
    • Neprofitna organizacija
    • Agencija za okolje
    • Najem oglasnih panojev
    • Fotografija
    • Najem koles
    • Prodajalec programske opreme
    Browse all Industries
  • Skupnost
    Learn
    • Tutorials
    • Dokumentacija
    • Certifikati
    • Šolanje
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Prenesi
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Dogodki
    • Prevodi
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Sklici kupca
    • Podpora
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Določanje cen
  • Pomoč

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

  • CRM
  • e-Commerce
  • Knjigovodstvo
  • Zaloga
  • PoS
  • Projekt
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
Pomoč

Subdomain filtering databases does not work

Naroči se

Get notified when there's activity on this post

This question has been flagged
db_filtersubdomainapache2odooV8
3 Odgovori
8965 Prikazi
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
Opusti
Avatar
Andrius Laukavičius
Avtor Best Answer

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

1
Avatar
Opusti
Avatar
swapnil wagh
Best Answer

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
Opusti
Avatar
Andrius Laukavičius
Avtor Best Answer

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

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

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

Prijavi
Related Posts Odgovori Prikazi Aktivnost
[Odoo 8.0 - apache2] How to configure a proxy from an url to a specific database, in a multi-database setup ? Solved
apache2 odooV8
Avatar
Avatar
12
nov. 23
18723
Odoo on different URL Path
apache2 odooV8
Avatar
0
maj 15
5464
Odoo Apache2 SSL connection Glitch
ssl apache2 odooV8
Avatar
Avatar
1
apr. 16
6161
Why SSL Subdomain dbfilter not working ? Solved
database ssl db_filter subdomain
Avatar
Avatar
2
nov. 19
8617
How to access database with sub subdomain in odoo? Solved
nginx db_filter hosting odooV8
Avatar
Avatar
1
jan. 16
10184
Community
  • Tutorials
  • Dokumentacija
  • Forum
Open Source
  • Prenesi
  • Github
  • Runbot
  • Prevodi
Services
  • Odoo.sh Hosting
  • Podpora
  • Nadgradnja
  • Custom Developments
  • Izobraževanje
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Sredstva blagovne znamke
  • Kontakt
  • Zaposlitve
  • Dogodki
  • Podcast
  • Blog
  • Stranke
  • Pravno • Zasebnost
  • Varnost
الْعَرَبيّة 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