Install Odoo 11 on CentOS 7

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

Odoo is the most popular all-in-one business software in the world. It offers a range of business applications including CRM, website, e-Commerce, billing, accounting, manufacturing, warehouse, project management, inventory and much more, all seamlessly integrated.

Odoo 11 requires Python 3.5 which is not available in the CentOS repositories. Because of that, we cannot install the Odoo package via yum from the Odoo repository.

We either run Odoo in a docker container or install it in a Python virtual environment.

In this tutorial, we’ll walk you through how to install Odoo 11 using Git source and Python virtual environment on a CentOS 7 machine.

Before you begin

Log in to you CentOS machine as a sudo user and update the system to the latest packages:

sudo yum update

Enable the EPEL repository by typing:

sudo yum install epel-release

We will install Python 3.5 packages from the Software Collections (SCL) repository.

By enabling SCL you will gain access to the newer versions of programming languages and services which are not available in the core repositories. Enable the SCL repository with the following command:

sudo yum install centos-release-scl

Install Python 3.5 packages, with the following command:

sudo yum install rh-python35

Finally install gitpip and all the tools required to build Odoo dependencies:

sudo yum install git gcc wget nodejs-less libxslt-devel bzip2-devel openldap-devel libjpeg-devel freetype-devel postgresql-devel

Create Odoo user

Create a new system user and group with home directory /opt/odoo that will run the Odoo service:

sudo useradd -m -U -r -d /opt/odoo -s /bin/bash odoo

You can name the user whatever you like, just make sure you create a PostgreSQL user with the same name.

Install and configure PostgreSQL

Install the PostgreSQL server and create a new PostgreSQL database cluster:

sudo yum install postgresql-serversudo postgresql-setup initdb

Once the installation is completed, enable and start the PostgreSQL service:

sudo systemctl enable postgresqlsudo systemctl start postgresql

Create a PostgreSQL user with the same name as the previously created system user, in our case odoo:

sudo su - postgres -c "createuser -s odoo"

Install Wkhtmltopdf

The wkhtmltox package provides a set of open source command line tools which can render HTML into PDF and various image formats. In order to print PDF reports, you will need the wkhtmltopdf tool. The recommended version for Odoo is 0.12.1 which is not available in the official CentOS 7 repositories.

To download and install the recommended version run the following commands:

wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.1/wkhtmltox-0.12.1_linux-centos7-amd64.rpmsudo yum localinstall wkhtmltox-0.12.1_linux-centos7-amd64.rpm

Install and configure Odoo 11

We will install Odoo from the GitHub repository so we can have more control over versions and updates. We will also use virtualenv which is a tool to create isolated Python environments.

Before starting with the installation process, make sure you switch to the odoo user.

sudo su - odoo

To confirm that you are logged-in as odoo user you can use the following command:

whoami

Now we can start with the installation process, first clone the odoo from the GitHub repository:

git clone https://www.github.com/odoo/odoo --depth 1 --branch 11.0 /opt/odoo/odoo11

Enable software collections so we can access the python 3.5 binaries:

scl enable rh-python35 bash

Create a new virtual environment for our Odoo installation with:

cd /opt/odoopython3 -m venv odoo11-venv

activate the environment:

source odoo11-venv/bin/activate

and install all required Python modules:

pip3 install -r odoo11/requirements.txt

If you encounter any compilation errors during the installation, make sure that you installed all of the required dependencies listed in the Before you begin section.

Once the installation is completed deactivate the environment and switch back to your sudo user using the following commands:

deactivate
exit

If you plan to install custom modules it is best to install those modules in a separate directory. To create a new directory for the custom modules run:

sudo mkdir /opt/odoo/odoo11-custom-addonssudo chown odoo: /opt/odoo/odoo11-custom-addons

Next, we need to create a configuration file:

/etc/odoo11.conf

[options]
; This is the password that allows database operations:
admin_passwd = superadmin_passwd
db_host = False
db_port = False
db_user = odoo
db_password = False
addons_path = /opt/odoo/odoo11/addons
; If you are using custom modules
; addons_path = /opt/odoo/odoo11/addons,/opt/odoo/odoo11-custom-addons

Do not forget to change the superadmin_passwd to something more secure and adjust the addons_pathif you’re using custom modules.

Create a systemd unit file

To run odoo as a service we will create a odoo11.service unit file in the /etc/systemd/system/directory with the following contents:

/etc/systemd/system/odoo11.service

