NED_ServerInstallationGuide_RedHat.docx - Nokia Developer ...

perchmysteriousΔιαχείριση Δεδομένων

30 Νοε 2012 (πριν από 4 χρόνια και 9 μήνες)

358 εμφανίσεις



STRICTLY
CONFIDENTIAL

1

(
13
)

NED Design Document

<TypeCodeHere>

<Date>


Copyright ©
2010

Nokia.

This material, including documentation and any related computer programs, is protected by copyright controlled by
Nokia. All rights are reserved. Copying,
including reproducing, storing, adapting or translating, any or all of this
material requires the prior written consent of Nokia. This material also contains confidential information, which may
not be disclosed to others without the prior written consent o
f Nokia.

Nokia is a registered trademark of
Nokia Corporation. S60 and logo is a trademark of Nokia Corporation.

Java and
all Java
-
based marks are trademarks or registered trademarks of Sun Microsystems, Inc. Other company and
product names mentioned herei
n may be trademarks or tradenames of their respective owners.


N
okia Education Delivery

NED Server

Installation
Guide














STRICTLY
CONFIDENTIAL

2

(
13
)

NED Design Document

<TypeCodeHere>

<Date>


© Nokia

Change history:


Version

Date

Status

Comments

0.1

201
1
.
06.17

Draft

Initial version
























STRICTLY
CONFIDENTIAL

3

(
13
)

NED Design Document

<TypeCodeHere>

<Date>


© Nokia

Table of contents:


0.

Glossary

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

4

1.

Introduction

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

4

2.

Installatio
n

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

5

2.1

JDK / JRE

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

5

2.2

Tomcat

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

6

2.3

PostgreSQL

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

7

2.4

PostgreSQL JDBC Driver

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

7

2.5

NED server binaries

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

7

3.

Configuration

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

9

3.1

PostgreS
QL DB configuration

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

9

3.2

Tomcat final configuration

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

13





































STRICTLY
CONFIDENTIAL

4

(
13
)

NED Design Document

<TypeCodeHere>

<Date>


© Nokia

0.

Glossary


Abbreviation


NED

Nokia Education Delivery

JDBC

Java DataBase Connectivity

CATALINA
_HOME

Path where Tomcat is ins
t
alled, i.e.
C:
\
Program
Files
\
Apache Software
Foundation
\
Tomcat 5.5

POSTGRESQL_HOME

Path where
PostgreSQL
is insalled, i.e.
C:
\
Program Files
\
PostgreSQL




1.

Introduction

T
his document introduces
the
way to set up

the

NED
platform
to create and
manage NED libraries.
Please note that
NED

server

uses external
tools
, like Tomcat
server
and
PostgreSQL database
, therefore

some advanced setup
issues
related to
those
are not covered
in this document
. We encourage
looking

for those components


original documentation

to find
a
nswer
s

to

some of your questions.



STRICTLY
CONFIDENTIAL

5

(
13
)

NED Design Document

<TypeCodeHere>

<Date>


© Nokia

2.

Installation


If Linux server is working in text mode only I recommend downloading required
files using Windows or Linux with X11 and then copy them to Linux server using
WinSCP or other sftp client. Sample WinSCP configu
ration is provided below, just
replace Host name with server address and provide user name / password to connect.




In order to use
NEDAdminConsole (old

NEDCatalogTool)

for creating and
managing NED libraries, you must first install it

together with

the software it depends on.
The required steps are outlined in the following subsections.



The installation requires the installation of several software packages necessary
for the functionality of the NEDCatalogTool. We recommend that the software
is

in
stalled in the following order
.


2.1

JDK / JRE

Required Java Runtime Environments for many platforms (or links to where they can
be found) are available at
http://www.oracle.com
/technetwork/java/javase/downloads/index.html
.



Download
latest release
Linux RPM java.



Copy package to installation directory (for example /usr/java which will be used in
this document ), change file to executable using command :

chmod

750

<jre_file>



STRICTLY
CONFIDENTIAL

6

(
13
)

NED Design Document

<TypeCodeHere>

<Date>


© Nokia

Than run it by executing it as command:

./<jre_file>

Now
java is extracted
and

needs some configuration so tomcat can use it.



Store
the exact path where the Java environment was installed

