How to Install and Run D-JEMS on - D-Link

outstandingmaskData Management

Nov 29, 2012 (4 years and 6 months ago)

305 views



How to
Install and Run

D
-
JEMS on
FreeBSD

Apr
il

2
9
, 201
1




Service Providers
Business Unit (SPBU)

D
-
Link Corporation




























Think before you print.

Copyright © 2010 D
-
Link Corporation all rights reserved.

All rights reserved. Printed
in the Taiwan,20
10

The information in this document is subject to change without notice. The statements, configurations,
technical data, and recopixelendations in this document are believed to be accurate and reliable, but are
presented without express or
implied warranty. Users must take full responsibility for their applications of
any products specified in this document.

The information in this document is proprietary to
D
-
Link Corporation.

The software described in this
document is furnished under a lic
ense agreement and may only be used in accordance with the terms of
that license. A supixelary of the Software License is included in this document.

Statement of Conditions

In the interest of improving internal design, operational function, and/or reliabil
ity,
D
-
Link Corporation

reserves the right to make changes to the products described in this document without notice.

D
-
Link Corporation

does not assume any liability that may occur due to the use or application of the
product(s) or circuit layout(s) descr
ibed herein.

In addition, the program and information contained herein are licensed only pursuant to a license
agreement that contains restrictions on use and disclosure (that may incorporate by reference certain
limitations and notices imposed by third pa
rties).


TABLE OF CONTENTS


1

PREFACE

................................
....................

1

1.1

D
OCUMENT
C
ONTROL

................................
................................
................................
................

1

1.2

R
EVIEW
ER

................................
................................
................................
..............................

1

1.3

R
EVISION
H
ISTORY

................................
................................
................................
...................

1

1.4

G
LOSSARY

................................
................................
................................
..............................

1

2

INSTALLATION ENVIRO
NMENT

................................
...

3

3

INSTALL JDK

................................
................

4

4

INSTALLATION AND CON
FIGURATION OF POSTGR
ESQL

...............

7

5

INSTALL
PGADMIN

................................
...........

11

6

CONFIGUR
E

DATABASE

................................
........

14

7

INSTALL D
-
JEMS

................................
............

17

8

RUN D
-
JEMS

................................
................

22

9

UNINSTALL D
-
JEMS

................................
..........

26

H
ow to Run
D
-
JEMS

on FreeBSD





D
-
Lin
k



1



1

Preface

1.1

Document Control

Document ID

How to
Run

D
-
JEMS base on FreeBSD

Document Name

How to
Run

D
-
JEMS base on FreeBSD


Document Version

1.0

Originator


Approval Date


Status


Approver


1.2

Reviewer

Department

Name/Title

Development Engineering


DevTest Engineering


Compliance




T
he departments and/or individuals listed above sho
uld be notified in advance and given a sufficient time period to
review this document. The project team determines requirements for approval according to the scope of the
project.

1.3

Revision History

Revision

Date


Author(s)

Major Changes

1.0

201
1
-
01
-
20

Sun

Release

1.0

2011
-
03
-
09

SY

English version





1.4

Glossary

List and describe here any and all terms and acronyms used in this document that may be unfamiliar to the
audience.

Term

Definition

JDK

Java Development Kit

D
-
JEMS

D
-
Link Java
-
based
Element Manage
ment System

PostgreSQL

Object
-
relation Database System

FreeBSD

FreeBSD is a freely available, full source 4.4BSD
-
Lite based release for
Intel

i386
™,

椴8S
™,

Pent極m


Pent極m

P牯,

䍥汥牯n


Pent極m

䥉I

Pentium

䥉䤬
Pent極m


