Ubuntu-8.10_Install_Guide.doc - About ftp.heanet.ie

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

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

357 εμφανίσεις

Table of Contents

1

Add Packages & Update Current Packages

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

2

2

Enable Syntax Highlighting for VIM

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

2

3

Switch Java to Sun Java 6

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

2

4

Tomcat 6 Configuration

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

2

4.1

Edit the default file for Tomcat 6

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

2

4.2

Edit the tomcat
-
users.xml

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

3

4.3

Configure SSL

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

4

4.4

Edit the

server.xml

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

5

4.5

Restart Tomcat 6 Service

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

6

5

Configure PostgreSQL

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

6

5.1

Configure Access

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

6

5.1.1

Change postgres User Password

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

6

5.1.2

Import Additional Schema

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

6

5.1.3

Edit the postgresql.conf

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

7

5.1.4

Edit the pg_hba.conf

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

7

5.2

Restart PostgreSQL

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

8

5.3

Configure Database for Logicaldoc

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

8

6

Install Logicaldoc
................................
................................
................................
....................

8

6.1

Up
load WAR File

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

8

6.2

Upload Email Plugin

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

9

6.3

Create Directory for Logicaldoc Documents

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

9

6.4

Setup Logicaldoc

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

9

7

Configure Email Plugin

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

13

8

Modify File Size for Uploads to Logicaldoc

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

13

8.1

Modify the web.xml

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

13

8.2

Restart Tomcat 6 Server
................................
................................
................................

13

9

Configur
e Windows XP Workstations for Webdav
................................
..............................

13

10

Configure Backups
................................
................................
................................
............

17

10.1

Create Mount Directory and Verify Connectivity

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

17

10.2

Configure Share to Automatically Reconnect

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

17

10.2.1

Create File with for the User Credentials

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

17

10.2.2

Edit the fstab File

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

17

10.3

Create Backup Script & Schedule Cron Job

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

17

10.3.1

Create the B
ackup Script

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

17

10.3.2

Add Script to cron.d

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

18

11

Troubleshooting

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

19

11.1

CIFS problems

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

19

11.1.1

Version of CIFS

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

19

11.1.2

Enable Debug for CIFS

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

19


1

Add Packa
ges & Update Current Packages

It is assumed that the user is logged in and has sudo privilege. These steps are performed from
the command line.

1.

Type
sudo apt
-
get install pgadmin3 vim sun
-
java6
-
jdkp
, and then press
Enter

2.

Type in the password for the user a
ccount

3.

Press
Enter

to accept the install of the new packages.

4.

Press
Tab

to highlight
OK
, then press Enter to accept
terms for Configuring sun
-
java6
-
jre

5.

Move the cursor to the left to select
Yes

for agreeing with the

DLJ

license terms

6.

Type
sudo apt
-
get upda
te
, press
Enter

7.

Type
sudo apt
-
get upgrade
, press
Enter

8.

Press
Enter

to accept the install of the packages that will be upgraded

2

Enable Syntax Highlighting for VIM

1.

Type
sudo vim /etc/vim/vimrc
, press
Enter

2.

Scroll down and find the commented out line
“syntax
on

3.

Press
I

to edit, delete the


4.

Press
Esc
, then type
:wq

5.

Press
Enter

3

Switch Java to Sun Java 6

1.

Type
update
-
java
-
alternatives

l

to verify that Sun Java 6 is installed

2.

Type
sudo
update
-
java
-
alternatives
-
s java
-
6
-
sun


4

Tomcat 6 Configuration

4.1

Edit the defaul
t file for Tomcat 6

1.

Type
sudo vim etc/default/tomcat6
, press
Enter

2.

Press
I

to edit

3.

Remove the
#

to uncomment
TOMCAT6_USER=tomcat6

4.

Remove the
#

to uncomment
JAVA_HOME=/usr/lib/jvm/openjdk
-
6
-
jdk

5.

Change
JAVA_HOME=/usr/lib/jvm/openjdk
-
6
-
jdk

to
JAVA_HOME=/usr/l
ib/jvm/java
-
6
-
sun

6.

Remove the
#

to uncomment
CATALINA_BASE=/var/lib/tomcat6

7.

Remove the
#

to uncomment

JAVA_OPTS="
-
Djava.awt.headless=true
-
Xmx128M"

