Enable Dark Mode!
odoo-deployment.png
By: Ajmal JK

Basics of Odoo Deployment

Technical

After the installation of odoo, if one tries to implement it in the internet-facing server or production, he has to set up several configurations.


One can simply install odoo using the script by Yenthe. Visit this https://github.com/Yenthe666/InstallScript to know more about the installation. 


When using odoo in the server,  one has to also bother about the locations of odoo and the naming of odoo files. Always use ‘/odoo’, the path for addons. The configuration file and log file can be named like odoo-server.conf and odoo-server.log. If you have more than one odoo version, specify the names with by version. For example for Odoo V12 Community name like odoo-12-server.conf/ odoo-12-server.log and for Odoo V12 Enterprise name like odoo-enterprise-12-server.conf/odoo-enterprise-12-server.log and so.


When using odoo in the server if one needs to know about the conf file or addons path, he can use 

> ps  aux|grep odoo  or

> sudo service odoo status, to know about the running services.


odoo-deployment-cybrosys


Odoo Configuration File

The configuration parameters of odoo are specified in the configuration files, with  .conf extension.

Some of the parameters are, 


db_host = localhost / Specify the database host (default localhost).

db_port = 5432 / Specify the database port (default None).

db_user = odoo / Specify the database user name (default None).

db_password = 00aa9df39b0c99ac3d1d8412d2917175 /Specify the database password for db_user (default None).

db_template = template0 / CREATE DATABASE actually works by copying an existing database. By default, it copies the standard system database named template1.

admin_passwd = 12357 / Master Database password This is set at first boot and can be set from within Odoo.

db_maxconn = 64 / specify the maximum number of physical connections to posgresql.


dbfilter

A single Odoo system can contain a number of databases. So there exists no confusion when working as an internal user (logged in user) because he can manually select the database and use it. But in the case of a portal user (website or non-logged user), it is different, therefore, we need to configure which database to be displayed on the website and its processes. The option dbfilter is used for this purpose.


One should set up the dbfilter in the configuration file for production servers, as they have many databases working on the website. It is said so because the absence of dbfilter results in the non-functioning of many features in the database. 


Let’s check some examples of dbfilter.


If you need to list all databases, start with a particular name. You can set the dbfilter as a particular name.


Example: If we need to list all the databases starting with cybrosys, then can  set the dbfilter as, 

    dbfilter = cybrosys


odoo-deployment-cybrosys


If you only needed any database from a number of databases, you can give the database name with regular expression.

    dbfilter = ^database_name$


However, if needed the exact number of databases, you can give their name with or option, like 

    dbfilter = ^database_name1$| ^database_name2$


Also can set the dbfilter based on the subdomain and host.

    dbfilter = ^%h$   // Based on the host.


If set the hostname as dbfilter then the database name should be the same as the complete hostname. For example,  if the host is cybrosys.production.com then also the database name should be cybrosys.production.com.Only this database is visible to this request.

    dbfilter = ^%d$   // Based on the domain.


If the domain is set as the dbfilter and has a db named cybrosys then it is visible to the requests from cybrosys.production.com, www.cybrosy.testme.com, etc.


Log Settings

To track the log information of odoo, you have to set up a log file. The path of the log file can be given in the conf file by the ‘logfile’ key. Usually, in a server, it is placed in the /var/log folder.


logfile = /var/log/odoo/odoo-server.log


log_level = info

The different log levels are,


critical - A critical message - so critical that the module cannot work.

Error - Error message to report failed operations

Warning - Warning message to report minor issues.

Info - Information message to report the important modular event

debug - Debug message for debugging only.


log_handler :


log_handler = PREFIX:LEVEL

For example, if you want to have DEBUG level for module sale only, you can run it with parameter:

log_handler=odoo.addons.sale:DEBUG


To disable werkzeug logs,  add the following parameter:

log_handler =werkzeug:CRITICAL


To see all odoo log messages:

log_handler=odoo:DEBUG


To see all log messages (including ones from libs):

log_handler=:DEBUG


logrotate = True (True/False) - If True, create a daily log file and keep 30 files.


log-db = False (True/False) - If True, also write log to 'ir_logging' table in database.


syslog = False (True/False) - logs to the system's event logger: syslog


Service Settings


> interface = localhost - The IP address on which the server will bind. If empty, it will bind on all interfaces (default empty).

> port = 8069 - The TCP port on which the server will listen (default 8069)

> secure = False - Launch server over https instead of Http (default False).

> proxy_mode = True - Set to True if you are deploying your App behind a proxy.

> addons_path = /odoo/odoo-server,/odoo/custom/addons - specify the addons_path folders ordered by priority addons_path=/first/path/,/second/path/

> pidfile = False - The file where the server pid will be stored (default False). We are letting the init script create the pid

> timezone = False - Specify reference timezone for the server (e.g. Europe/Brussels)

> secure_cert_file = server.cert - specify the certificate file for the SSL connection.

> secure_pkey_file = server.pkey - Launch server over https instead of http (default False).

> xmlrpcs = True - Set to False to disable the XML-RPC Secure protocol

> xmlrpcs_interface = 127.0.0.1 - xmlrpcs_interface - Specify the TCP IP address for the XML-RPC Secure

> xmlrpcs_port = 8071 - Specify the TCP port for the XML-RPC Secure protocol.

    Note:  XML-RPC Secure Configuration (disabled if ssl is unavailable)

> longpolling_port = 8072 - TCP port for long-polling connections in multiprocessing or gevent mode, defaults to 8072. Not used in default (threaded) mode. Odoo’s messaging functionality not works without this on some servers.

> import_partial =True - Use this for big data importation, if it crashes you will be able to continue at the current state. Provide a filename to store intermediate importation states

> unaccent = False - Use the unaccent function provided by the database when available.

> translate_modules = ['all'] - specify modules to export. Use in combination with --i18n-export.

> server_wide_modules = None - Comma-separated list of server-wide modules, default=web

> csv_internal_sep = , - Separator for csv files

> data_dir = /odoo/.local/share/Odoo - Data directory where odoo store its data.


To be continued...



If you need any assistance in odoo, we are online, please chat with us.



0
Comments



Leave a comment



whatsapp
location

Calicut

Cybrosys Technologies Pvt. Ltd.
Neospace, Kinfra Techno Park
Kakkancherry, Calicut
Kerala, India - 673635

location

Kochi

Cybrosys Technologies Pvt. Ltd.
1st Floor, Thapasya Building,
Infopark, Kakkanad,
Kochi, India - 682030.

location

Bangalore

Cybrosys Techno Solutions
The Estate, 8th Floor,
Dickenson Road,
Bangalore, India - 560042

Send Us A Message