Community mailing list archives

community@mail.odoo.com

Re: Redirect domain to odoo database

by
Meng Choon Tan
- 04/21/2015 03:27:48
Hi there, 

You can to set up Odoo as a proxy service and redirect the webserver request accordingly based on the specific domain.

For eg, we are running a multi-database instance Odoo using Apache and have setup the apache config this way:


<VirtualHost *:80>

    ServerName www.companydomain.com.sg

    #ServerAlias www. companydomain.com.sg

    #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://127.0.0.1:9000/

    ProxyPassReverse / 127.0.0.1:9000/

    ProxyVia On

    LogLevel warn

</VirtualHost>

 
At the Odoo end, we set up a odoo-server service using the following configuration:

>> /etc/init.d/odoo-server

#!/bin/sh

### BEGIN INIT INFO

# Provides: $OE_CONFIG

# Required-Start: $remote_fs $syslog

# Required-Stop: $remote_fs $syslog

# Should-Start: $network

# Should-Stop: $network

# Default-Start: 2 3 4 5

# Default-Stop: 0 1 6

# Short-Description: Enterprise Business Applications

# Description: ODOO Business Applications

### END INIT INFO

PATH=/bin:/sbin:/usr/bin

DAEMON=/opt/odoo/odoo-server/openerp-server

NAME=odoo-server-customername

DESC=odoo-server


# Specify the user name (Default: odoo).

USER=odoo


# Specify an alternate config file (Default: /etc/openerp-server.conf).

CONFIGFILE="/etc/odoo-server.conf"


# pidfile

PIDFILE=/var/run/$NAME.pid


# Additional options that are passed to the Daemon.

DAEMON_OPTS="--debug --db-filter=CUST-DB1 --no-database-list --xmlrpc-port=9000 --proxy --log-level=info -c $CONFIGFILE"


.....





-- Meng Choon

mobile : +65-91895981
email  : mengchoon.tan@dapoltd.com
web    : http://augury.dapoltd.com
cen    : 201201013M
support: support@dapoltd.com | +65-91851968


On Tue, Apr 21, 2015 at 5:17 AM, V. Imsand <v.imsand@aeschimann.ch> wrote:

Hi,


best way would be to use a reverse proxy (I would recommend nginx) and define a xmlrpc-server port per database an define in nginx which domain is pointing wo which port…

Not sure, if there is an easier way… but this will be a valid solution…

Regards,
Valentin


Am 20.04.2015 um 21:57 schrieb Gastón Pablo Pérez <gpperez@gmail.com>:

Hi!

How can I redirect a specific domain to specific odoo database in a server? I have one server with one odoo instance and several databases, so I want to redirect diferent domains to diferent databases and quit the database selector

thanks in advance

greetings!

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe


_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe