2013年9月2日月曜日

iDempiere Installation.

install iDempiere_v1.0b@fedora18.LatitudeD630



iDempiere Install しました。
I have installed the iDempiere.


idempiere の installer が出来ましたと、聞きしました。
idempiere には、OSGi が入ったので、
開発の勉強もしないと思っていました。

I've heard about the Installer of idempiere.
Idempiere based  on compiere,adempiere, and OSGi too,
I had thought that I had to study it's development.


しかし、installer を使って install してみると、
ADempiere の install と殆ど全く同じです。

When I installed it using it's installer,
It was almost all same as ADempiere's Installation.


以前、adempiere360 を fedora13 に install しました。
この時、postgresql が Jboss に繋がらなくて、困りました。
When I installed adempiere360 in fedora13,
I was troubled that it wasn't able to connect postgresql with Jboss.


重要な事は、
postgresql と Tomcat が、
一緒の hostComputer に同居していても、
UnixDomainSocket 通信ではなく、
TcpSocket 通信をすると言う事。

The important things are ::
it communicates not with unix domain socket but with tcp socket,
even if postgresql and Tomcat installed together in same host computer.


environment variable Settings for JDK , PostgreSQL , Idempiere.

in PostgreSQL,
at datadase name:idempiere ,
user:adempiere に操作権限を与える事。
Give user:adempiere the operation privileges.

以上で install は、成功します。
他の事は、些細な事でした。
That's all. Installation shall succeed.
The other things are trifles.

*********** prepair Host Machine ************************

install Fedora18@Dell_Latitude_D630
java version :: openjdk-1.7.0.25.x86_64

そして、hostname を決める。
And determine the hostname.

serverなので、固定 IP address を決める。
So server, determine the fixed IP address.

PostgreSQLを installし、動く様にする。
Install the PostgreSQL, and setting to work.

*********** stop iptables , SELinux *********************

# systemctl enable firewalld.service
stop firewall
# systemctl disable firewalld.service

stop SELinux
# vi /etc/selinux/config
SELINUX=permissive

:: SElinuxは警告を出力するが、アクセス制限は無効
:: SElinux works in warning, but access restrictions invalid

************ JDK ****************************************

environment variable Settings for JDK
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
env_java_var

JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.25.x86_64
export JAVA_HOME

PATH=$JAVA_HOME:$JAVA_HOME/jre/bin:$PATH
export PATH
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


************* PostgreSQL server *************************

environment variable Settings for PostgreSQL
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

PGDATA=/var/lib/pgsql/data
MANPATH=/usr/share/man
LD_LIBRARY_PATH=/usr/lib64/pgsql
export PGDATA MANPATH LD_LIBRARY_PATH

PATH=/usr/bin:$MANPATH:$LD_LIBRARY_PATH:$PATH
export PATH
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

今回も、
db-server_postgresql と idempiereのTomcat が、
一緒の hostComputer に同居していても、
やはり、TcpSocket 通信が出来る様に、
postgresql.conf , pg_hba.conf を設定します。

Also in this time,
It configures "postgresql.conf" and "pg_hba.conf",
to communicate with tcp socket,
even if postgresql and Tomcat installed together in same host computer.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vi /var/lib/pgsql/data/postgresql.conf
59: listen_addresses = '*'
63: port = 5432
87 or 91: password_encryption = on

vi /var/lib/pgsql/data/pg_hba.conf
86: host all all 192.168.0.0/24 trust
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   
configure pgsql
# systemctl enable postgresql.service
start pgsql
# systemctl start postgresql.service


test connectinon

$ su -
# su - postgres
$ psql

$ psql -h 192.168.0.90


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

次に、この PostgreSQL 内に、idempiere の data を import する為、
to import the idempiere data inside PostgreSQL,

create ::
database-name: idempiere
database-user: adempiere

この adempiere user に、table 作成 などの権限を与えます。
give the PRIVILEGES to the user:adempiere.

postgres=# CREATE USER adempiere WITH PASSWORD '********' CREATEDB;
postgres=# CREATE DATABASE idempiere;
postgres=# GRANT ALL PRIVILEGES ON DATABASE idempiere to adempiere;

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

environment variable Settings for Idempiere
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

IDEMPIERE_HOME=/opt/idempiere/idempiere-server
export IDEMPIERE_HOME

PATH=$IDEMPIERE_HOME:$IDEMPIERE_HOME/utils:$PATH
export PATH
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



環境設定を1つの shell script file にまとめる。
"実行権限"を与える。
summarize the environment variable Settings
in the single shell script file.
give the "execute permission".

************* /etc/profile.d/env_var_idempiere.sh *******

