(40) Aeroo 服务安装

服务器

Odoo 8.0

操作系统: Ubuntu trusty14.04

说明:安装aeroo 要的要两个服务 areoo-docs 和 soffice

这里设定两个端口 8989 和 8100

==================================

修订时间:

17:46 2016-09-08 星期四 添加中文支持

09:28 2016-09-07 星期三 适应生产环境

==================================

 

服务器

Odoo 8.0

操作系统: Ubuntu trusty14.04

 

说明:安装aeroo 要的要两个服务 areoo-docs soffice

      这里设定两个端口 8989 8100

==================================

修订时间:

09:28 2016-09-07 星期三 适应生产环境

==================================

 

安装curl git=============================

# apt-get update

# apt-get install curl git

 

 

安装pip=====================================

# mkdir /opt/soft

# cd /opt/soft

# curl -O https://bootstrap.pypa.io/get-pip.py

# python get-pip.py

 

 

安装supervisor========================================

# pip install supervisor

 

生成配置文件

# mkdir -p /etc/supervisor

# echo_supervisord_conf > /etc/supervisor/supervisord.conf

 

# vi /etc/supervisor/supervisord.conf 对应修改为下面的内容

 

;[unix_http_server]

;file=/var/run/supervisor.sock   ; (the path to the socket file)

 

[supervisord]

logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)

pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)

 

[supervisorctl]

serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL  for a unix socket

 

[include]

files = /etc/supervisor/conf.d/*.ini

 

:wq 保存

 

此处的/etc/supervisor/conf.d/用于存放各种programsupervisord启动脚本(后缀为ini

# mkdir /etc/supervisor/conf.d/

 

# vi /etc/supervisor/conf.d/soffice.ini

 

[program:soffice]

command=/usr/bin/soffice --nologo --nofirststartwizard --headless --norestore --invisible "--accept=socket,host=0.0.0.0,port=8100,tcpNoDelay=1;urp;"

 

autostart=true

autorestart=true

user=root

numprocs=1

redirect_stderr=true

stdout_logfile=/var/log/supervisor/soffice.log

stdout_logfile_maxbytes = 500MB

 

:wq 保存

 

然后添加Supervisorservice控制命令:

https://github.com/Supervisor/initscripts 可以查看到很多平台启动脚本

 

# cd /etc/init.d/

# wget https://raw.githubusercontent.com/Supervisor/initscripts/master/ubuntu

# mv ubuntu supervisord

# chmod +x supervisord

 

# vi supervisord

改几个地方

DAEMON=/usr/local/bin/supervisord

SUPERVISORCTL=/usr/local/bin/supervisorctl

 

 

:wq 保存

 

创建文件夹:

 

# mkdir -p /var/run/supervisor

# mkdir -p /var/log/supervisor

 

 

加入随机器启动服务(若是docker就不用加下句)

# update-rc.d supervisord defaults

 

启动服务

# service supervisord start

 

查看端口

# netstat -ntpl

 

启动supervisord

 

# /etc/init.d/supervisord start

# service supervisord start

 

安装 aeroolib======================================

sudo mkdir -p /opt/soft/aeroo

cd /opt/soft/aeroo

sudo git clone https://github.com/aeroo/aeroolib.git

cd /opt/soft/aero/aeroolib

sudo python setup.py install

 

安装AerooDOCS========================================

# apt-get update

# apt-get install python3-pip python3-uno

# pip3 install jsonrpc2 daemonize

# cd  /usr/local

# git clone https://github.com/aeroo/aeroo_docs.git

# ln -s /usr/local/aeroo_docs/aeroo-docs /etc/init.d/aeroo-docs

编辑启动文件对外端口

# vi /etc/init.d/aeroo-docs

 

 

conf = '''

[start]

interface = 0.0.0.0

port = 8989

oo-server = localhost

oo-port = 8100

spool-directory = /tmp/aeroo-docs

spool-expire = 1800

log-file = /var/log/aeroo-docs/aeroo_docs.log

pid-file = /var/run/aeroo-docs.pid

[simple-auth]

username = anonymous

password = anonymous

'''

主要是3个引号之间的配置,解释一下

interface = 0.0.0.0 这个我是全写0,是要开放端口给其它服务器用,若

是本机就写localhost

oo-server = localhost 这是soffice 的服务,这里是本机

 

 

加入到随系统启动(若是docker就不要加执行这个命令)

# update-rc.d aeroo-docs defaults

 

启动服务

# service aeroo-docs start

 

查看端口

# netstat -ntpl

 

docker处理两行,若不是docker,就不要执行下面两行

# touch /etc/init.d/systemd-logind

# cat /dev/null > /var/run/utmp

# ln -sf /bin/true /sbin/initctl

 

 

安装liberoffice======================================================

# 安装依赖

# apt-get update

# apt-get build-dep build-essential

# apt-get install python-genshi python-cairo python-lxml python-cups

 

 

安装

# apt-get update

# apt-get install libreoffice libreoffice-script-provider-python libreoffice-base libreoffice-l10n-zh-cn

 

安装中文支持

# apt-get install ttf-wqy-zenhei ttf-wqy-microhei

 

soffice服务启动,已在前面supervisor那里预先配置好了

 

 

docker 操作

到这里aeroo要的两个服安装完成,这时可以导出容器给其它同学用

导出前的操作

# cd /tmp

目录下面有运用的文件锁 对于soffice没有处理很好,在停止服务器,没有删除对用的文件

为了不导出的容器和提交的容器,可以正常启动soffice,那只能手动删除这些文件

OSL_PIPE_0_SingleOfficeIPC_f4a0b779546b8a369c4eeae9854f954c=

前缀OSL_PIPE_0_SingleOffice大家应该相同,后面随机数可能不能,找到这个文件

rm OSL_PIPE_0_SingleOfficeIPC_f4a0b779546b8a369c4eeae9854f954c=

为了更干净些,可以找到

drwx------  2 root root 4096 Sep  6 17:49 lurao9p1.tmp/

drwx------  2 root root 4096 Sep  6 18:35 lurcb5bd.tmp/

drwx------  2 root root 4096 Sep  6 18:39 lurcgl6d.tmp/

可以看到前缀是 lur

那统一删除 # rm  -rf lur*

可以看到红框中有配置,后面在系统配置时就要一致

image

安装Aeroo report for odoo 组件

image

 

假设 /opt/odoo/custom 这个是你放odoo  自定义组件的目录

cd /opt/odoo/custom

sudo git clone –b 8.0 https://github.com/aeroo/aeroo_reports.git

 

随后到odoo系统,安装其它本地组件一样,刷新出来,安装就可以

 

安装成功后,对应的配置设计在

 

image

原文地址:https://www.cnblogs.com/toby2chen/p/5830882.html