linux上でodoo構築

16224 ワード

一.Postgresqlデータベースの構成
1.Postgresqlのインストール
root@runner:/home/sg-os# apt-get install postgresql

2 . postgresqlコピー/var/lib/postgresql/9.4/mainから/optディレクトリへの構成
root@runner:/home/sg-os# rsync -aHq /var/lib/postgresql/9.4/main /opt

postgresqlデータベースのデータを/opt/mainディレクトリに格納、/etc/postgresql/9.4/main/postgresqlを変更する.confファイル、以下のように変更します.
data_directory = '/var/lib/postgresql/9.4/main'

次のように変更します.
data_directory = '/opt/main'

サービスの再起動
root@runner:/home/sg-os# /etc/init.d/postgresql restart

3 .データベースのデータストレージパスを検証postgresユーザーにログイン
root@runner:/home/sg-os# su - postgres

データベースへのアクセス
postgres@runner:~$ psql

データ格納ディレクトリの表示
postgres=# show data_directory;
 data_directory
\----------------
 /opt/main
(1    )

二.以下のパッケージのインストール
1 . Odoo OdooはオープンソースのERPシステムであり、企業レベルの管理ソフトウェアである.
1.1最新バージョンのOdooをダウンロードする
ダウンロード先:https://www.odoo.com/zh_CN/thanks/download
1.2 Odooパッケージの依存関係の表示
root@runner:/home/sg-os# dpkg -I odoo_8.0.0~d666e50_amd64.deb
     debian    ,     2.052940614   :   =415637693        conffiles            
    158922        control              
 160857314320        md5sums              
    117342     *  postinst             #!/bin/sh
     86643     *  postrm               #!/bin/sh
     1637     *  prerm                #!/bin/sh
 Package: odoo
 Version: 8.0.0~d666e50
 Architecture: amd64
 Maintainer: Odoo S.A. 
 Installed-Size: 320654
 Depends: adduser, postgresql-client, python, python-dateutil, python-decorator, python-docutils, python-feedparser, python-imaging, python-jinja2, python-ldap, python-libxslt1, python-lxml, python-mako, python-mock, python-openid, python-passlib, python-psutil, python-psycopg2, python-pybabel, python-pychart, python-pydot, python-pyparsing, python-pypdf, python-reportlab, python-requests, python-simplejson, python-tz, python-unittest2, python-vatnumber, python-vobject, python-werkzeug, python-xlwt, python-yaml
 Recommends: antiword, graphviz, ghostscript, postgresql, python-gevent, poppler-utils
 Conflicts: openerp, openerp-server, openerp-web, tinyerp-server
 Replaces: openerp, openerp-server, openerp-web, tinyerp-server
 Section: net
 Priority: optional
 Homepage: http://www.odoo.com/
 Description: Open Source Apps To Grow Your Business
  Odoo, formerly known as OpenERP, is a suite of open-source business apps
  written in Python and released under the AGPL license. This suite of
  applications covers all business needs, from Website/Ecommerce down to
  manufacturing, inventory and accounting, all seamlessly integrated. Odoo's
  technical features include a distributed server, flexible workflows, an object
  database, a dynamic GUI, customizable reports, and an XML-RPC interface. Odoo
  is the most installed business software in the world. It is used by 2.000.000
  users worldwide ranging from very small companies (1 user) to very large ones
  (300 000 users). 

1.3パッケージ依存のインストール
root@runner:/home/sg-os# apt-get install `echo "adduser, postgresql-client, python, python-dateutil, python-decorator, python-docutils, python-feedparser, python-imaging, python-jinja2, python-ldap, python-libxslt1, python-lxml, python-mako, python-mock, python-openid, python-passlib, python-psutil, python-psycopg2, python-pybabel, python-pychart, python-pydot, python-pyparsing, python-pypdf, python-reportlab, python-requests, python-simplejson, python-tz, python-unittest2, python-vatnumber, python-vobject, python-werkzeug, python-xlwt, python-yaml, antiword, graphviz, ghostscript, postgresql, python-gevent, poppler-utils" | tr -d , `

1.4 Odooのインストール
root@runner:/home/sg-os# dpkg -i odoo_8.0.0~d666e50_amd64.deb

2 .Pysftpとpipのインストール
pip:pythonのパッケージ管理ソフトウェア
pysftp:pythonはpysftp暗号化によりftpサーバファイルをアップロード、ダウンロードし、pysftpはpythonのpip管理ソフトウェアによってインストールされます
2.1 pipのインストール
root@runner:/home/sg-os# apt-get install python-pip python-dev

2.2 pysftpのインストール
:zap:OdooのDatabase Auto-backupというモジュールでは、外部のSFTPサーバに接続する際にpysftpが使用されています
root@runner:/home/sg-os# pip install pysftp

4 . wkhtmltopdf
wkhtmltopdfは、webkitブラウザでWebページをpdfに生成するオープンソースコンポーネントであり、HTMLドキュメントをPDFドキュメントに変換するツールであり、複数のスクリプト言語と統合してドキュメントを変換することができます.
4.1 wkhtmltopdfのダウンロード
root@runner:/home/sg-os# wget http://downloads.sourceforge.net/project/wkhtmltopdf/0.12.2.1/wkhtmltox-0.12.2.1_linux-jessie-amd64.deb

