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?git,?pip?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.pswp.cn/news/279741.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/279741.shtml
英文地址,請注明出處:http://en.pswp.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;…

yum搭建本地倉庫、國內源、下載rpm包、源碼安裝

yum搭建本地倉庫[rootlocalhost ~]# mount /dev/cdrom /mnt/mount: /dev/sr0 寫保護&#xff0c;將以只讀方式掛載cp -r /etc/yum.repos.d /etc/yum.repos.d.bak[rootlocalhost ~]# cp -r /etc/yum.repos.d/ /etc/yum.repos.d.ori/ //復制rm -f /etc/yum.repos.d/*[rootlocalh…

如何在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. 頁眉和頁腳對于在…

python基礎知識-8-三元和一行代碼(推導式)

python其他知識目錄 1、三元運算&#xff08;三目運算&#xff09; 三元運算符就是在賦值變量的時候&#xff0c;可以直接加判斷&#xff0c;然后賦值格式&#xff1a;[on_true] if [expression] else [on_false]res 值1 if 條件 else 值2 其他語言類似結構&#xff1a;判段的…

雙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…

JmsTemplate sendAndReceive 設置超時

通過調用sendAndReceive方法&#xff0c;實現發送消息之后可以同步接收返回信息。 Message replyMsg this.jmsQueueTemplate.sendAndReceive(new MessageCreator(){Overridepublic Message createMessage(Session sn) throws JMSException {TextMessage txtMsg sn.createText…

亞信科技數據庫AntDB通過金融分布式事務數據庫標準測試

近日,南京, 中國信息通信研究院云計算與大數據研究所(以下簡稱“中國信通院云大所”)組織專家對亞信科技(股票代碼:01675.HK)的數據庫產品AISWare AntDB(以下簡稱“AntDB”),進行了金融分布式事務數據庫標準測試,所有功能順利通過測試。該測試的通過充分彰顯了亞信科技AntDB是一…

安裝sql2012 需要安裝net3.5 沒有的話 安裝不成功

Error while enabling Windows feature : NetFx3, Error Code : -2146498298 在 Windows 8 或 Windows Server 2012 中安裝 .NET Framework 3.5 時出現錯誤代碼&#xff1a;0x800F0906 winx 管理員權限 打開cmd命令提示符處&#xff0c;運行下面的命令&#xff1a; Dism /onl…

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;但是通過簡單的調整&…

php 面向對象

1類的創建 class創建類 class Person{} 2.對象的創建 使用new關鍵字 class Person{} $p1new Person 3.成員的添加 添加成員需要 三個修飾符 public 公開的 定義公共的屬性和方法&#xff0c;類的外部&#xff0c;類的內部&#xff0c;子類都可以使用 protected 受保護的 定義…

apache 404\403錯誤頁面跳轉

1、全局下使用404跳轉 在httpd.conf下配置跳轉 1vim /usr/local/httpd/conf/httpd.conf 123456<Directory "/usr/local/httpd-2.4.25/htdocs"> AllowOverride None Require all granted ErrorDocument 404 /aa.jpg #配置跳轉頁面&#xff0c;注意aa文件必須在…

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;您正在瀏…

ThreadLocal源碼剖析

。。轉載于:https://www.cnblogs.com/Joy-Hu/p/10677434.html