⡯( c潭oat楢汥⤬

ue潮
™, and Sun

U汴ra卐䅒C

扡獥搠com灵瑥爠獹獴em献 䥴 楳i扡獥搠灲業a物汹
潮⁳ ftwa牥⁦牯r⁕⹃.⁂ rke汥y'猠䍓sd⁧牯異Ⱐ睩 h⁳ me⁥nhancement猠s牯r⁎et䉓BⰠ
H
ow to Run
D
-
JEMS

on FreeBSD





D
-
Lin
k



2



Term

Definition

OpenBSD, 386BSD, and the Free Software Foundation.


H
ow to Run
D
-
JEMS

on FreeBSD





D
-
Lin
k



3



2

Installation Environment

Software Version

Operating System

FreeB
SD 8.1

+ GNOME

Database

PostgreSQL 8.4.5

Database Tools

pgAdmin III 1.8.4

Java Environment

JDK 1.6.0

EMS

D
-
JEMS R
1.
0.0.
0


Environment

Setup






Figure1 Single PC mode


H
ow to Run
D
-
JEMS

on FreeBSD





D
-
Lin
k



4



3

Install JDK

The JDK is a development environment

for building applications, applets, and components using the
Java programming language.
It

includes the Java Runtime Environment (JRE) and command
-
line
development tools that are useful for developing applets and applications.


JDK will be

install
ed

via
ports installation on FreeBSD.
Here
JDK version is 1.6.0.

3.1.

Preparation before installation

3.
1.1
.

Due to the limitation of the license,
user
must download the following files manually from
http
://download.java.net/jdk6/6u3/promoted/b05/

jdk
-
6u3
-
fcs
-
src
-
b05
-
jrl
-
24_sep_2007.jar

jdk
-
6u3
-
fcs
-
bin
-
b05
-
jrl
-
24_sep_2007.jar

jdk
-
6u3
-
fcs
-
mozilla_headers
-
b05
-
unix
-
24_sep_2007.jar

3.
1.2
.

Download
the
patches from
http://www.eyesbeyond.com/freebsddom/java/jdk16.html
.

Press

the hyper
-
link


download the latest BSD JDK 1.6.0 patchset


and then
s
elect

patches 4

.

bsd
-
jdk16
-
patches
-
4.tar.bz2


3.
1.3
.

Download Diablo Caffe JDK 1.6.0
from


http://www.FreeBSDFoundation.org/cgi
-
bin/download?download=
diablo
-
caffe
-
freebsd
7
-
i386
-
1.6.0_07
-
b02.tar.bz2
.


diablo
-
caffe
-
freebsd7
-
i386
-
1.6.0_07
-
b02.tar.bz2


3.1
.4
.

Download
Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files

6

from

http://www.oracle.com/technetwork/java/javase/downloads/index.html
.


jce_policy
-
6.zip

Please put all the files downl
o
aded to
/usr/ports/distfiles
.

3.2.

I
nstallation

Please enter the folder
/usr/ports/java/jdk16

and use

make in
stall clean


to install JDK 1.6.0.


#cd /usr/ports/java/jdk16

#make install clean


The options will be shown, please select

DEBUG

,

POLICY


and

JAIL


as the figure below.

H
ow to Run
D
-
JEMS

on FreeBSD





D
-
Lin
k



5




After pressing

OK


button, it will display the Java License
Terms
as figure bel
ow.


Please keep pressing space
bar to the end and it will show

Do you
agree to the above license terms

[yes or no]
. Input

yes

, press Enter and wait for a while. JDK will be installed to FreeBSD.


After finishing the installation, please use

java

ve
rsion


to make sure the JDK 1.6.0 has been
installed successfully.
V
ersion should be

1.6.0_03
-
p4


H
ow to Run
D
-
JEMS

on FreeBSD





D
-
Lin
k



6




H
ow to Run
D
-
JEMS

on FreeBSD





D
-
Lin
k



7



4

Installation and configuration of PostgreSQL

4.1.

Install

PostgreSQL

Download PostgreSQL f
rom PostgreSQL official website

first.

ftp://ftp
-
archives.postgresql.org/pub/source/


postgresql
-
8.4.5
.tar.gz

Here PostgreSQL is v8.4.5.
Need to
create

a folder under root folder to store the installation file.

# mkdir /database

Use
FTP

tool to download installat
ion file and put it into /database.

U
n
compress it.


# tar zxvf postgresql
-
8.4.5
.tar.gz

It will build a new folder
postgresql
-
8.4.5
.

Change the folder to

postgresql
-
8.4.5

and start the installation.

The PostgreSQL will be installed to
/usr/local/pgsql
.


#
cd
postgresql
-
8.4.5

# ./configure

# make install clean

4.2.

Create User

for PostgreSQL

For security consideration,
PostgreSQL can

t be executed by root. Need to create a user for
PostgreSQL. Here to add a user

postgres


to FreeBSD.

# pw user add postgres

4.3.

Buil
d Database Cluster

Before can do anything, must initialize a database storage area on disk. A database cluster is a
collection of databases that is managed by a single instance of a running database server. To
initialize a database cluster, use the command

initdb
.

Need to create a folder for storing data first.

# mkdir /usr/local/pgsql/data

H
ow to Run
D
-
JEMS

on FreeBSD





D
-
Lin
k



8



Change the owner of the fol
d
er to let user “postgres” be able to
control

the data folder.

# chown postgres /usr/local/pgsql/data

After changing the owner of the folder
, please switch to user “pos
t
gres”

and s
tart
to
initializ
e

the
database cluster.

# su postgres

$ /usr/local/pgsql/bin/initdb
-
D /usr/local/pgsql/data

4.4.

Configuration Files Modification

4.4.1
postgresql.conf

$vi /usr/local/pgsql/data/postgresql.conf

Modify
#
Listen_Address=‘Localhost’

as below
.

*


means any IP address.

Listen_address=‘*’

Remove
the comment
sign

#
” from
#port=5432

as below


port=5432

Reference for
configuring the
document
postgresql.
conf
:

http://www.postgresql.org/docs/8.4/interactive/runtime
-
config
-
connection.html

4.4.2
pg_hba
.co
nf

Client authentication is controlled by the file

pg_hba.conf

in the data directory,
e.g.,

/usr/local/pgsql/data/pg_hba.conf

Add an entry for IPv4 local connection

to pg_hba.conf
:

$vi /usr/local/pgsql/data/pg_hba.conf


#IPv4 Local connections:

TYPE DA
TABASE


USER


CIDR
-
ADDRESS


METHOD

Host


all


all


127.0.0.1/32


trust

Host


all


all


192.168.0.142/24

trust


H
ow to Run
D
-
JEMS

on FreeBSD





D
-
Lin
k



9



CIDR
-
ADDRESS

Specifies the client machine IP address range that this record matches. It
contains an IP address in standard dotted d
ecimal notation and a CIDR mask length.

If
the
client machine
is local host, need to add an entry with CIDR
-
ADDRESS 127.0.0.1/32.

METHOD
s
pecifies the authentication method to use when connecting via this record.
Method “trust”
allows the connection uncond
itionally.
Method “md5” requires the client to
supply an MD5
-
encrypted password for authentication.

Reference for
configuring the
document
p
g_hba
.
conf
:

http://www.postgres
ql.org/docs/8.4/interactive/auth
-
pg
-
hba
-
conf.html

4.5.

Start PostgreSQL

Switch to user

postgres

.

S
tart PostgreSQL
. There

re two ways to start it.


#su postgres


$ /usr/local/pgsql/bin/p
ostgres

-
D /usr/local/pgsql/data

or

$ /usr/local/pgsql/bin/pg_ctl

D ../u
sr/local/pgsql/data start

Console message as below:

LOG: database system was shut down at 2011
-
03
-
04 09:08:33 CST

LOG: database system is ready to accept connections

LOG: autovacuum launcher started

Can use command ps aux | grep postgres to check if Postgr
eSQL

is running.


4.6.

Modify the password of the user

postgres


After starting PostgreSQL, switch to user

postgres


and
change

the password to

public


in
another
terminal

window
.

#su postgres

$/usr/local/pgsql/bin/psql

U postgres

Postgres=$ ALTER USER pos
tgres WITH ENCRYPTED PASSWORD ’public’


H
ow to Run
D
-
JEMS

on FreeBSD





D
-
Lin
k



10



Postgres=$
\
q

4.7.

Stop PostgreSQL


Use the command below to stop the PostgreSQL.

$/usr/local/pgsql/bin/pg_ctl

D /usr/local/pgsql/data stop



4.8.

Change Client Authentication

Change

the METHOD of the
document

pg_
hba.conf

to

md5

.

$vi /usr/local/pgsql/data/pg_hab.conf


#IPv4 Local connections:

TYPE DATABASE



USER


CIDR
-
ADDRESS


METHOD

Host



all

all

127.0.0.1/32


md5

Host



all

all

192.168.0.142/8

md5


After changing the client authentication

method, please start PostgreSQL again.

Can use PostgreSQL

s tool

pgAdmin III


to check if the authentication method works.

pgAdmin
III


will be introduced in next chapter.

4.9.

Start PostgresSQL during FreeBSD booting

Insert the line (
su postgres

c “/usr/l
ocal/pgsql/bin/pg_ctl

D
/usr/local/pgsql/data start”
)

into
/etc/rc.d/local
.


$vi /
etc/rc.d/local



H
ow to Run
D
-
JEMS

on FreeBSD





D
-
Lin
k



11



5

Install
PGADMIN

pgAdmin is the most popular and feature rich Open Source administration and develop
ment
platform for

PostgreSQL
.


5.1.

Install
wxWidgets GUI toolkit

(
wxGTK
)


Go to the folder
/usr/ports/x11
-
toolkits/wxgtk28
-
unicode

and install
t
he
wxWidgets GUI toolkit
.


#cd /usr/ports/x11
-
toolkits/wxgtk28
-
unicode

#
make install clean


For “Options for wxgtk2
-
unicode 2.8.x”, please leave them as default setting.




5.2.

Install
wxWidgets GUI toolkit contributed libraries


And then go to
/usr/ports/x11
-
toolkits/wxgtk28
-
unicode
-
contrib

and install t
he
wxWidgets GUI toolkit
contributed libraries
.


#cd
/usr/ports/x11
-
toolkits/
wxgtk28
-
unicode
-
contrib

#make install clean


5.3.

Link wxGTK to wx
-
config


#cd /usr/local/bin

H
ow to Run
D
-
JEMS

on FreeBSD





D
-
Lin
k



12



#ln wxgtk2u
-
2.8
-
config wx
-
config


5.4.

Install pgAdmin III


Download the
source code

of the pgAdmin III

from
http://www.postgresql.org/ftp/pgadmin3/release/
v1.8.4/src
. Here
pgAdmin III is
v1.8.4


Uncompress it, go to its folder and install pgAdmin III.


#tar zxvf pgadmin3
-
1.8.4.tar.gz

#cd pgadmin3
-
1.8.4

#./configure

#make install clean


5.5.

Run pgAdmin III


Go to
/usr/local/pgadmin3/bin

and execute it.


#cd /usr/local/pgadmin3/bin

#./pgadmin3


If console shows error message “
/libexec/ld
-
elf.so.1:Shared object
“libpq.so.5” not found, required by “pg
admin3


, please generate a static link
libpq.so.5.


#cd /usr/lib

#ln

s /usr/local/pgsql/lib/libpq.so.5


After generating the static link, please run it again to see if installation is successful.


#cd /usr/local/pgadmin3/bin

#./pgadmin3


H
ow to Run
D
-
JEMS

on FreeBSD





D
-
Lin
k



13




H
ow to Run
D
-
JEMS

on FreeBSD





D
-
Lin
k



14



6

Con
figur
e

Dat
abase

Before confgiuring the database, please
make sure
PostgreSQL
is running
. Please refer the

Installation and configuration of PostgreSQL


chapter.


1.

Run pgAdmin III


#cd /usr/local/pgadmin3/bin

#./pgadmin3


2.

Add a new PostgreSQL server

from
menu
File/A
dd Server…


Name:
localhost

(or any name)

Host:
localhost

(
localhost

for local PostgreSQL or remote PostgreSQL server IP
address)

Password: public



H
ow to Run
D
-
JEMS

on FreeBSD





D
-
Lin
k



15





3.

Create

a new
database “
nms
” for
D
-
JEMS


Expand the servers in the Object browser section. Right
-
click o
n the “Datab
ases” of the server
added for
D
-
J
EMS and select “New Database…” to create a new database.


Name:
nms

Encoding:
UTF8

Template:
template0



H
ow to Run
D
-
JEMS

on FreeBSD





D
-
Lin
k



16






H
ow to Run
D
-
JEMS

on FreeBSD





D
-
Lin
k



17



7

Install D
-
JEMS

Note:

P
lease use

chmod


command to change the software’s permissions

if it

s not exe
cutable.

# chmod 777 D
-
JEMS
-
R1.0.0.0B1435
-
FreeBSD
-
install
-
20110419


1.

Double click D
-
JEMS Install
ation

file

or execute it from terminal
, click
[
Yes
]

button
to
start

the
installation of
D
-
JMES, click
[
No
]

button to cancel the installation
.




Note
:

If your c
omputer has installed the D
-
JEMS software, you
need to

uninstall it

first
. P
lease refer
to

U
ninstall D
-
JEMS


section

to uninstall the D
-
JEMS.









H
ow to Run
D
-
JEMS

on FreeBSD





D
-
Lin
k



18





2.

Start D
-
JEMS setup, this will inst
all D
-
JEMS on the your computer
,

Click [Next] button to continue
the

installation,
or
click [Cancel] button to exit
the installation.




3.

Carefully read the license agreement, if you agree the license term, then check “I accept the terms
of the license agreement” and click [Next] button to continue installation, or click [
Cancel] button to
exit the installation
.


H
ow to Run
D
-
JEMS

on FreeBSD





D
-
Lin
k



19





4.

Click [Browse…] button to choose the D
-
JME installation folder, then click [Next] button
.

Default installation folder is
/usr/local/D
-
JEMS
.





5.

Select the setup type to install,

All packages
: the installation
will install both of D
-
JEMS Sever package and D
-
JEMS Client package,
then click [Next] button to start copying files
.

H
ow to Run
D
-
JEMS

on FreeBSD





D
-
Lin
k



20






Custom:

select to install D
-
JEMS Server package or/and D
-
JEMS Client package, then click [Next]
button to select components




6.

Click

[Next] button to start copying files
.

H
ow to Run
D
-
JEMS

on FreeBSD





D
-
Lin
k



21





7.

C
lick [Finish] button to finish

the
installation
.

I
f you check View Readme or Create Desktop Shortcut,
the readme document will be displayed, and the

Shutdown Server of D
-
JEMS


and

Start Server of
D
-
JEMS


and

Sh
utdown Server of D
-
JEMS


shortcut
s

will be create
d

on the desktop
.




H
ow to Run
D
-
JEMS

on FreeBSD





D
-
Lin
k



22



8

Run D
-
JEMS

1.

Before you start up the D
-
JEMS Server, please follow the ste
ps to configure
the IP address of the
database
.


1.1

Add PostgreSQL Server hostname definition on your D
-
JEMS Server


PostgreSQL_Server_IP_address DJEMSSQLSERVER


Edit 'hosts' file under '/etc', and add the setting

described above
.

For example:



N
ote:

If database is running on the same machine as D
-
JEMS server, IP address will be
127.0.0.1.


2.

Start D
-
JEMS Server

(1)

Double

click


Start Server of D
-
JEMS


shortcut on
the desktop

or
execute

/usr/local/D
-
JEMS/Server/bin/startnms.sh

(2)

The Tomcat window will
be shown

up
, and D
-
JEMS server
start
boot
ing

up
.

Server is up if

Server startup in x seconds


shows.




3.

Start D
-
JEMS client

After successfully starting D
-
JEMS server, you can start up D
-
JEMS client

(1)

Double click

Start Client of D
-
JEMS


shortcut on the desktop

or
execute

H
ow to Run
D
-
JEMS

on FreeBSD





D
-
Lin
k



23



/usr/local/D
-
JEMS/
Client
/
start
Client
.sh

(2)

System authentication dialog will pop up, enter the username and pa
ssword

Note: the default administrator account

s
username
is
'root' and password
is
'public'), when you
first time login the D
-
JEMS.