#!/bin/sh
#
#
# vi /etc/profile.d/env_var_idempiere.sh :: chmod +x
#
#
# ~~~~~~~~~~~~~ env_java_var ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.25.x86_64
export JAVA_HOME
#
PATH=$JAVA_HOME:$JAVA_HOME/jre/bin:$PATH
export PATH
#
# ~~~~~~~~~~~~~ env_pgsql_var ~~~~~~~~~~~~~~~~~~~~~~~~~~
#
POSTGRES_HOME=/var/lib/pgsql
PGDATA=/var/lib/pgsql/data
MANPATH=/usr/share/man
LD_LIBRARY_PATH=/usr/lib64/pgsql
export PGDATA MANPATH LD_LIBRARY_PATH
#
PATH=/usr/bin:$MANPATH:$LD_LIBRARY_PATH:$PATH
export PATH
#
# ~~~~~~~~~~~~~ env_idempiere_var ~~~~~~~~~~~~~~~~~~~~~~~
#
IDEMPIERE_HOME=/opt/idempiere/idempiere-server
export IDEMPIERE_HOME
#
PATH=$IDEMPIERE_HOME:$IDEMPIERE_HOME/utils:$PATH
export PATH
#
#
# ~~~~~~~~~~~~~ end ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



***************** Iinstall Idempiere ********************

Install IdempiereServer

Unzip the server installer you downloaded or created,

cd $IDEMPIERE_HOME
unzip idempiereServer.gtk.linux.x86_64.zip

Navigate to the idempiere-server folder


***************** Import the Data ***********************

# cd utils
# sh RUN_ImportIdempiere.sh

*************** setup Idempiere server ******************

# setup.sh




参考までに  For reference
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

JAVA JAVA_HOME
/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.25.x86_64

ADempiere ADempiere_HOME /opt/idempiere/idempiere-server

key store pw ********


app svr application server d630fc18.lan
web port 8080
ssl 8443


db svr database server name d630fc18.lan
database PostgresSQL
database name(SID) idempiere
TNS *(idempiere)
database port 5432
system pw ********
database user name adempiere
database pw ********


mail svr mail server d630fc18.lan
mail info@d630fc18.lan
mail user info
mail pw ********

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Key store dialog
(ON) Common Name d630fc18.lan
(OU) Organization Unit root
(O) Organization AdempiereUser
(L) Local/Town MyTown
(S) State Cosmos
(C) Country (2 Char) JP

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


"BUILD SUCCESSFUL"
"Total time: 1 second"

と、出れば、成功です。
And, if appears this Msg, it is successful.


************ lunch Idempiere server *********************

# idempiere-server.sh


************* Starting Automatically on Boot **********

put launch-script in etc/rc.d/rc.local

これ、fc18では、OKですが、他のversionでは、???
It is OK in fc18, but in the other version,? ? ?

# vi /etc/rc.d/rc.local

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
#
#
# ~~~~~~~~~~~~~ Launch_idempiere-server ~~~~~~~~~~~~~~~~
#
# IDEMPIERE_HOME/idempiere-server.sh
#
# change directory and launch iDempiere Server
cd /opt/idempiere/idempiere-server
./idempiere-server.sh
#
# ~~~~~~~~~~~~~ end ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~





*************** setup new client ************************

setup new client

Login Login
name : System
pw : System
Role : System Administrator
Client : System
Organization :*

Menu > System Admin > Client Rules > Initial Client Setup Process

Client Name : ABC
Org Key : abc
Organization Name : ABC Co.,Ltd
Admin User Name : admin
Normal User Name : user
Currency : JPY
Country " Japan
Check All(5) Accounting Checkboxes
Chart of Account : AccountingUS.csv ............
.......... /idempiere/idempiere-server/data/import/AccountingUS.csv

Do you want to start the Process?

** OK
Client=ABC Organization=ABC Co.,Ltd Role=ABC Admin Role=ABC
User User/Contact=admin/admin User/ Contact=user/user
Calendar=ABC Calendar Element=ABC Account Account Element # 53
Accounting Schema=ABC UN/35 Japanese Yen Acct.Schema
Element=Organization Acct.Schema Element=Account Acct.Schema
Element=Product Acct.Schema Element=BPartner ---- Campaign=Standard
Sales Region=Standard Business Partner Group=Standard
Business Partner=Standard Product Category=Standard
Tax=Standard Product=Standard Sales Representative=user
Sales Representative=admin Project=Standard Cash Book=Standard


log off : System .......... ( System 内 )
log in : admin ............. ( ABC 内 )
pw : admin
Role : ABC admin
Client : ABC
Warehouse : Standard

and check anything
open window : Warehouse & Location
open window : Organization

and
open window : Import File Loader
< Select file to Load > AccountingUS.csv
Import Format : Accounting-Accounts

Click Check Button
to start loading into "temporary Import Account" window


check next
open window : Import Account
open window : Accounting Schema
open window : Calendar Year and Period


****************************************************************

2012年5月11日金曜日

vsftpd Automatic startup 553 Could not create file


vsftpd Automatic startup 553 Could not create file



             /etc/vsftpd/vsftpd.conf
            default のままで、upload download は、出来る。

            in default configuration, it can upload and download.


            ftpコマンド (Linux CUI client) を使うと、
                       「 553 Could not create file.」Msg が出る。

            if you use ftp_command (Linux CUI client),
               then Message appears  " 553 Could not create file."


            lftpコマンド (Linux CUI client) を使うと、問題なし。
         
            if you use lftp_command (Linux CUI client),
               then OK, no problem.

         
            初めてサーバー構築する者にとっては、
            ftp client を使う事が適当なのか否かさえ
            判断出来ず長時間費やしてしまう。
         
            For those who build server for the first time,
            it can not be determined,
            even whether it is appropriate to use the ftp client or not.
            and spent a lot of time.


            しかし、一方、一筋縄で行かず、いろいろ迷ってみる事は、
            周辺技術の習得にも成り、良い事かも知れません。
         
            However, the other hand,            
            it may be a good thing
            not to go in the tricky, and look lost,
            because you Will also learn many Related technologies.
           
           
SetUp FTP server (vsftpd@fc13.Linux)

1 目的 The purpose
        WindowsMe から、data をLinux に転送し、
Linuxにて、email にて送信する為。
        samba でも、出来るが、
FTP の方が、大掛かりに成らずに出来る。

The purpose is to transfer the data
from WindowsMe to Linux.
it can be by samba,
but it is easy to build by FTP. 


2 install vsFTPd by package manager.

3 vsFTPd configuration

        # 1: default のままでも、upload download は、出来る。

        #    in default configuration, it can upload download.


        # 2: ascii転送出来る様に

        #       can be transferred by ascii code
           
        ascii_upload_enable=YES
        ascii_download_enable=YES

        # Shift_JIS から、UTF-8 に、自動で encoding してくれる。


        # 3: recognise asynchronous ABORT requests
        async_abor_enable=YES

       
        # 4: uploaded by anonymous
        chown_uploads=YES
        chown_username=nobody


        # 5: タイムスタンプ時間を日本時間に合わせる

        #     use localtime
             
        use_localtime=YES


        # 6: log managemant

        xferlog_enable=YES
        xferlog_file=/var/log/vsftpd/xferlog
        xferlog_std_format=NO
        log_ftp_protocol=YES
        vsftpd_log_file=/var/log/vsftpd/vsftpd.log
        syslog_enable=NO
        dual_log_enable=YES


        # 7; Use passive mode

        pasv_promiscuous=YES
        #Range of ports when using passive mode
        pasv_min_port=50000
        pasv_max_port=50030


        # 8: access is limited to only within a Lan.

        #     wanにも、広げるのならば、ssh scp を使うべし。

        #     if it spread to wan, use ssh or scp.

        /etc/hosts.allow   
        vsftpd : 192.168.0. 127.0.0.1

        /etc/hosts.deny
        vsftpd : ALL

4 vsFTPd operation@root

        # /sbin/service vsftpd start
        # /sbin/service vsftpd stop
        # /sbin/service vsftpd restart
        # /sbin/service vsftpd status

        # chkconfig --list vsftpd
        # chkconfig vsftpd off
        # chkconfig vsftpd on



5 psコマンドでvsftpdのプロセスを確認、

   confirm the process of vsftpd by ps command.

        # ps -ef |grep vsftpd


6 select FTP client

it is easy to Upload and Download

        IExplorer ( each Windows version )
        lftp (Linux CUI client)
        gFTP (Linux GUI client)
        Kasablanca (Linux GUI client)

     
it is delicate to Upload and Download

        ftp (Linux CUI client // 553 Could not create file. Msg appears)
        Firefox (except adon soft)
        google Chrome
        (able to Download, but can not Upload )


7 directory inside FTPserver

                         FTP directory = "/home/*userDirectory*"
        anonymousFTP directory = "/var/ftp"
                 download directory = "/var/ftp/pub"
                     upload directory = "/var/ftp/uploads"


8 FTP client operation@each_User

        ftp://UserID:pw@FTPaddr/ ( IExplorer etc )

        lftp> open user
        lftp> ls cd pwd
         ftp> type ascii type binary
        lftp> get mget
        lftp> put mput
        lftp> quit exit bye


9: end

2012年4月25日水曜日

tcpdump -Xs 0


tcpdump 使い方

tutorial, How to use tcpdump


# tcpdump port http -Xs 0
# tcpdump -Xs 0

# tcpdump port 80
# tcpdump port 80 -X -s 0
# tcpdump port 80 -Xs 0



リアルタイムでパケットの内容、見られます。
-w オプションでファイルに保存し、後でも見られます。
nwの実験にも、使えます。
暗号化してないと、ID PW mail 見えてしまいます。

Contents of the packet, can be seen in real time.
-w option to save to a file, can be seen even after.
also you can use for nw experiments.
If you have not encrypted, it will see the ID PW mail.