[Unit]
Description=Odoo11
Requires=postgresql.service
After=network.target postgresql.service[Service]
Type=simple
SyslogIdentifier=odoo11
PermissionsStartOnly=true
User=odoo
Group=odoo
ExecStart=/usr/bin/scl enable rh-python35 -- /opt/odoo/odoo11-venv/bin/python3 /opt/odoo/odoo11/odoo-bin -c /etc/odoo11.conf
StandardOutput=journal+console[Install]
WantedBy=multi-user.target

Notify systemd that we have created a new unit file and start the Odoo service by executing:

sudo systemctl daemon-reloadsudo systemctl start odoo11

You can check the service status with the following command:

sudo systemctl status odoo11
● odoo11.service - Odoo11Loaded: loaded (/etc/systemd/system/odoo11.service; disabled; vendor preset: disabled)Active: active (running) since Wed 2018-03-28 20:13:30 UTC; 6s agoMain PID: 16174 (scl)CGroup: /system.slice/odoo11.service├─16174 /usr/bin/scl enable rh-python35 -- /opt/odoo/odoo11-venv/bin/python3 /opt/odoo/odoo11/odoo-bin -c /etc/odoo11.conf├─16175 /bin/bash /var/tmp/sclihoNjg└─16178 /opt/odoo/odoo11-venv/bin/python3 /opt/odoo/odoo11/odoo-bin -c /etc/odoo11.conf

and if there are no errors you can enable the Odoo service to be automatically started at boot time:

sudo systemctl enable odoo11

If you want to see the messages logged by the Odoo service you can use the command below:

sudo journalctl -u odoo11

Test the Installation

Open your browser and type: http://<your_domain_or_IP_address>:8069

Assuming the installation is successful, a screen similar to the following will appear:

If you can’t access the page then probably your firewall is blocking port 8069.

Conclusion

This tutorial walked you through the installation of Odoo 11 on CentOS 7 in a Python virtual environment.

You may also want to check our tutorial about how to create automatic daily backups of your Odoo databases.

If you hit a problem or have feedback, leave a comment below.

也可以参考这里:https://alanhou.org/centos-7-odoo-11/

转载于:https://my.oschina.net/ethanleellj/blog/3033320

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/279741.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

创建maven项目,配置maven地址

2019独角兽企业重金招聘Python工程师标准>>> 在eclipse中&#xff0c;新建maven项目next第二步&#xff0c;选择webapp输入id及包名&#xff0c;完成新建给项目build path&#xff0c;添加1.8版本jdk和tomcat项目右键属性 project Facets&#xff0c;切换成web项目&…

如何在Excel中隐藏单元格,行和列

There may be times when you want to hide information in certain cells or hide entire rows or columns in an Excel worksheet. Maybe you have some extra data you reference in other cells that does not need to be visible. 有时您可能想在某些单元格中隐藏信息或在…

金三银四,跳槽为敬

不是不想跳&#xff0c;是如今的市场水冷&#xff0c;挪不开脚。 三月有“黄金”。 过去很多年&#xff0c;这个被誉为市场黄金期的阶段&#xff0c;最热闹的旗帜属于房地产&#xff0c;其次是人才市场。跳槽二字&#xff0c;充满诱惑。对每一个想要改变的人而言&#xff0c;…

如何在Word文档中添加页眉或页脚

Headers and footers are useful for adding things such as page numbers, dates, file names, and disclaimers to documents. Word allows you to add headers and footers with built-in, ready-made layouts or add your own custom headers and footers. 页眉和页脚对于在…

双11成交多少和我无关,但这个魔性MV真的让我笑喷!

今年天猫双11&#xff0c;印象最深的就是“祝你双11快乐”这句话&#xff01;它让大家感觉到双11不再只是一个购物节&#xff0c;而是一个能引起广泛共鸣、让大家有快乐情感的真正节日。以往的传统节日&#xff0c;都有一个标志性的符号&#xff0c;正如脑海中的每年春晚&#…

ios beta 下载_如何回滚到iOS 10(如果您使用的是iOS 11 Beta)

ios beta 下载So you’ve installed the iOS 11 beta and, well, you don’t love it. No problem, because you can roll right back to iOS 10. 因此&#xff0c;您已经安装了iOS 11 Beta &#xff0c;但是&#xff0c;您不喜欢它。 没问题&#xff0c;因为您可以直接回滚到i…

instagram发布工具_如何在不发布照片的情况下保存已编辑的Instagram照片

instagram发布工具Unfortunately, there’s no built-in method for saving your edited Instagram photos without posting them first. However, with this neat trick, you can add Instagram filters to your photos and save them locally to your phone without actually…

Verify the Developer App certificate for your account is trusted on your device.

