Setting up server kalevala

This was done on 22 January 2014. Specifications:

Hardware Hewlett-Packard Proliant DL360 G5 (1U rack mount)
1 Power supply
2 Ethernet (gigabit)
DVD drive
Bays: 5 of 6 drives
IP address (to be determined)
Hostname kalevala
OS Ubuntu 12.04 LTS Precise Pangolin (64-bit)
CPU Intel Xeon 5150 64-bit CPU @ 2.66GHz (dual core)
Memory 8Gb
Disk 531Gb
(after system, reported base and extended software
i.e.: space for web pages and web applications)
Base web software (LAMP and WordPress)
Web server Apache HTTP Server 2.2.22
Database MySQL 5.5.29
Scripting PHP 5.3.10
WordPress (planned, but not presently installed)
Java Enterprise Edition (JEE) software
Java 1.7.0_25 64-bit (OpenJDK Runtime Environment IcedTea)
Server container Tomcat 6.0.35
MongoDB 2.4.9
 

Set-up details


Replacing dash with bash

[email protected]:~# pushd /bin
/bin ~
[email protected]:/bin# ll sh
lrwxrwxrwx 1 root root 4 Mar 29  2012 sh -> dash*
[email protected]:/bin# ll bash
-rwxr-xr-x 1 root root 955024 Apr  3  2012 bash*
[email protected]:/bin# rm sh
[email protected]:/bin# ln -s ./bash ./sh
[email protected]:/bin# ll sh
lrwxrwxrwx 1 root root 6 Jan 23 12:49 sh -> ./bash*

Replacing Java 6 with 7

[email protected]:~# dpkg --list | grep jdk
ii  openjdk-6-jre-headless            6b24-1.11.5-0ubuntu1~12.04.1     OpenJDK Java runtime, using Hotspot JIT (headless)
ii  openjdk-6-jre-lib                 6b24-1.11.5-0ubuntu1~12.04.1     OpenJDK Java runtime (architecture independent libraries)
[email protected]:~# apt-get update
Ign http://security.ubuntu.com precise-security InRelease
Ign http://us.archive.ubuntu.com precise InRelease
Ign http://us.archive.ubuntu.com precise-updates InRelease
Ign http://us.archive.ubuntu.com precise-backports InRelease
Get:1 http://security.ubuntu.com precise-security Release.gpg [198 B]
Hit http://us.archive.ubuntu.com precise Release.gpg
...
Hit http://us.archive.ubuntu.com precise-updates/multiverse Translation-en
Hit http://us.archive.ubuntu.com precise-updates/restricted Translation-en
Hit http://us.archive.ubuntu.com precise-updates/universe Translation-en
Hit http://us.archive.ubuntu.com precise-backports/main Translation-en
Hit http://us.archive.ubuntu.com precise-backports/multiverse Translation-en
Hit http://us.archive.ubuntu.com precise-backports/restricted Translation-en
Hit http://us.archive.ubuntu.com precise-backports/universe Translation-en
Fetched 3,951 kB in 32s (122 kB/s)
Reading package lists... Done
[email protected]:~# apt-get install openjdk-7-jdk
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  consolekit cpp cpp-4.6 cryptsetup-bin dbus-x11 dconf-gsettings-backend dconf-service fontconfig fontconfig-config gconf-service
...
update-alternatives: using /usr/lib/jvm/java-7-openjdk-amd64/bin/wsgen to provide /usr/bin/wsgen (wsgen) in auto mode.
update-alternatives: using /usr/lib/jvm/java-7-openjdk-amd64/bin/wsimport to provide /usr/bin/wsimport (wsimport) in auto mode.
update-alternatives: using /usr/lib/jvm/java-7-openjdk-amd64/bin/xjc to provide /usr/bin/xjc (xjc) in auto mode.
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
[email protected]:~# dpkg --list | grep jdk
ii  openjdk-6-jre-headless            6b24-1.11.5-0ubuntu1~12.04.1     OpenJDK Java runtime, using Hotspot JIT (headless)
ii  openjdk-6-jre-lib                 6b24-1.11.5-0ubuntu1~12.04.1     OpenJDK Java runtime (architecture independent libraries)
ii  openjdk-7-jdk                     7u25-2.3.10-1ubuntu0.12.04.2     OpenJDK Development Kit (JDK)
ii  openjdk-7-jre                     7u25-2.3.10-1ubuntu0.12.04.2     OpenJDK Java runtime, using Hotspot JIT
ii  openjdk-7-jre-headless            7u25-2.3.10-1ubuntu0.12.04.2     OpenJDK Java runtime, using Hotspot JIT (headless)
ii  openjdk-7-jre-lib                 7u25-2.3.10-1ubuntu0.12.04.2     OpenJDK Java runtime (architecture independent libraries)
[email protected]:~# apt-get purge openjdk-6-jre-headless
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  default-jre-headless* icedtea-6-jre-cacao* icedtea-6-jre-jamvm* openjdk-6-jre-headless* openjdk-6-jre-lib*
0 upgraded, 0 newly installed, 5 to remove and 150 not upgraded.
After this operation, 87.5 MB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 58149 files and directories currently installed.)
Removing default-jre-headless ...
Removing icedtea-6-jre-cacao ...
Removing icedtea-6-jre-jamvm ...
Removing openjdk-6-jre-headless ...
update-alternatives: using /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java to provide /usr/bin/java (java) in auto mode.
update-alternatives: using /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/keytool to provide /usr/bin/keytool (keytool) in auto mode.
update-alternatives: using /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/pack200 to provide /usr/bin/pack200 (pack200) in auto mode.
update-alternatives: using /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/rmid to provide /usr/bin/rmid (rmid) in auto mode.
update-alternatives: using /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/rmiregistry to provide /usr/bin/rmiregistry (rmiregistry) in auto mode.
update-alternatives: using /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/unpack200 to provide /usr/bin/unpack200 (unpack200) in auto mode.
update-alternatives: using /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/orbd to provide /usr/bin/orbd (orbd) in auto mode.
update-alternatives: using /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/servertool to provide /usr/bin/servertool (servertool) in auto mode.
update-alternatives: using /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/tnameserv to provide /usr/bin/tnameserv (tnameserv) in auto mode.
update-alternatives: using /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/jexec to provide /usr/bin/jexec (jexec) in auto mode.
Purging configuration files for openjdk-6-jre-headless ...
Removing openjdk-6-jre-lib ...
[email protected]:~# dpkg --list | grep jdk
ii  openjdk-7-jdk                     7u25-2.3.10-1ubuntu0.12.04.2     OpenJDK Development Kit (JDK)
ii  openjdk-7-jre                     7u25-2.3.10-1ubuntu0.12.04.2     OpenJDK Java runtime, using Hotspot JIT
ii  openjdk-7-jre-headless            7u25-2.3.10-1ubuntu0.12.04.2     OpenJDK Java runtime, using Hotspot JIT (headless)
ii  openjdk-7-jre-lib                 7u25-2.3.10-1ubuntu0.12.04.2     OpenJDK Java runtime (architecture independent libraries)

Other software...

[email protected]:~# dpkg --list | grep jdk
ii  openjdk-7-jdk                     7u25-2.3.10-1ubuntu0.12.04.2     OpenJDK Development Kit (JDK)
ii  openjdk-7-jre                     7u25-2.3.10-1ubuntu0.12.04.2     OpenJDK Java runtime, using Hotspot JIT
ii  openjdk-7-jre-headless            7u25-2.3.10-1ubuntu0.12.04.2     OpenJDK Java runtime, using Hotspot JIT (headless)
ii  openjdk-7-jre-lib                 7u25-2.3.10-1ubuntu0.12.04.2     OpenJDK Java runtime (architecture independent libraries)
[email protected]:~# dpkg --list | grep mysql
ii  libdbd-mysql-perl                 4.020-1build2                    Perl5 database interface to the MySQL database
ii  libmysqlclient18                  5.5.29-0ubuntu0.12.04.1          MySQL database client library
ii  mysql-client-5.5                  5.5.29-0ubuntu0.12.04.1          MySQL database client binaries
ii  mysql-client-core-5.5             5.5.29-0ubuntu0.12.04.1          MySQL database core client binaries
ii  mysql-common                      5.5.29-0ubuntu0.12.04.1          MySQL database common files, e.g. /etc/mysql/my.cnf
ii  mysql-server                      5.5.29-0ubuntu0.12.04.1          MySQL database server (metapackage depending on the latest version)
ii  mysql-server-5.5                  5.5.29-0ubuntu0.12.04.1          MySQL database server binaries and system database setup
ii  mysql-server-core-5.5             5.5.29-0ubuntu0.12.04.1          MySQL database server binaries
ii  php5-mysql                        5.3.10-1ubuntu3.5                MySQL module for php5
[email protected]:~# dpkg --list | grep php
ii  libapache2-mod-php5               5.3.10-1ubuntu3.5                server-side, HTML-embedded scripting language (Apache 2 module)
ii  php5-cli                          5.3.10-1ubuntu3.5                command-line interpreter for the php5 scripting language
ii  php5-common                       5.3.10-1ubuntu3.5                Common files for packages built from the php5 source
ii  php5-mysql                        5.3.10-1ubuntu3.5                MySQL module for php5
[email protected]:~# dpkg --list | grep apache
ii  apache2                           2.2.22-1ubuntu1.2                Apache HTTP Server metapackage
ii  apache2-mpm-prefork               2.2.22-1ubuntu1.2                Apache HTTP Server - traditional non-threaded model
ii  apache2-utils                     2.2.22-1ubuntu1.2                utility programs for webservers
ii  apache2.2-bin                     2.2.22-1ubuntu1.2                Apache HTTP Server common binary files
ii  apache2.2-common                  2.2.22-1ubuntu1.2                Apache HTTP Server common files
ii  libapache2-mod-php5               5.3.10-1ubuntu3.5                server-side, HTML-embedded scripting language (Apache 2 module)
[email protected]:~# dpkg --list | grep tomcat
ii  libtomcat6-java                   6.0.35-1ubuntu3.2                Servlet and JSP engine -- core libraries
ii  tomcat6                           6.0.35-1ubuntu3.2                Servlet and JSP engine
ii  tomcat6-admin                     6.0.35-1ubuntu3.2                Servlet and JSP engine -- admin web applications
ii  tomcat6-common                    6.0.35-1ubuntu3.2                Servlet and JSP engine -- common files
ii  tomcat6-docs                      6.0.35-1ubuntu3.2                Servlet and JSP engine -- documentation
ii  tomcat6-examples                  6.0.35-1ubuntu3.2                Servlet and JSP engine -- example web applications

