Freebsd supervisord+virtualenv 源码运行odoo10
2017-11-30 23:53
381 查看
各种参考:
https://www.liaoxuefeng.com/wiki/0014316089557264a6b348958f449949df42a6d3a2e542c000/001432712108300322c61f256c74803b43bfd65c6f8d0d0000http://blog.sina.com.cn/s/blog_955289220102ykzv.htmlhttp://www.linuxidc.com/Linux/2012-10/71692.htmhttps://blog.laslabs.com/2015/09/installing-odoo-8-from-source-ubuntu/http://www.jianshu.com/p/40caabd91827
------------------------------------------------
切换shell命令:
#pkginstallbash
#chsh-s/usr/local/bin/bash
#logout
更换非root用户默认的shell,#chsh-s/usr/local/bin/bashyourname
---------------------------------------------------
#supostgres
$cd/pgsql/data
$
$initdb-D/pgsql/data
Thefilesbelongingtothisdatabasesystemwillbeownedbyuser"postgres".
Thisusermustalsoowntheserverprocess.
Thedatabaseclusterwillbeinitializedwithlocale"C".
Thedefaultdatabaseencodinghasaccordinglybeensetto"SQL_ASCII".
Thedefaulttextsearchconfigurationwillbesetto"english".
Datapagechecksumsaredisabled.
fixingpermissionsonexistingdirectory/server/pgsql/data...ok
creatingsubdirectories...ok
selectingdefaultmax_connections...100
selectingdefaultshared_buffers...128MB
selectingdynamicsharedmemoryimplementation...posix
creatingconfigurationfiles...ok
runningbootstrapscript...ok
performingpost-bootstrapinitialization...ok
syncingdatatodisk...ok
WARNING:enabling"trust"authenticationforlocalconnections
Youcanchangethisbyeditingpg_hba.conforusingtheoption-A,or
--auth-localand--auth-host,thenexttimeyouruninitdb.
Success.Youcannowstartthedatabaseserverusing:
pg_ctl-D/pgsql/data-llogfilestart
$suroot
#servicepostgresqlrestart
安装并创建odoo10数据库用户密码为123456
#suposgres
$psqlpostgres
#CREATEuserodoo10WITHPASSWORD'123456'CREATEDB;
Ctrl+d退出
2、配置odoo
以下操作root用户登录
创建用户odoo
adduser
mkdir/odoo10
mkdir/var/log/odoo10/
mkdir/var/log/supervisord/odoo10/
目录权限
chown-Rodoo/odoo10
chmod-R777/odoo10
chown-Rodoo/var/log/odoo10/
chmod-R777/var/log/odoo10/
cd/odoo10
#创建虚拟环境
virtualenv--no-site-packagesvenv
#激活虚拟环境
sourcevenv/bin/activate
#安装odoo的py支持环境
pipinstall-rrequirements.txt
node、wkhtmltopdf安装[/code]
pkginstallnodenpmwkhtmltopdf
npminstall-gless
npminstall-gless-plugin-clean-css
ln-s/usr/local/bin/lessc/usr/bin/lessc
ln-s/usr/bin/node/usr/bin/node
ln-s/usr/bin/nodejs/usr/bin/node
ln-s/usr/bin/wkhtmltopdf/usr/bin/wkhtmltopdf
ViewCode
------------------------------------------------------------------
supervisord管理odoo10.sh
安装supervisord
pkgsearchsupervisor
py27-supervisor-3.3.3,1SystemforcontrollingprocessstateunderUNIX
根据supervisor配置目录配置odoo10的supervisord脚本
[include]后面加入[/code]
内容如下:
重启supervisord服务
supervisorctlstatusodoo10
odoo10RUNNINGpid705,uptime1:30:39
祝不报错,结束!
------------------------------------------------
切换shell命令:
#pkginstallbash
#chsh-s/usr/local/bin/bash
#logout
更换非root用户默认的shell,#chsh-s/usr/local/bin/bashyourname
---------------------------------------------------
1、安装postgresql 版本不一样可能pg的用户名会是pgsql或者postgres(以下为postgres),以下用/pgsql/data作为数据库存放目录 #pkgsearchpostgresql #pkgsearchpostgresql exim-postgresql-4.89_2HighperformanceMTAforUnixsystemsontheInternet libgda5-postgresql-5.2.4Providespostgresqlaccessforthelibgda5library opensmtpd-extras-table-postgresql-201606230001_2PostgreSQLtablesupportforOpenSMTPD p5-PostgreSQL-PLPerl-Call-1.006_1SimpleinterfaceforcallingSQLfunctionsfromPostgreSQLPL/Perl p5-PostgreSQL-PLPerl-Trace-1.001_1SimplewaytotraceexecutionofPerlstatementsinPL/Perl p5-Test-postgresql-0.09_1Perlextensionofpostgresqlrunnerfortests pgtcl-postgresql10-2.0.0_1TCLextensionforaccessingaPostgreSQLserver(PGTCL-NG) pgtcl-postgresql92-2.0.0_1TCLextensionforaccessingaPostgreSQLserver(PGTCL-NG) pgtcl-postgresql93-2.0.0_1TCLextensionforaccessingaPostgreSQLserver(PGTCL-NG) pgtcl-postgresql94-2.0.0_1TCLextensionforaccessingaPostgreSQLserver(PGTCL-NG) pgtcl-postgresql95-2.0.0_1TCLextensionforaccessingaPostgreSQLserver(PGTCL-NG) pgtcl-postgresql96-2.0.0_1TCLextensionforaccessingaPostgreSQLserver(PGTCL-NG) postgresql-jdbc-9.2.1004TheJavaJDBCimplementationforPostgreSQL 挑一个合适的版本,目前9.6版本是没问题的 #pkginstallpostgresql96-server-9.6.6
#echo'postgresql_enable="YES"'>>/etc/rc.conf
#echo'postgresql_data="/pgsql/data"'>>/etc/rc.conf
#echo'postgresql_class="postgres"'>>/etc/rc.conf
#echo'postgresql_initdb_flags="--encoding=utf-8--lc-collate=C"'>>/etc/rc.conf
#mkdir-p/pgsql/date #chown-Rpostgres/pgsql #chmod-R777/pgsql/date
#supostgres
$cd/pgsql/data
$
$initdb-D/pgsql/data
Thefilesbelongingtothisdatabasesystemwillbeownedbyuser"postgres".
Thisusermustalsoowntheserverprocess.
Thedatabaseclusterwillbeinitializedwithlocale"C".
Thedefaultdatabaseencodinghasaccordinglybeensetto"SQL_ASCII".
Thedefaulttextsearchconfigurationwillbesetto"english".
Datapagechecksumsaredisabled.
fixingpermissionsonexistingdirectory/server/pgsql/data...ok
creatingsubdirectories...ok
selectingdefaultmax_connections...100
selectingdefaultshared_buffers...128MB
selectingdynamicsharedmemoryimplementation...posix
creatingconfigurationfiles...ok
runningbootstrapscript...ok
performingpost-bootstrapinitialization...ok
syncingdatatodisk...ok
WARNING:enabling"trust"authenticationforlocalconnections
Youcanchangethisbyeditingpg_hba.conforusingtheoption-A,or
--auth-localand--auth-host,thenexttimeyouruninitdb.
Success.Youcannowstartthedatabaseserverusing:
pg_ctl-D/pgsql/data-llogfilestart
$suroot
#servicepostgresqlrestart
安装并创建odoo10数据库用户密码为123456
#suposgres
$psqlpostgres
#CREATEuserodoo10WITHPASSWORD'123456'CREATEDB;
Ctrl+d退出
2、配置odoo
以下操作root用户登录
创建用户odoo
创建odoo10及log目录
mkdir/odoo10
mkdir/var/log/odoo10/
mkdir/var/log/supervisord/odoo10/
目录权限
chown-Rodoo/odoo10
chmod-R777/odoo10
chown-Rodoo/var/log/odoo10/
chmod-R777/var/log/odoo10/
用任意方法将odoo10源码上传到/odoo10
deactivate命令退出虚拟环境退出虚拟环境
node、wkhtmltopdf安装[/code]
3.创建运行odoo10的配置文件 vi/odoo10/odoo10.conf 内容如下:
[options] ;Thisisthepasswordthatallowsdatabaseoperations: admin_passwd=123456 db_host=127.0.0.1 db_port=False db_user=odoo10 db_password=123456 addons_path=/server/odoo/odoo10/addons,/server/odoo/odoo10/odoo/addons ;addons_path=/server/odoo/odoo/openerp/addons xmlrpc_port=8069 log_level=info logfile=/var/log/odoo10/odoo-server.log logrotate=True
ViewCode
4、用python启动odoo #进入odoo用户下用odoo10.conf配置启动odoo
suodoo source/odoo10/venv/bin/activate python/odoo10/odoo-bin-c/odoo10/odoo10.conf
运行正常则Ctrl+c退出,有出错则根据错误进行解决
deactivate命令退出虚拟环境[/code]
5、用supervisor管理odoo的开机自动启动 ----------------------------------------------- 安装bash
pkginstallbash
创建bash脚本/odoo10/odoo10.sh
vi/odoo10/odoo10.sh
内容如下:
#!/bin/sh source/odoo10/venv/bin/activate execpython/odoo10/odoo-bin-c/odoo10/odoo10.conf
------------------------------------------------------------------
supervisord管理odoo10.sh
安装supervisord
pkgsearchsupervisor
py27-supervisor-3.3.3,1SystemforcontrollingprocessstateunderUNIX
pkginstallpy27-supervisor-3.3.3,1
echo'supervisord_enable="YES"'>>/etc/rc.conf
根据supervisor配置目录配置odoo10的supervisord脚本
vi/usr/local/etc/supervisord.conf
[include]后面加入[/code]
files=supervisor/conf.d/*.conf
superviord-odoo10.conf
vi/usr/local/etc/supervisor/conf.d/[code]superviord-odoo10.conf
内容如下:
[program:odoo10]
command=/usr/local/bin/bash/odoo10/odoo10.sh
directory=/odoo10/
autostart=true
autorestart=true
startsecs=8
environment=HOME="/odoo10",USER="odoo"
user=odoo
redirect_stderr=true
stdout_logfile=/var/log/supervisord/odoo10/supervisor-odoo10.log
stdout_logfile_maxbytes=500MB
stdout_logfile_backups=50
stdout_capture_maxbytes=1MB
stdout_events_enabled=false
loglevel=warn
重启supervisord服务
servicesupervisordrestart
supervisorctlstatus
supervisorctlstatusodoo10
odoo10RUNNINGpid705,uptime1:30:39
祝不报错,结束!
相关文章推荐
- ubuntu 14.04 源码安装odoo10
- 配置python服务器运行环境 nginx+virtualenv+uwsgi+supervisor
- pycharm + virtualenv搭建python2.7 和python 3.0的多python运行环境
- spark core源码分析10 Task的运行
- Freebsd ports 安装apache+mod_mono+mono运行.net4.0
- spark core 1.6.0 源码分析10 Task的运行
- Freebsd ports 安装apache+mod_mono+mono运行.net4.0
- 在Ubuntu Server上源码安装OpenERP(odoo) 8.0,并配置wsgi和nginx运行环境
- FreeBSD5.4笔记记录一——ports及源码和内核更新
- Mesos源码分析(10): MesosSchedulerDriver的启动及运行一个Task
- Ubuntu 16.04 nfs mount to freebsd 10
- Python Virtualenv运行Django环境配置
- make.conf under my freebsd 10
- Mesos源码分析(10): MesosSchedulerDriver的启动及运行一个Task
- 利用virtualenv和virtualenvwrapper隔离Python运行环境
- Apache Spark源码走读之10 -- 在YARN上运行SparkPi
- odoo10 安装运行遇到 could not execute command lessc
- Apache Spark源码走读之10 -- 在YARN上运行SparkPi
- Ubuntu14.04源码安装Odoo10社区版
- Nginx+Gunicorn+virtualenv+supervisord+Postgresql部署Django应用 推荐