8.

Change

Xmx128M

to

Xmx
900M

9.

Remove the
#

to uncomment
TOMCAT6_SECURITY=yes

10.

Change
TOMCAT6_SECURITY=yes

to
TOM
CAT6_SECURITY=
no

11.

Press
Esc
, then type
:wq

12.

Press
Enter

4.2

Edit the tomcat
-
users.xml

1.

Type
sudo vim /etc/tomcat6/tomcat
-
users.xml
, press
Enter

2.

Scroll down to the
<tomcat
-
users>

section

3.

Press
I

to edit

4.

Remove the comments
<!
--

and

--
>




5.


Delete the line
<role r
olename="role1
"/>

6.

Under the last role type the following
<role rolename="admin"/>
, press
Enter

7.

Type

<role rolename="manager"/>

8.

Delete the

line
<user username="both" password="tomcat"
roles="tomcat,role1"/>
, and
<user username="role1" password="tomcat"
role
s="role1"/>

9.

Under the last user type the following
<user username="ldocadmin"
password="password" roles="admin "/>
, press
Enter

10.

Type
<user username="ldocmanager" password="password"
roles="manager"/>

Note: Change the password to something other than passwo
rd!

11.

Change the password for the
tomcat

user




1.

Press
Esc
, then type
:wq

2.

Press
Enter

4.3

Configure SSL

These steps will create a
c
ertificate request that can
will either be a self signed certificate

or
use
the certificate request and have it signed be another
Certification Authority

(CA). Notes will be
mentioned for creating a certificate request that will be singed by an Entrust CA
.

1.

Type
cd /etc/tomcat
6
, press
Enter

2.

Type
sudo
keytool
-
genkey
-
v
-
alias tomcat
-
keyalg RSA
-
keysize 2048
-
keystore
tomcat.jks
-
sto
repass logicaldoc
-
keypass logicaldoc

3.

Press
Enter

4.

Type in the correct value for the prompts that follow.

Note: The first and last name needs to be the FQDN that will be used to access the
server. Use the Entrust Reference number for the first & last name

and leave the other
fields blank

if certificate request is going to be signed by an Entrust CA.




5.

Type
yes
, press
Enter




6.

Type
sudo
keytool
-
certreq
-
alias tomcat
-
keyalg RSA
-
keystore tomcat.jks
-
storepass logicaldoc
-
file tomcat
-
ssl
-
request.p10

7.

Press

Enter

8.

To generate a self signed certificate type
sudo
keytool
-
selfcert
-
alias tomcat
-
keystore tomcat.jks
, press
Enter
. Otherwise take the tomcat
-
ssl
-
request.p10 to get
signed by a CA.

Note: The next steps are only if the certificate request was signed
by a CA. It will be
assumed that the signed certificate request and CA certificates have been uploaded to
the server directory /etc/tomcat6

9.

Type
sudo
keytool
-
trustcacerts
-
import
-
keystore tomcat.jks
-
storepass
logicaldoc
-
alias SubCA
-
file subca.crt

10.

Pre
ss
Enter

11.

Type
sudo keytool
-
trustcacerts
-
import
-
keystore tomcat.jks
-
storepass
logicaldoc
-
alias RootCA
-
file rootca.crt

12.

Press
Enter

13.

Type
sudo keytool
-
import
-
trustcacerts
-
alias tomcat
-
keystore tomcat.jks
-
storepass logicaldoc
-
file logicaldoc.crt

14.

Pre
ss
Enter

4.4

Edit the server.xml

1.

Type
sudo /etc/tomcat6/server.xml
, press
Enter

2.

Press
I

to edit

3.

Scroll down to
Connector port="8080" protocol="HTTP/1.1"

4.

Change
port=

8080


to
port=”80”

5.

Change
redirectPort="8443"

to
redirectPort="443"




6.

Scroll down to
<Connec
tor port="
8
443" protocol="HTTP/1.1"
SSLEnabled="true"

7.

Remove the
<!
--

and
<
--

around the Connector section

8.

Change
port="
8
443"

to
port="443"

9.

Amend to the end of the Connector section
keystoreFile="/etc/tomcat6/tomcat.jks"
keystorePass="logicaldoc"




10.