1、报错内容 Could not launch “CH5203” Verify the Developer App certificate for your account is trusted on your device. Open Settings on 测试 and navigate to General -> Device Management, then select your Developer App certificate to trust it. 2、解决方…

HTTP2和HTTPS来不来了解一下?

一、前言 只有光头才能变强 HTTP博文回顾&#xff1a; PC端&#xff1a;HTTP就是这么简单PC端&#xff1a;HTTP面试题都在这里微信公众号端&#xff1a;HTTP就是这么简单微信公众号端&#xff1a;HTTP面试题都在这里本文力求简单讲清每个知识点&#xff0c;希望大家看完能有所收…

apple默认备份位置_如何将Apple Maps默认设置为步行路线

apple默认备份位置The default mode of transportation in Apple Maps is set to driving, but with a simple tweak, you can adjust your Apple Maps experience to default to the mode you use most. Apple Maps中的默认交通方式设置为行车&#xff0c;但是通过简单的调整&…

JS实现千分位

方法一&#xff1a;正则实现 function format (num) { var reg/\d{1,3}(?(\d{3})$)/g; return (num ).replace(reg, $&,); } 解释&#xff1a; 1、正则表达式 \d{1,3}(?(\d{3})$) 表示前面有1~3个数字&#xff0c;后面的至少由一组3个数字结尾 2、?表示正向引用&…

白色裤子为什么会沾上蓝色_什么是蓝色的,为什么它可以在Mac上运行?

白色裤子为什么会沾上蓝色You’re looking through Activity Monitor when you notice a process called blued. Should you be worried that this is running? No: it’s the process that powers Bluetooth on your Mac. 当您发现一个名为blued的进程时&#xff0c;您正在浏…

Linux移植之内核启动过程引导阶段分析

在Linux移植之make uImage编译过程分析中已经提到了uImage是一个压缩的包并且内含压缩程序&#xff0c;可以进行自解压。自解压完成之后内核代码从物理地址为0x30008000处开始运行。下面分析在进入C之前内核做的一些工作&#xff0c;以下是内核启动过程中打印出来的信息&#x…

outlook附件大小限制_如何在Outlook中调整大图片附件的大小

outlook附件大小限制When you have to send someone a large image file through email, it’s a good idea to resize the image file to make it smaller before sending it. Outlook makes this easy and allows you to resize the image file as it’s sent. 当您必须通过电…

西湖论剑WP

先水几句&#xff0c;这次的题确实难啊&#xff0c;动用洪荒之力了&#xff0c;第一名的神仙也没有全部做完。 官方说这次的题目有两道没被做出来&#xff0c;我猜应该是PWN和RE吧 本来我们是45名的&#xff0c;最后5分钟那帮人啊&#xff0c;硬生生给我们挤出前50&#xff0c;…

vm macos 启用3d_如何在macOS中启用夜班以减轻眼睛疲劳

vm macos 启用3dNight Shift is a new feature introduced in macOS Sierra 10.12.4, and you might already be familiar with it if you’re an iOS user. Here’s how to enable it and set it up on your Mac. Night Shift是macOS Sierra 10.12.4中引入的新功能&#xff0c…

如何在Windows 7、8、10,Vista或XP中删除Windows服务

If you are a fan of tweaking your system and disabling services, you might find that over time your Windows Services list becomes large and unwieldy. It’s easy enough to delete a Windows service using the Command Prompt. 如果您喜欢调整系统并禁用服务&#…

缩点(有向图的强连通分量)学习笔记

缩点(有向图的强连通分量)学习笔记 1.什么是强连通分量&#xff1f;&#xff1a; 有向图强连通分量:在有向图G中&#xff0c;如果两个顶点vi,vj间(vi>vj)有一条从vi到vj的有向路径&#xff0c;同时还有一条从vj到vi的有向路径&#xff0c;则称两个顶点强连通(strongly conne…

mysql多表联合删除

文件一&#xff1a;01.txt文件二&#xff1a;02.txt登录mysql选择数据库表user结构表user_depart结构导入数据到表user导入数据到表user_depart联合删除查看删除后user表的数据查看删除后user_depart表的数据本文转自 Lee_吉 51CTO博客&#xff0c;原文链接:http://blog.51cto.…

centos 初学者_初学者:如何在Outlook 2013中创建和管理任务

centos 初学者If you’re one of those people who has a whiteboard or notepad with an ever-evolving to-do list, or your desk and monitors are adorned with Post-its reminding you of important events, then this the article for you. 如果您是拥有不断发展的待办事…