Se rendre au contenu
Odoo Menu
  • Se connecter
  • Essai gratuit
  • Applications
    Finance
    • Comptabilité
    • Facturation
    • Notes de frais
    • Feuilles de calcul (BI)
    • Documents
    • Signature
    Ventes
    • CRM
    • Ventes
    • PdV Boutique
    • PdV Restaurant
    • Abonnements
    • Location
    Sites web
    • Site Web
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Chaîne d'approvisionnement
    • Inventaire
    • Fabrication
    • PLM
    • Achats
    • Maintenance
    • Qualité
    Ressources Humaines
    • Employés
    • Recrutement
    • Congés
    • Évaluations
    • Recommandations
    • Parc automobile
    Marketing
    • Marketing Social
    • E-mail Marketing
    • SMS Marketing
    • Événements
    • Marketing Automation
    • Sondages
    Services
    • Projet
    • Feuilles de temps
    • Services sur Site
    • Assistance
    • Planification
    • Rendez-vous
    Productivité
    • Discussion
    • Validations
    • Internet des Objets
    • VoIP
    • Connaissances
    • WhatsApp
    Applications tierces Odoo Studio Plateforme Cloud d'Odoo
  • Industries
    Commerce de détail
    • Librairie
    • Magasin de vêtements
    • Magasin de meubles
    • Épicerie
    • Quincaillerie
    • Magasin de jouets
    Food & Hospitality
    • Bar et Pub
    • Restaurant
    • Fast-food
    • Maison d’hôtes
    • Distributeur de boissons
    • Hôtel
    Immobilier
    • Agence immobilière
    • Cabinet d'architecture
    • Construction
    • Gestion immobilière
    • Jardinage
    • Association de copropriétaires
    Consultance
    • Cabinet d'expertise comptable
    • Partenaire Odoo
    • Agence Marketing
    • Cabinet d'avocats
    • Aquisition de talents
    • Audit & Certification
    Fabrication
    • Textile
    • Métal
    • Meubles
    • Alimentation
    • Brewery
    • Cadeaux d'entreprise
    Santé & Fitness
    • Club de sports
    • Opticien
    • Salle de fitness
    • Praticiens bien-être
    • Pharmacie
    • Salon de coiffure
    Trades
    • Bricoleur
    • Matériel informatique et support
    • Systèmes photovoltaïques
    • Cordonnier
    • Services de nettoyage
    • Services CVC
    Autres
    • Organisation à but non lucratif
    • Agence environnementale
    • Location de panneaux d'affichage
    • Photographie
    • Leasing de vélos
    • Revendeur de logiciel
    Browse all Industries
  • Communauté
    Apprenez
    • Tutoriels
    • Documentation
    • Certifications
    • Formation
    • Blog
    • Podcast
    Renforcer l'éducation
    • Programme éducatif
    • Business Game Scale-Up!
    • Rendez-nous visite
    Obtenir le logiciel
    • Téléchargement
    • Comparez les éditions
    • Versions
    Collaborer
    • Github
    • Forum
    • Événements
    • Traductions
    • Devenez partenaire
    • Services for Partners
    • Enregistrer votre cabinet comptable
    Nos Services
    • Trouver un partenaire
    • Trouver un comptable
    • Rencontrer un conseiller
    • Services de mise en œuvre
    • Références clients
    • Assistance
    • Mises à niveau
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obtenir une démonstration
  • Tarification
  • Aide

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

  • CRM
  • e-Commerce
  • Comptabilité
  • Inventaire
  • PoS
  • Projet
  • MRP
All apps
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Aide

How to set database filter on sub domain for odoo website using apache web server

S'inscrire

Recevez une notification lorsqu'il y a de l'activité sur ce poste

Cette question a été signalée
17 Réponses
25552 Vues
Avatar
Anil Kesariya

Hello Everyone,

Is it possible to filter database on single instance by defining server alias in apache configuration file?

I can achieve this by creating multiple sites configuration files and running multiple instance of opnerp server.

But I want that to be done by runnning single openerp instance. If anyone has idea regarding this will be appreciated.

Thank you.

Anil.

 

 

 

 

6
Avatar
Ignorer
Anil Kesariya
Auteur

Hi Anil, I assume that you have created the databases x2 already right? -- http://opensourceholic.com/2014/05/09/deploy-openerp-using-mod_proxy-and-mod_wsgi-on-linux-server/ The page above looks sound.. But haven't tested !!but i see??. v7: group.add_option("--db-filter", dest="dbfilter", default='.*', v8 / v9alpha: group.add_option("--db-filter", dest="dbfilter", my_default='.*', So Check versions, and wsgi config and other configs. and clearly the dB's need to be created first... Good Luck

Anil Kesariya
Auteur

@vee I already have more than two database. I don't want to config the openerp with wsgi. I have applied the filter pattern inside the config.py file. thanks for your comment.

