- Odoo 11 Development Cookbook(Second Edition)
- Holger Brunn Alexandre Fayolle
- 214字
- 2021-06-25 22:48:34
How to do it...
To adapt the configuration file for production, you need to follow these steps:
- Create a new configuration file for production based on the development file:
$ cd ~/odoo-prod/project $ cp development.conf production.conf
- Edit the production configuration file production.conf.
- Change the addons path to match the production base directory:
addons_path = /home/odoo/odoo-prod/project/src/odoo/addons,
/home/odoo/odoo-prod/project/src/odoo/odoo/addons,
/home/odoo/odoo-prod/project/src/partner-contact
- Change the data directory:
data_dir = /home/odoo/odoo-prod/project/filestore
- Change the server log path to match the production base directory:
logfile = /home/odoo/odoo-prod/project/logs/odoo.log
- Configure log rotation:
logrotate = True
- Configure the logging handlers:
log_level = warn log_handler = :WARNING,werkzeug:CRITICAL,odoo.service.server:INFO
- Adapt the database connection parameters:
db_host = False db_maxconn = 64 db_name = odoo-project db_password = False db_port = False db_template = template1 db_user = False
- Configure the database filter, and disable database listing:
dbfilter = odoo-project$ list_db = False
- Change the master password using a random password generated with pwgen :
admin_password = use a random password
- Configure Odoo to run with workers:
workers = 4
# limit_memory_hard: 4GB limit_memory_hard = 4294967296
# limit_memory_soft: 640MB limit_memory_soft = 671088640 limit_request = 8192 limit_time_cpu = 120 limit_time_real = 300
- Only listen on the local network interface:
http_interface = 127.0.0.1
- Save the file, and add it to the Git repository:
$ git add production.conf $ git commit -m "add production configuration file"