MongoDB

[email protected]:~# apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /tmp/tmp.0pb2zSGV3y --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
gpg: requesting key 7F0CEB10 from hkp server keyserver.ubuntu.com
gpg: key 7F0CEB10: public key "Richard Kreuter " imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
[email protected]:~# echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | tee /etc/apt/sources.list.d/mongodb.list
deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen
[email protected]:~# apt-get update
[email protected]:~# apt-get install mongodb-10gen

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  mongodb-10gen
0 upgraded, 1 newly installed, 0 to remove and 150 not upgraded.
Need to get 88.0 MB of archives.
After this operation, 225 MB of additional disk space will be used.
Get:1 http://downloads-distro.mongodb.org/repo/ubuntu-upstart/ dist/10gen mongodb-10gen amd64 2.4.9 [88.0 MB]
Fetched 88.0 MB in 20s (4,332 kB/s)
Selecting previously unselected package mongodb-10gen.
(Reading database ... 57874 files and directories currently installed.)
Unpacking mongodb-10gen (from .../mongodb-10gen_2.4.9_amd64.deb) ...
Processing triggers for man-db ...
Processing triggers for ureadahead ...
Setting up mongodb-10gen (2.4.9) ...
Adding system user `mongodb' (UID 109) ...
Adding new user `mongodb' (UID 109) with group `nogroup' ...
Not creating home directory `/home/mongodb'.
Adding group `mongodb' (GID 117) ...
Done.
Adding user `mongodb' to group `mongodb' ...
Adding user mongodb to group mongodb
Done.
mongodb start/running, process 9162
[email protected]:~# dpkg --list | grep mongo
ii  mongodb-10gen                     2.4.9                            An object/document-oriented database

Modify Apache and Tomcat to coexist

[email protected]:~$ sudo apt-get install libapache2-mod-jk
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
  libapache-mod-jk-doc
The following NEW packages will be installed:
  libapache2-mod-jk
0 upgraded, 1 newly installed, 0 to remove and 150 not upgraded.
Need to get 158 kB of archives.
After this operation, 549 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu/ precise/universe libapache2-mod-jk amd64 1:1.2.32-1 [158 kB]
Fetched 158 kB in 1s (111 kB/s)
Selecting previously unselected package libapache2-mod-jk.
(Reading database ... 57909 files and directories currently installed.)
Unpacking libapache2-mod-jk (from .../libapache2-mod-jk_1%3a1.2.32-1_amd64.deb) ...
Setting up libapache2-mod-jk (1:1.2.32-1) ...
Enabling module jk.
To activate the new configuration, you need to run:
  service apache2 restart
[email protected]:~# vim /etc/tomcat6/server.xml
    (uncomment line: <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />)
[email protected]:~# ll /etc/apache2/mods-available/jk.load
-rw-r--r-- 1 root root 56 Jun 29  2005 mods-available/jk.load
[email protected]:~# ll /etc/apache2/mods-available/jk.conf
-rw-r--r-- 1 root root 4896 Jul 27  2011 /etc/apache2/mods-available/jk.conf
[email protected]:~# ll /usr/lib/apache2/modules/mod_jk.so
-rw-r--r-- 1 root root 444608 Jul 27  2011 /usr/lib/apache2/modules/mod_jk.so
[email protected]:~# service apache2 restart
 * Restarting web server apache2      apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
 ... waiting apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
                                                                         [ OK ]
[email protected]:~# service tomcat6 restart
 * Stopping Tomcat servlet engine tomcat6                                [ OK ]
 * Starting Tomcat servlet engine tomcat6                                [ OK ]