Multidomain im Odoo/Flectra Server

dbfilter

Odoo/Flectra ist ein mandantenfähiges System: Ein einzelnes Odoo/Flectra-System kann eine Reihe von Datenbankinstanzen ausführen und bedienen. Es ist auch in hohem Maße anpassbar, wobei Anpassungen (beginnend mit den geladenen Modulen) von der “aktuellen Datenbank” abhängen.

Für nicht angemeldete Benutzer (Portal, Website) - die nicht an eine Datenbank gebunden sind - muss Odoo/Flectra wissen, welche Datenbank zum Laden der Website-Seite oder Ausführen des Vorgangs verwendet werden soll. Wenn keine Mandantenfähigkeit verwendet wird, ist dies kein Problem. Es kann nur eine Datenbank verwendet werden. Wenn jedoch auf mehrere Datenbanken zugegriffen werden kann, benötigt Odoo/Flectra eine Regel, um zu wissen, welche Datenbank verwendet werden soll.

https://www.odoo.com/documentation/10.0/setup/deploy.html

Konfiguration

Bildschirmfoto%20von%202019-11-04%2022-29-04

Bildschirmfoto%20von%202019-11-04%2022-07-12

nano /etc/hosts

lsof -i:80

nano /etc/nginx/sites-enabled/pointofsale.global

server {
listen 80;
server_name pointofsale.pointofsale.global;

root /var/www/html;
index  index.php index.html index.htm index.nginx-debian.html;

client_max_body_size 100M;

location /.well-known {
    alias /var/www/letsencrypt/.well-known;
}
    
    proxy_read_timeout 720s;
    proxy_connect_timeout 720s;
    proxy_send_timeout 720s;
   
    # Add Headers for proxy mode
    proxy_set_header X-Forwarded-Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Real-IP $remote_addr;
  
    # Redirect requests to pointofsaleHOST backend server
   location / {
            proxy_redirect off;
            proxy_pass http://pointofsale.pointofsale.global:7073;
            }
    
    location /longpolling {
            proxy_pass http://pointofsale.pointofsale.global:7072;
    }
   
    # common gzip
    gzip_types text/css text/less text/plain text/xml application/xml application/json > application/javascript;
   gzip on;

}

nano /etc/flectra/flectra.conf

list_db = false
dbfilter = ^%d$

Weitere Domains aufschalten

1) Eine Datenbank anlegen. Zum Beispiel: “cyprusdetox”.

nano /etc/flectra/flectra.conf

list_db = true
dbfilter = .*

https://pointofsale.global/web/database/manager

2) Eine Nginx Webserverdatei anlegen:

nano /etc/nginx/sites-enabled/cyprusdetox.com

server {
listen 80;
server_name cyprusdetox.cyprusdetox.com;

root /var/www/html;
index index.php index.html index.htm index.nginx-debian.html;

client_max_body_size 100M;

location /.well-known {
alias /var/www/letsencrypt/.well-known;
}

   proxy_read_timeout 720s;
   proxy_connect_timeout 720s;
   proxy_send_timeout 720s;

   # Add Headers for proxy mode
   proxy_set_header X-Forwarded-Host $host;
   proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
   proxy_set_header X-Forwarded-Proto $scheme;
   proxy_set_header X-Real-IP $remote_addr;

   # Redirect requests to pointofsaleHOST backend server
   location / {
           proxy_redirect off;
           proxy_pass http://cyprusdetox.cyprusdetox.com:7073;
           }

   location /longpolling {
           proxy_pass http://cyprusdetox.cyprusdetox.com:7072;
   }

   # common gzip
   gzip_types text/css text/less text/plain text/xml application/xml application/json application/javascript;
    gzip on;

}

/etc/init.d/nginx restart

https://cyprusdetox.com/web/login

Einloggen und den Website-Builder installieren.

In den Produktionsmodus zurückstellen:

nano /etc/flectra/flectra.conf

list_db = false
dbfilter = ^%d$

/etc/init.d/flectra restart

https://cyprusdetox.com/

That’s it. Have fun. :slight_smile: