打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
Install Odoo 8 on CentOS 7

on

In this article, we will go through the installation of Odoo 8 on CentOS 7 machine. We will create a Python virtual environment and use the Odoo source code from Github.

Install and configure PostgreSQL 9.3

First of all, we need to install PostgreSQL. We'll install PostgreSQL version 9.3 from the official PostgreSQL repository.

rpm -Uvh http://yum.postgresql.org/9.3/redhat/rhel-7-x86_64/pgdg-centos93-9.3-1.noarch.rpm  yum -y install postgresql93 postgresql93-server postgresql93-devel --disablerepo=* --enablerepo=pgdg93  

After installing the packages, we'll initialize the database, enable the service on boot and start the PostgreSQL server.

/usr/pgsql-9.3/bin/postgresql93-setup initdbsystemctl enable postgresql-9.3.service  systemctl start postgresql-9.3  

The following command will create a new PostgreSQL user named odoo:

su - postgres -c "createuser -s odoo" 2> /dev/null || true  

Install all nessesary packages

We need the development tools installed:

yum -y groupinstall "Development tools"  

Next, we'll install a few dependencies:

yum -y install zlib-devel bzip2-devel openssl openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel libpcap-devel xz-devel git libpng libjpeg libXext curl xorg-x11-font-utils fontconfig python-virtualenv libevent-devel libxml2-devel libxslt-devel openldap-devel openjpeg-devel freetype-devel libjpeg-turbo-devel libtiff-devel kernel-devel  

Enable EPEL Repository:

wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm  rpm -ivh epel-release-7-5.noarch.rpm  

To be able to print documents in Odoo we'll need the wkhtmltopdf package, which is available in the EPEL repository.

To install wkhtmltopdf run the following command:

yum --enablerepo=epel install wkhtmltopdf  

We'll install Python packages with pip, so let's install pip from the EPEL repository:

yum --enablerepo=epel install python-pip  

Clone Odoo 8 from GitHub

We are going to clone the Odoo 8 repository from GitHub to the /opt/odoo directory.

git clone --branch 8.0 https://www.github.com/odoo/odoo /opt/odoo  

Later, if you want to update your Odoo repository to the latest version just run git pull.

Create a virtual environment for Odoo

Create a new system user named odoo, change the owner ship of the /opt/odoo directory to odoo user and group and switch to it, using the following commands:

useradd odoo  chown -R odoo: /opt/odoo  su - odoo  

Now we'll create a virtual environment and install all necessary packages from the requirements.txt file:

/bin/virtualenv odoosource odoo/bin/activate  PATH=$PATH:/usr/pgsql-9.3/bin  pip install -r /opt/odoo/requirements.txt  exit  

The installation will take a few minutes so go grab a coffee.

Create configuration file and systemctl service

Next, we'll create a basic configuration file and systemctl service for our Odoo instance.

cat > /etc/odoo-server.conf << EOF  [options]admin_passwd = admin  db_host = False  db_port = False  db_user = odoo  db_password = False  addons_path = /opt/odoo/addons  without-demo=all  no-xmlrpc = True  no-xmlrpcs = True  no-netrpc = True  log_db = False  log_handler = ['[\'["[\\\':INFO\\\']"]\']']  log_level = info  logfile = False  login_message = False  logrotate = True  syslog = False  EOF  
cat > /usr/lib/systemd/system/odoo.service << EOF  [Unit]Description=Odoo 8.0 ERP and CRM server  After=postgresql-9.3.service[Service]Type=simple  User=odoo  Group=odoo  ExecStart=/home/odoo/odoo/bin/python /opt/odoo/openerp-server --config=/etc/odoo-server.conf[Install]WantedBy=multi-user.target  EOF  

You can use the following command to view Odoo log: journalctl -f -u odoo.

Final steps

We also need to open port 8069 in our firewall:

firewall-cmd --zone=pubic --add-port=8069/tcp --permanent  firewall-cmd --reload  

Finally, we'll enable Odoo on boot and start the service:

systemctl enable odoo.service  systemctl start odoo  

That's it, Odoo installation is complete. To open Odoo, point your browser at: http://<ip_address>:8069

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
CentOS 7安装Odoo 15社区版的详细操作指南
CentOS 7上搭建Zabbix4.0
IP地址管理工具
Centos7安装部署RabbitMQ及配置
CentOS 6.9/7通过yum安装指定版本的Redis
centos 7 搭建wordpress 网站详细教程
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服