FreeBSD7.0建立OpenERP服务端全过程
--ople 贡献
前言
网上google,很少有FreeBSD安装TinyERP完整教程(主要说的是中文^^)。所以把自己安装测试过程整理汇编。
0、最小化安装FreeBSD7.0
FreeBSD安装网上很多教程,以下软件均通过ports安装,所以需要更新ports
portsnap fetch extract
1、安装python2.5
cd /usr/ports/lang/python25&&make install clean
2、安装psycopg(psycopg2 不行)
cd /usr/ports/databases/py-psycopg&&make install clean
完成这步,系统自动装上postgresql8.2-client
3、安装并配置postgresql8.2-server
cd /usr/ports/databases/postgresql82-server&&make install clean
3.1、环境设置
echo 'postgresql_class="postgres"'>> /etc/rc.conf
echo 'postgresql_enable="YES"'>> /etc/rc.conf
ee /etc/login.conf
添加以下内容,完后刷新数据库,文件开始有提醒“cap_mkdb /etc/login.conf”
postgres:
:lang=en_US.UTF-8:
:setenv=LC_COLLATE=C:
:tc=default:
cap_mkdb /etc/login.conf
rehash #刷新
3.2、初始数据库、添加用户、数据库
/usr/local/etc/rc.d/postgresql initdb
/usr/local/etc/rc.d/postgresql start
su - pgsql
createuser --createdb --no-adduser terp
createdb --owner=terp --encoding=UTF8 terp
psql -dterp
ALTER USER terp WITH PASSWORD 'password'; #password是需要设定密码
q
exit
3.3、配置postgresql网络
文件/usr/local/pgsql/data/postgresql.conf中
'#listen_addresses = 'localhost' 改为 'listen_addresses = '*'
文件/usr/local/pgsql/data/pg_hba.conf中
在#IPv4 local connections: 后面添加行
host all all 0.0.0.0 0.0.0.0 md5
4、按tiny-server说明安装其他模组
4.1、安装mxDateTime
cd /roo/downloads&&wget www.egenix.com/files/python/egenix-mx-base-2.0.5.tar.gz
tar zxf ./egenix-mx-base-2.0.5.tar.gz
cd ./egenix-mx-base-2.0.5
python ./setup.py install
4.2、安装libxml2
cd /usr/ports/textproc/py-libxml2&&make install clean
4.3、安装libxslt
cd /usr/ports/textproc/py-libxslt&&make install clean
4.4、安装Reportlab
cd /usr/ports/print/py-reportlab2&&make install clean
4.5、安装graphviz
cd /usr/ports/graphics/py-graphviz&&make install clean
4.6、安装pyparsing
cd /usr/ports/devel/py-parsing&&make install clean
4.7、安装Imaging
cd /usr/ports/graphics/py-imaging&&make install clean
4.8、安装pyxml
cd /usr/ports/textproc/py-xml&&make install clean
5、安装tinyerp-server
5.1、安装
mkdir /root/downloads
cd /roo/downloads&&wget openerp.com/download/stable/source/tinyerp-server-4.2.3.4.tar.gz
mkdir /usr/local/tinyerp
cd /usr/local/tinyerp&&tar zxf /root/downloads/tinyerp-server-4.2.3.4.tar.gz
cd ./tinyerp-server-4.2.3.4 && python setup.py install
5.2、初始化
/usr/local/bin/tinyerp-server --init=all -r terp -w 'password' --db_host=127.0.0.1 #password是前面设的密码
参考:
1、Gentoo2008.0下安装TinyERP 4.2.2 Server手记 www.shine-it.net/viewthread.php?tid=254& ;extra=page%3D2
2、postgresql访问认证设置 fanqiang.chinaunix.net/db/psql/2005-09-07/3629.shtml
3、
附:
1、步骤2如果安装psycopg2,安装tinyerp时出现
Eerror: python module psycopg (PostgreSQL module) is required
2、有大大说mxDateTime先以psycopg安装的问题,因为我在上面错误时make deinstall&&make install几次,状况不明。如步骤5出错时可以如此
cd /usr/ports/databases/py-psycopg &&make deinstall&&make install clean
3、奇怪现象,刚开始tinyerp-client登录时出现下面错误信息,停tinyerp-server用pgAdminIII把数据库terp删后重建一样名称的,一切OK!期待大大们给个解答。
Traceback (most recent call last):
File "tinyerp-client.py", line 129, in <module>
File "modulesguimain.pyo", line 702, in sig_login
File "rpc.pyo", line 209, in login
File "xmlrpclib.pyo", line 1147, in call
File "xmlrpclib.pyo", line 1437, in __request
File "xmlrpclib.pyo", line 1201, in request
File "xmlrpclib.pyo", line 1340, in _parse_response
File "xmlrpclib.pyo", line 787, in close
xmlrpclib.Fault: <Fault ERROR: permission denied for relation ir_module_module
select name from ir_module_module where state in ('installed', 'to upgrade', 'to remove'): 'Traceback (most recent call last):n File "/usr/local/lib/python2.5/site-packages/tinyerp-server/netsvc.py", line 200, in _dispatchn r=m(*params)n File "/usr/local/lib/python2.5/site-packages/tinyerp-server/service/web_services.py", line 329, in loginn res = security.login(db, login, password)n File "/usr/local/lib/python2.5/site-packages/tinyerp-server/service/security.py", line 36, in loginn cr = pooler.get_db(db).cursor()n File "/usr/local/lib/python2.5/site-packages/tinyerp-server/pooler.py", line 83, in get_dbn return get_db_and_pool(db_name)[0]n File "/usr/local/lib/python2.5/site-packages/tinyerp-server/pooler.py", line 53, in get_db_and_pooln addons.load_modules(db, force_demo, status, update_module)n File "/usr/local/lib/python2.5/site-packages/tinyerp-server/addons/init.py", line 270, in load_modulesn cr.execute("select name from ir_module_module where state in ('installed', 'to upgrade', 'to remove')")n File "/usr/local/lib/python2.5/site-packages/tinyerp-server/sql_db.py", line 75, in executen res = self.obj.execute(sql)nProgrammingError: ERROR: permission denied for relation ir_module_modulennselect name from ir_module_module where state in ('installed', 'to upgrade', 'to remove')n'>
后记
安装过程排错都是通过google大神,搜整篇整篇linux版的类推解决。准备启动学习python,零的开始啊,在此留迹。