1、安装说明
Business model on open source is often trading-off between two things, source code and knowledge. You can get any source code but detail stories for it, if you don't like their way, share your knowledge to leverage them.
I have recently a chance to get around with TinyERP that is growing very fast on functionality, if you have no idea about Python language, to get Tiny running on Linux server is kind of tough work. Followings are my steps to complete the installation.
- Pre-dependencies
* PostgreSQL server
- Install TinyERP server dependencies
* Python 2.4
o Incleded in standard base Debian 4.0 R1
* PostgeSQL client
o apt-get install postgresql-client
+ Default version is postgresql-7.4
* Python and PostgreSQL adaptor
o apt-get install python-psycopg
* Python time zone
o apt-get install python-tz
* libxml2 and python binding
o apt-get install python-xml python-libxml2
* libxslt and python binding
o apt-get install python-libxslt1
* Reportlab pdf generator for Python
o apt-get install python-reportlab
* Python imaging library
o apt-get install python-imaging
* Graph visualization software
o apt-get install graphviz
* Pyparsing library
o apt-get install python-pyparsing
- Get TinyERP server source file and install
* wget http://tinyerp.com/download/stable/source/tinyerp-server-4.2.0.tar.gz
* tar vxf tinyerp-server-4.2.0.tar.gz
* cd tinyerp-server-4.2.0
* sudo python setup.py install
o Installation folder is /usr/lib/python2.4/site-packages/tinyerp-server
- Create TinyERP database
* su - postgres
* /usr/local/pgsql/bin/createdb --encoding=UNICODE terp
o Assume PostgreSQL homed at /usr/local/pgsql and creating database named terp
- Startup TinyERP Server
* cd /usr/lib/python2.4/site-packages/tinyerp-server
* sudo python tinyerp-server.py -d terp -r postgres -w --db_host=localhost --db_port=5432 --logfile="tinyerp-server.log"
o Assume the database name is terp, database owner is postgres, database server located at the same machine, database listening port is 5432, and logfile is tinyerp-server.log right in the current directory.
o You can make a batch script (ex. run.sh) to shorten the long command typing.
2、数据库安装疑难解答
When the installations of the required software are done, you have to create a database. The rights on the database are given to the postgres user by default. You have to add the common-used user on which Tiny ERP is installed.
This assumes PostgreSQL is installed and running on your server.
For an installation which need full UTF8 character support consider to use postgres >= 8.2.x. Prior to this tiny search will eventually not return the expected results for case insensitive searches, which are used for searching partners, products etc. Example: select 'x' where 'bét' ilike 'BÉT' matches only in 8.2.x
You have to create one database user and one database schema. (Make sure you create an Unicode database, otherwise the server won't start correctly.)
The default superuser for PostgreSQL is called postgres. We will use it below as an example. If you wish to use it as well, you may need to login as this user first.
johndoe$ sudo su postgres
password: XXXXXXXXXX
postgres$
The default installation of PostgreSQL sets security to allow access without password for localhost connections. This is called the trust security model.
If you run the database on the same host as the Tiny ERP server there is really no need for a password, as long as you know what you are doing (or is alone on the computer). To do without a password, simply leave the -P option out.
on SuSE 10.3 I had to use
$ createuser -U postgres --createdb --adduser -P terp
to succeed
$ createuser -U postgres --no-adduser -P terp
enter password: XXXXXXXXXX
repeat password: XXXXXXXXXX
CREATE USER
$ createdb -U postgres -O terp --encoding=UNICODE terp
CREATE DATABASE
Then, you can start/restart Tiny ERP Server:
$ sudo /etc/init.d/tinyerp-server restart