Scrol
l down to
<Connector port="8009" protocol="AJP/1.3"
redirectPort="8443" />

11.

Change
redirectPort="8443"

to
redirectPort="
443"



12.

Press
Esc
, then type
:wq

13.

Press
Enter

4.5

Restart Tomcat 6 S
ervice

1.

Type
sudo /etc/init.d/tomcat6 restart

2.

Press
Enter

5

Configure Postgre
SQL

5.1

Configure Access

5.1.1

Change postgres User P
assword

1.

Type
sudo
-
u postgres psql template1
, press
Enter

2.

Type
ALTER USER postgres with encrypted password '
N3wP@ssw0rd!
';

3.

Press
Enter

4.

Type
\
q

5.

Press
Enter

5.1.2

Import Additional Schema

1.

Type
sudo
-
u postgres psql < /usr
/share/postgresql/8.3/contrib/adminpack.sql

2.

Press
Enter

3.

Type
sudo
-
u postgres psql < /usr/share/postgresql/8.3/contrib/pgcrypto.sq
l

4.

Press
Enter

5.1.3

Edit the postgresql.conf

1.

Type
sudo vim /etc/postgresql/8.3/main/postgresql.conf
, press
Enter

2.

Scroll down to
#lis
ten_addresses = 'localhost'

3.

Press
I

to edit

4.

Remove the
#

to uncomment
listen_addresses = 'localhost'

5.

Change
listen_addresses = 'localhost'

to
listen_addresses = '
*
'

6.

Scroll down to
#password_encryption = on

7.

Remove the
#

to uncomment
password_encryption = on

8.

Press
Esc
, then type
:wq

9.

Press
Enter

5.1.4

Edit the pg_hba.conf

1.

Type
sudo vim /etc/postgresql/8.3/main/pg_hba.conf

2.

Scroll down toward the bottom

3.

Press
I

to edit

4.

Use the
#

to comment

out all the lines

5.


host all all ::1/128 md5

6.

lo
cal all all ident sameuser

7.

local all postgres ident sameuser

8.

Type

the following lines on the last line:

local all postgres
trust

local all

postgres
127.0.0.1/32…………..md5

host all all 10.60.100.0 255.255.255.0 md5

Note: This will be the local network IP range that the server is on.




9.

Press
Esc


10.

T
ype
:wq

11.

Press
Enter

5.2

Restart PostgreSQL

1.

Type
sudo /etc/init
.d/postgresql
-
8.3 restart

2.

Press
Enter

5.3

Configure Database for Logicaldoc

1.

Type
sudo

u postgres createdb logicaldocdb
, press
Enter

2.

Type
sudo

u postgres psql logicaldocdb

Note: If prompted for a password, use the postgres password

3.

Press
Enter

4.

Type
CREATE ROL
E logicaldocg
roup

INHERIT
;

5.

Press
Enter

6.

Type
CREATE ROLE logicaldocs
ervice LOGIN NOINHERIT;

7.

Press
Enter

8.

Type
GRAN
T logicaldocgroup TO logicaldocs
ervice;

9.

Press
Enter

10.

Type
ALTER USER
logicaldocs
ervice

with encrypted password
'
LogicaldocPassword
';

11.

Press
Enter

12.

Type
ALTER DATABASE logicaldocdb OWNER TO

logicaldocg
roup;

13.

Press
Enter

14.

Type
\
q
, press
Enter

6

Install Logicaldoc

6.1

Upload WAR File

1.

Open a web browser such as Firefox or Internet Explorer

2.

Type
https:/
/logicaldoc.mydomain.com/manager/html
, press
Enter

Note: Point to the server that hosts Logicaldoc using either the FQDN or the IP
address
.

3.

Type

ldocmanager

for the username, then type in the password

4.

Click
OK

5.

Scroll down to the
Deploy

section

6.

Click
Brows
e

to select the WAR to upload

7.

Browse to where logicaldoc.war is located, click
Open

8.

Click
Deploy

9.

Message:
OK

should be displayed up top




6.2

Upload Email Plugin

1.

Type
cd
, press
Enter

2.

Type
wget
http://downloads.sourceforge.net/logicaldoc/logicaldoc
-
email
-
4.0.0
-
plugin.zip?modtime=1232733948&big_mirror=0
, press
Enter

3.