If D
-
JEMS server is not
in
local

host (127.0.0.1)
, you can click [Advanced] button to type
the new
D
-
J
EMS server host
IP
and port

number.




(3)

Click [Connect] button to access to D
-
JEMS
server. If login successfully, client main frame will be
shown.

H
ow to Run
D
-
JEMS

on FreeBSD





D
-
Lin
k



24





4.

Exit D
-
JEMS client

(1)

Select System
-
>Exit to exit D
-
JEMS client




(2)

The exit dialog will
be
pop
ped

up, click [Yes] button to
exit the D
-
JEMS client




5.

Shutdown D
-
JEMS server

(1)

Double click

Shutdown Server of D
-
JEMS


shortcut on the desktop

or execute
/usr/local/D
-
JEMS/Server/bin/
s
hutd
own
nms
.sh
.


(2)

The Shutdown Server of D
-
JEMS window will pop up, and prompts the system successfull
y
H
ow to Run
D
-
JEMS

on FreeBSD





D
-
Lin
k



25



stopped


H
ow to Run
D
-
JEMS

on FreeBSD





D
-
Lin
k



26



9

Uninstall D
-
JEMS

1.

Open Uninstall D
-
Link JEMS from the installation directory
.
D
efault is
/usr/local/D
-
JEMS

2.

C
lick
[
Yes
]

button
to
start

uninstalling
D
-
JMES, click
[
No
]

button to cancel the
uninstall
ation.




3.

Uninstalling the D
-
JEMS













H
ow to Run
D
-
JEMS

on FreeBSD





D
-
Lin
k



27




4.

Additional temporary and log file
s

can’t be removed automatically, click [Yes] button will remove
these temporary and log file,
or
click [No] button will keep t
hos
e files
.




5.

Click [Finish] button to complete the uninstall
ation