to $JAVA_HOME
environment variable using command

export

JAVA_HOME

=

/usr/java/<java

directory>


To do this automatically when system starts create shell script in /etc/profile.d
named for example java.sh and put above line to it.




A
dd java executable to /bin using symbolic link :

cd /bin


ln


s
$JAVA_HOME/
bin/java jav
a

2.2

Tomcat

Binary downloads of the
Tomcat

server are available
at
http://tomcat.apache.org/
.
We
recommend

using

th
e most recent
stable
release of
Tomcat 7. Detailed instructions for downloading and installing Tomcat
are available

at

http://tomcat.apache.org/tomcat
-
7.0
-
doc/setup.html
.


Here is quick way to install / configure Tomcat on Red Hat:




Download Tomcat binary tar.gz



Copy it to desired directory

for example /usr/tomcat



Extract :

tar

xf <tomcat .tar.gz>



Set environment variable CATALINA_HOME
so it point to directory you just
extracted:

export

CATALINA_HOME

=

/usr/
tomcat/<tomcat

directory
>

also it is advised to put above line to shell script in
/etc/profile.d/.


tomcat server can be managed using scripts in $CATALINA_HOME/bin


started using:


./startup.sh


And stopped using


./shutdown.sh

But before that install and configure Ned application.



STRICTLY
CONFIDENTIAL

7

(
13
)

NED Design Document

<TypeCodeHere>

<Date>


© Nokia

2.3

PostgreSQL

Binary downloads of the PostgreSQL

database are available
at
http://www.postgresql.org/
. We
recommend

using

the most recent
stable
release of
PostgreSQL

9
. Detailed instructions for downloading and installing
PostgreSQL
are
available

at
http://www.postgresql.org/docs/manuals/

At the time of writing, the latest release is 9.0.
4
.



D
ownload Linux RPM version
.



Copy it to Linux server.



Use the

RPM installer :

rpm

i <postgres rpm file>

We r
ecommend to use default values for installation (i.e. port 5432).

Postgres is now installed as service to use it type:

service
<
postgres
-
servicename
>

start

all services are located in /etc/init.d/ find correct service name there

cd /etc/init.d

find .

name ‘postgres*’

During
first run

you will need to specify the administrator password.
Please use the
password

t
ext2teach
’.


2.4

PostgreSQL JDBC Driver


JDBC

provides a standard set of interfaces to
SQL
-
compliant databases.

Latest

divers can be downloaded f
r
o
m
http://jdbc.postgresql.org/
.

Detailed instructions for downloading and installing PostgreSQL JDBC Diver are
available

at

http://jdbc.postgresq
l.org/documentation/docs.html



Po獴s牥r兌⁊ B䌠䑲楶e牳u獴sbe⁣ p楥i⁴o:

o

Tomcat 7.0
-

$CATALINA
_HOME
\
lib
\

directory.

o

Tomcat 5.5
-

$CATALINA
_HOME
\
common
\
lib
\

directory.


2.5

NED server binaries

All necessary binaries
and scripts
can be found

at
:
https://projects.forum.nokia.com/NED/files
.



NEDCatalogTool2
.war



N
ED
AdminConsol.war



tables_all.sql



STRICTLY
CONFIDENTIAL

8

(
13
)

NED Design Document

<TypeCodeHere>

<Date>


© Nokia







STRICTLY
CONFIDENTIAL

9

(
13
)

NED Design Document

<TypeCodeHere>

<Date>


© Nokia

3.

Configuration

After successful installation of
Tomcat and PostgreSQL
,

user can start
to configure
the
NED

s
erver
.




If using Tomcat 7.0:

Tomcat
7.0
must be
additionally
configured
.

T
o do so open
the

serve
r
.
xml


file located in
$CATALINA
_HOME
\
conf, find <Host> element
s

and add
the
copyXML = “true”

attribute
. It should look like
this:


<
Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"

copyXML="true"

>

Tomcat 5.5 has this attribute set to true by default.



A
ll NED server
binaries (
NEDCatalofTool2.war and
NEDAdminConsole.war)

must be copied into
$CATALINA
_HOME
\
webapps directory.

3.1

Linux Firewall

Red Hat by default uses iptables firewall. It must be configured to allow remote
connections to server. Easiest way to continue installation process is to stop iptables :

service iptables stop

Details of iptables

configuration are not in the scope of this document.

3.2

PostgreSQL DB configuration

The n
ext

thing whi
ch needs to be configured is a P
ostgre
SQL

database. To
configure
it

you

can use

the


pgAdmin III


application
to connect remotely to database
installed on
Linux Server.

Firstly modify pg_hba file to allow remote connection if installed postgres using rpm
installer postgres will be located in /opt/postgres directory:

cd /opt/postgres/9.0/data

insert following line into file:

host all all <ip address of machin
e with pgadmin> md5


Restart postgres after changing configuration

service <postgres service name> restart

In order to start the setup procedure you will need to log in

to the database. In
order to do this, double
-
click on PostgreSQL9.0 (
<server address>
:5432
).
Use the
password used during the installation which is

text2teach

.

After successful
l

database
login
,
please create
a
new ‘Role’.

A

‘Role’ can be
added in ‘LoginRoles’ branch
.

To do this, right click on
login roles
and select

a

new login role



STRICTLY
CONFIDENTIAL

10

(
13
)

NED Design Document

<TypeCodeHere>

<Date>


© Nokia



Please use
ned

for

the name of the Role

and
ned

for the password.


R
emember
the
password as
it

will be needed in the next steps.






The d
atabase can be created from
the
‘Databases’ branch.
Right click on the
Databases menu to create a new database.
Please select the following values



Name: ned



Owner: ned



L
eave
a
ll other values
as
they are




STRICTLY
CONFIDENTIAL

11

(
13
)

NED Design Document

<TypeCodeHere>

<Date>


© Nokia












Creating
the
tables is a last thing to do. Please select
the
previously created
database


n
ed


and
select
‘Tools’
-
> ‘Query
tool’ (Ctrl
+
E)

from menu
or from
toolbox (
this
is the small bubble with the SQL letters inside)

Execute arbitrary SQL queries’.



STRICTLY
CONFIDENTIAL

12

(
13
)

NED Design Document

<TypeCodeHere>

<Date>


© Nokia



In the new window
load

the

provided
script ‘tables_
all.sql’ (
File
-
>Open…) and
execute
it (
Query
-
>Execute).

When the
script completes
,

all

required

tables and
function will be created in local database
, on the screen some status messages will be
displayed
, i.e.



STRICTLY
CONFIDENTIAL

13

(
13
)

NED Design Document

<TypeCodeHere>

<Date>


© Nokia

Query result with 1 row discarded.

Query result with 1 row discarded.

Query result with 1 row discarded.

Query result with 1 row discarded.

Query returned successfully with no result in 1315 ms.


3.3

Tomcat final configuration

Finally,

configure
Tomcat

use
the
previously created database.

If in
the
previous steps you have used default
values
and recommended names
and passwords you can skip this
chapter. Your

application is ready to use, just start
the
Tomcat server again.

In {TOMCAT_HOME}
\
conf
\
Catalina
\
localhost
\

-

you can find


NEDConsoleAdmin
.xml


and ‘NEDCatalogTool2.xml’

files
.

You

need to
change
the
default passwords
t
o
the
one
s

you

selected during PostgreSQL DB

’Role’ creation.

In
the following
lines:

<Resource auth="Container" driverClassName="org.postgresql.Driver" maxActive="200"
maxIdle="100" maxWait="
-
1" name="jdbc/postgres"
password=
”ned”

type="javax.sql.DataSource"
url="
jdbc:postgresql://127.0.0.1:5432/
n
ed" username="
n
ed"/>


<Realm className="org.apache.catalina.realm.JDBCRealm"
connectionURL="jdbc:postgresql://127.0.0.1:5432/
n
ed?user=
n
ed&amp
;
password=
ned”

driverName="org.postgresql.Driver" roleNameCol="role" userCredCol
="password" userNameCol="name"
userRoleTable="userroles" userTable="users"/
>


change
the
highlighted passwords. Now the environment is ready to use. Just
start Tomcat as described in 3.0 Configuration chapter.

To validate if

the

installation is
successful,

try open
NEDAdminConsole (
http://localhost:8080/NEDAdminConsole

) with
your web
browser (
admin/text2teach)
.