ubuntu下安装odoo

安装PostgreSQL及相关依赖:

sudo apt install git python-pip postgresql postgresql-server-dev-9.5 python-all-dev python-dev python-setuptools libxml2-dev libxslt1-dev libevent-dev libsasl2-dev libldap2-dev pkg-config libtiff5-dev libjpeg8-dev libjpeg-dev zlib1g-dev libfreetype6-dev liblcms2-dev liblcms2-utils libwebp-dev tcl8.6-dev tk8.6-dev python-tk libyaml-dev fontconfig

####创建数据库用户
sudo su - postgres
createuser www -U postgres

更改数据库连接认证

sudo vi /etc/postgresql/9.5/main/pg_hba.conf  将local和127.0.0.1 改为trust

sudo  service postgresql reload

创建用户

sudo adduser www superuser

创建日志目录

sudo mkdir /var/log/www

安装

源码:git clone [email protected]:dingyii/base.git dingyii
python依赖库安装:sudo pip install -r requirements.txt
安装less环境:

sudo apt install -y nodejs  
sudo apt install npm
sudo npm install -g less less-plugin-clean-css

安装Wkhtmltopdf

cd /tmp
sudo wget http://nightly.odoo.com/deb/xenial/wkhtmltox-0.12.1_linux-trusty-amd64.deb
sudo dpkg -i wkhtmltox-0.12.1_linux-trusty-amd64.deb
sudo cp /usr/local/bin/wkhtmltopdf /usr/bin
sudo cp /usr/local/bin/wkhtmltoimage /usr/bin

创建配置文件

#/etc/odoo.conf
[options]
admin_passwd = admin
db_host = False
db_port = False
db_user = odoo
db_password = FALSE
addons_path = /opt/odoo/addons,/opt/ownaddons
logfile = /var/log/odoo/odoo-server.log
xmlrpc_port = 8069

创建odoo服务

#/lib/systemd/system/odoo.service
[Unit]
Description=Dingyii
After=postgresql.service

[Service]
Type=simple
User=www
Group=www
ExecStart=/var/www/dingyii/odoo-bin -c /etc/odoo.conf

[Install]
WantedBy=multi-user.target

更改权限

sudo chmod 755 /lib/systemd/system/odoo.service
sudo chown root: /lib/systemd/system/odoo.service
sudo chown www:root /var/log/www
sudo chown www: /etc/odoo.conf
 sudo chmod 640 /etc/odoo.conf

测试服务

sudo systemctl start odoo #开启
sudo systemctl status odoo #查看状态
sudo systemctl stop odoo #停止
sudo systemctl enable odoo #激活

你可能感兴趣的:(ubuntu下安装odoo)