4.2 wkhtmltopdfのインストール
root@runner:/home/sg-os# dpkg -i wkhtmltox-0.12.2.1_linux-jessie-amd64.deb

5 . qrtools
qrtoolsはQRコードを生成するツールです.
5.1 qrtoolsのインストール
root@runner:/home/sg-os# apt-get install python-qrtools

6 . サービスの開始
root@runner:/home/sg-os# /etc/init.d/postgresql restart
root@runner:/home/sg-os# /etc/init.d/odoo restart

7 . OdooとPostgresqlのサービスが開始されたかどうかを確認します
Odooのポート番号8069、プログラム名python、Postgresqlのポート番号5432、プログラム名postgres、下図のように
root@  :/home/sg-os# netstat -tnpla
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:8069            0.0.0.0:*               LISTEN      7410/python
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      2775/sshd
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      977/cupsd
tcp        0      0 127.0.0.1:5432          0.0.0.0:*               LISTEN      5819/postgres
tcp        0      0 127.0.0.1:44677         127.0.0.1:8069          ESTABLISHED 1126/iceweasel  
tcp        1      0 172.16.0.148:8069       
tcp        0      0 127.0.0.1:8069          

三.Odooのデータベースの構成
root@linx:/home/sg-os# vi /etc/postgresql/9.4/main/pg_hba.conf  
#     USER postgres METHOD trust, peer  trust,        :  
local   all             postgres                                trust
#      
root@linx:/home/sg-os# /etc/init.d/postgresql restart  

データベースの作成:
root@linx:/home/sg-os# su - postgres
postgres@linx:~$ createdb linxerp
postgres@linx:~$ psql
postgres=# alter datebase linxerp owner to odoo;
postgres=# \q

サーバ上のデータベースをエクスポートするには、次の手順に従います.
jjli@Linx:~$ ssh sg-os@erp.rd.in.linx -lroot
root@runner:/home/sg-os# pg_dump -U postgres linxerp >/home/sg-os/linxerp.bak

サーバー上のデータベースをローカル・データベースにインポートするには、次の手順に従います.
#      linxerp.bak       
root@linx:/home/sg-os# scp -r sg-os@erp.rd.in.linx:~linxerp.bak .
root@linx:/home/sg-os# psql -U postgres -d linxerp < linxerp.bak

サービスの再起動:
root@linx:/home/sg-os# /etc/init.d/odoo restart

:zap:このときローカルのodooシステム環境はサーバ上のodooシステム環境と一致する
四.WebページにOdooのデータベースを作成する
  • ブラウザのWebアドレスバーに、127.0.0.1:8069と入力し、ページに関連する情報ページのオプションの説明を入力します.
  • Master password:デフォルトのadminアカウントのパスワードはadminで、この項目を変更する必要はありません.デフォルトでは
  • です.
  • Select a database name:データベースの名前を入力し、
  • に記入する必要があります.
  • Load demonstration data:demoデータをロードするかどうか、
  • をロードする必要はありません.
  • Default language:必要に応じて言語を選択
  • **Choose a password:**adminアカウントの新しいパスワード
  • Confirm password:パスワード記入ページの内容を1回繰り返し入力、下図のように
  • .
  • 、CreateDatabaseボタンをクリックします.

  • 六.Odooのポート番号の変更
    ポート番号は8069から80に変更する、ブラウザにポート番号を入力する必要がなく、IPアドレスを直接入力してWebページ:1にアクセスできるようにする.プロファイルを開く
    root@runner:/home/sg-os# vi /etc/rc.local

    2 .次のコードをファイルに書き込み、保存します.
    iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8069

    3 .システムの再起動
    root@runner:/home/sg-os# reboot

    七.モジュールのインストール
  • ###モジュール格納ディレクトリ
  • root@runner:/home/sg-os# cd /usr/lib/python2.7/dist-packages/openerp/addons
  • コードをダウンロードして現在のディレクトリに配置し、作成したモジュールディレクトリを現在のディレクトリにコピーすれば
  • です.
  • サービス再開
  • root@runner:/usr/lib/python2.7/dist-packages/openerp/addons# /etc/init.d/odoo restart
  • 設置技術特性4.1 URLはhttp://erp.rd.in.linxadminユーザーにログインして、左のメニューバーのユーザーをクリックして、下図のように:4.2それからAdministratorユーザーをクリックして、ページはジャンプして、下図のように:4.3それから編集をクリックして、技術特性のオプションをチェックして、下図のように:4.4最後にクリックして保存して、それからF 5を押してページをリフレッシュして、ページはジャンプして、下図のように:
  • ローカルモジュールを更新左側メニューの更新モジュールリストオプションをクリックし、次の図に示すように更新をクリックします:
  • .
  • インストールモジュール6.1左メニューのローカルモジュールをクリックし、下図のように:6.2検索欄にインストールするモジュールの名前を入力します.下図のように:6.3インストールする必要があるモジュールは全部で5つあります.下図の5つのモジュールのように、順次インストール:
  • 最後に現れる効果