Type
sudo cp logicaldoc
-
email
-
4.0.0
-
plugin.zip
/var/lib/tomcat6/webapps
/logicaldoc/WEB
-
INF/plugins/

4.

Type
sudo chown tomcat6:tomcat6
/var/lib/tomcat6/webapps/logicaldoc/WEB
-
INF/plugins/ logicaldoc
-
email
-
4.0.0
-
plugin.zip

5.

Press
Enter

6.3

Create Directory for Logicaldoc Documents

1.

Type
sudo mkdir /opt/Logicaldoc/
, press
Enter

2.

Type
sud
o chown tomcat6:tomcat6 /opt/Logicaldoc
, press
Enter

6.4

Setup Logicaldoc

1.

Open the web browser

2.

Type Type
https://logicaldoc.mydomain.com/logicaldoc/setup
, press
Enter

Note: Point to the server t
hat hosts Logicaldoc using either the FQDN or the IP
address

3.

Type
ldocadmin

for the user name and then type the password

4.

Click
OK

5.

Type
/opt/
Logicaldoc, and then c
lick

Continue




6.

Enable the radio button for
External database management system
, click
Conti
nue




7.

Select
PostgreSQL 8.x

for the database type, fill in the information for the server,
user name, password, and then click
Continue




8.

Type in the information for the mail server, click
Continue




9.

Click the
Click here

button to proceed with loggin
g into Logicaldoc



7

Configure Email Plugin

1.

Open a web browser

2.

Type Type
https://logicaldoc.mydomain.com/logicaldoc/setup
, press
Enter

Note: Point to the server that hosts Logicaldoc using e
ither the FQDN or the IP
address

3.

Type
ldocadmin

for the user name and then type the password

4.

Click
OK

5.

Proceed through the setup steps using the same data used previously to configure
Logicaldoc

6.

After finishing the setup login to Logicaldoc

7.

Under the
Admini
stration

column verify that
E
-
mail Accounts

is now present under
the
E
-
mail

option

8

Modify File Size for Uploads to Logicaldoc

8.1

Modify the web.xml

1.

Type
sudo vim /var/lib/tomcat6/webapps/logicaldoc/WEB
-
INF/web.xml
, press
Enter

2.

Scroll down to the section

<cont
ext
-
param>

<param
-
name>com.icesoft.faces.uploadMaxFileSize</param
-
name>

<param
-
value>52428800</param
-
value>

</context
-
param>

3.

Press
I

to edit

4.

Change the param
-
value
52428800

to
5242880000

5.

Press
Esc
, then type
:wq

6.

Press
Enter

8.2

Restart Tomcat 6 Server

1.

Type
sud
o /etc/init.d/tomcat6 restart

2.

Press
Enter

9

Configure Windows XP Workstations for Webdav

1.

Double click on
My Computer

2.

Navigate to
C:
\
Windows
\
system32

3.

Locate and double click on
webfldrs.msi

4.

Click on
Select reinstall mode




5.

Uncheck
Repair all detected reinst
all problems

6.

Check the following:

a.

Force all files to be reinstalled, regardless of checksum or version

b.

Verify that required user registry entries are present

c.

Verify that required machine registry entries are present

d.

Validate shortcuts




7.

Click
OK

8.

Click
Re
install

9.

Click
OK




10.

Click
Start
=>
Run

11.

Type
regedit
, click
OK

12.

Naviagate to:

HKEY_LOCAL_MACHINE
\
SYSTEM
\
CurrentControlSet
\
Services
\
WebClient
\
Parameters




13.

Right

click i
nto the right field and choose
New

from the context
-
menu

14.

Choose
DWord
-
Value

15.

N
ame the new v
alue
UseBasicAuth

16.

Right

click on
UseBasicAuth

and choose
Modify

17.

Change the value
0

(disabled) to
1

(enabled)




18.

Click
OK

19.

Click
File

in the top left corner, select
Exit

to close the Registry

20.

Click
Start
=>
Shut Down

21.

Select
Restart
, click
OK

22.

After the compute
r Reboots, login to the workstation

23.

Double click on
My Network Places

24.

Double click on
Add Network Place

25.

A wizard will start, click
Next

26.

Select
Choose another network location
, click
Next

27.

Type
https://logicaldoc.mydomain.com:443/logicaldoc/webdav/store
, click
Next

Note: Point to the server that hosts Logicaldoc using either the FQDN or the IP
address

28.

Click
Yes

to proceed for the first Security Alert

29.

Click
Yes

to proceed for the seco
nd Security Alert

30.

Type in the username and password used for authenticating to Logicaldoc, click
OK




31.

Type
Logicaldoc

for the name of the network place, click
Next

32.

Click
Finish

33.

Click
Yes

to accept the first Security Alert

34.

Click
Yes

to accept the second S
ecurity Alert

35.

Type in the username and password used for authenticating to Logicaldoc, click
OK

10

Configure Backups

It is assumed that a share has been created and a user account has been provided that will allow
read/write access to the share. The share th
at will be used is called backups, and the user
name/password is Logicaldoc/password1234!. An IP or FQDN can be used to connect to the
share.

10.1

Create Mount Directory and Verify Connectivity

1.

Type
sudo mkdir /mnt/
mountpoint
, press
Enter

2.

Type
sudo mount
-
t ci
fs
-
o username=logicaldoc,p
assword=password1234!
//10.60.50.10
/backups /mnt/mountpoint

3.

Type
ls

l /mnt/mountpoint
, and press
Enter

to verify mount point to Windows
share

10.2

Configure
Share to
Automatically Reconnect

10.2.1

Create File with for the User Credentials

1.

T
ype
sudo vim
/etc/credentials.windows

2.

Press
I

to add text

3.

Type
username=
l
ogicaldoc
, press
Enter

4.

Type
password=
password1234!

5.

Press the
Esc

button

6.

Type
:wq
, press
Enter

7.

Type
sudo
chmod 600 /etc/credentials.windows
, press
Enter

8.

Type
sudo chown root /etc/crede
ntials.windows
, press
Enter

10.2.2

Edit the fstab File

1.

Type
sudo vim /etc/fstab
, press
Enter

2.

Press
I

to add text

3.

Go to the end of the last line and press
Enter

4.

Type
the following:

#Mounts windows share drive backups

//10.60.50.10
/backups /mnt/mountpoint cifs
cred
entials=/etc/credentials.windows,mand 0 0

5.

Press the
Esc

button

6.

Type
:wq
, press
Enter

10.3

Create Backup Script & Schedule Cron Job

10.3.1

Create the Backup Script

1.

Type
sudo vim /usr/local/bin/logicaldoc
-
backup.sh
, press
Enter

2.

Press
I

to add text

3.

Type the following

#!/
bin/bash

BACKUP_DIR="/mnt/mountpoint"

LOGICALDOCFILES="/opt/logicaldoc"

FSBACKUP="logicaldocFS"

DBBACKUP="logicaldocDB"

DATABASE="logicaldocdb"

PGUSER="postgres"

DATE=`date '+%F'
-
'%H%M'`

/usr/bin/pg_dump "
-
U" $PGUSER $DATABASE | gzip >
$BACKUP_DIR/$DBBACKU
P.$DATE.gz

tar czvf $BACKUP_DIR/$FSBACKUP.$DATE.tar.gz $
LOGICALDOCFILES




4.

Press

the
Esc

button

5.

Type
:wq
, press
Enter

6.

Type
sudo chmod +x /usr/local/bin/logicaldoc
-
backup.sh
, press
Enter

10.3.2

Add Script to cron.d

1.

Type
sudo vim /etc/cron.d/l
ogicaldoc
-
backup
, pre
ss
Enter

2.

Press
I

to add text

3.

Type

the following:

# This script will backup the Logicaldoc File system and the PostgreSQL

0 1 * * * root

/usr/local/bin/
l
ogicaldoc
-
backup.sh




4.

Press the
Esc

button

5.

Type
:wq
, press
Enter

11

Troubleshooting

11.1

CIFS problems

11.1.1

Vers
ion of CIFS

To find out what version of CIFS is installed use the command below.

1.

Type
modinfo cifs

2.

Press
Enter

11.1.2

Enable Debug for CIFS

1.

Type
sudo

s
, press
Enter

2.

Type
echo 1 > /proc/fs/cifs/cifsFYI
, press
Enter

3.

Type
exit
, press
Enter

4.

Type
more /var/log/syslog
, press
Enter

to see what is being logged in Syslog