Avatar
swapnil wagh
Meilleure réponse

Hi Anil,
 

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.

You can read a blog post for more information : http://goo.gl/1Ub8sc

7
Avatar
Ignorer
Anil Kesariya
Auteur

Hello Swapnil Thank I appreciate response. I have followed your step but couldn't achieved my requirements. Its redirect me to create new database page in any domain.

Anil Kesariya
Auteur

@vee I already have more than two database. I don't want to config the openerp with wsgi. I have applied the filter pattern inside the config.py file. thanks for your comment.

swapnil wagh

@Anil Can you give me some more details for better understanding your issue, Are you working on local machine? Can you share your Apache configuration and openerp configuration?

Anil Kesariya
Auteur

@Swapnil Yes I am working on local machine. I have gone through all the step you mention. I can login through applied domain on virtual host. only remaining portion is to set sub domain for database.

swapnil wagh

@Anil, did you create two entries like 127.0.0.1 foo.localhost 127.0.0.1 bar.localhost replace foo and bar with your two database names, on local you can't use serverAlise for subdomain, use foo.localhost.com as servername then change db-filter in openerp/tools/config.py to %d. It should work I personally when I deploy openerp.

Anil Kesariya
Auteur

@sapanil. Previously i used server alias for sub domain. I replaced with the specific subdomain. still having same screen of manage database.

OdooBot
@Anil,

Do you really have a database on server please check the db user might be you have db but the owner is different than what you have in openerp config, odoo redirect you to database manager page only when you don't have db single db created on server.

On Wed, Oct 15, 2014 at 11:03 AM, Anil Kesariya <a.kesariya.serpentcs@mail.odoo.com> wrote:

@sapanil. Previously i used server alias for sub domain. I replaced with the specific subdomain. still having same screen of manage database.

--
Anil Kesariya
Sent by Odoo Inc. using Odoo about Forum Post False

Anil Kesariya
Auteur

@swapnil I am not using service file to start openerp server. my openerp server is running manually.

Anil Kesariya
Auteur

@swapnil I have gone through the main db filter method which is defined in openerp/http.py . In that method it using the httprequest.environ.get('HTTPHOST', '').split(':')[0] which should return the domain passed on browser. instead domain i am getting the ip address 127.0.0.1 and this value is manipulated get database. instead i modified the method and applied HTTP_X_FORWARDED_HOST instead HTTP_HOST h = httprequest.environ.get('HTTP_X_FORWARDED_HOST', '').split(':')[0] than it returns me the exact domain name eg. subdomain.localhost.com so it filter the correct data and return the filtered database list and works well. is it correct method to modified the code of odoo? or am I forgot anything to configure?

swapnil wagh

@Anil What you did is also ok, but when we use %d for db-filter in configuration it works, but as its filter the database it matches the subdoamin means if you have db like anil1 , anil2 and odoo and you use anil.domain.com it will show both db starts with anil except odoo in dropdown. So what you did is correct to get out from this issue. If you need any help from me I can help you to solve your subdomain issue.

Anil Kesariya
Auteur

Thanks sure.

Avatar
Sarl
Meilleure réponse

Hi all,

May be this help you.

We find a solution for use %h and subdomain, create your db in replace '.' by '-'.

Example : for the domaine erp.pharmacy.com, create db erp-pharmacy-com

And in your file .conf, at line dbfilter, write this : dbfilter = %h

Works for Odoo v8

2
Avatar
Ignorer
Avatar
abraham
Meilleure réponse

Header add X-ODOO_DBILTER "db-name"

RequestHeader add X-ODOO_DBFILTER "db-name"

please add these in apache2 configuration file to filter database

0
Avatar
Ignorer
Avatar
Shivam Mahajan
Meilleure réponse

Can you please    tell me how to configure multi domains foe multi companies in odoo9.........the help would be appreciated

0
Avatar
Ignorer
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !

Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !

S'inscrire
Communauté
  • Tutoriels
  • Documentation
  • Forum
Open Source
  • Téléchargement
  • Github
  • Runbot
  • Traductions
Services
  • Hébergement Odoo.sh
  • Assistance
  • Migration
  • Développements personnalisés
  • Éducation
  • Trouver un comptable
  • Trouver un partenaire
  • Devenez partenaire
À propos
  • Notre société
  • Actifs de la marque
  • Contactez-nous
  • Emplois
  • Événements
  • Podcast
  • Blog
  • Clients
  • Informations légales • Confidentialité
  • Sécurité.
الْعَرَبيّة 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 est une suite d'applications open source couvrant tous les besoins de votre entreprise : CRM, eCommerce, Comptabilité, Inventaire, Point de Vente, Gestion de Projet, etc.

Le positionnement unique d'Odoo est d'être à la fois très facile à utiliser et totalement intégré.

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