IS480 Fresh Install Guide (VM)

coldwaterphewServers

Nov 17, 2013 (3 years and 8 months ago)

192 views

IS480 Fresh Install Guide (VM)


Version Numbers

Ubuntu 10.04 LTS 32
-
bit

OpenJDK 1.6.0_24

Tomcat 7.0.37

Eclipse Juno

Subclipse 1.8

JavaHL 1.7

Apache 2.2.14

MySQL
5.1.66
-
0ubuntu0.10.04.3

PHP 5.3.2
-
1ubuntu4.18

phpmyadmin
3.3.2deb1ubuntu1

MongoDB 2.2.2

RockMongo 1.1.5

ElasticSearch 0.20.4


Ubuntu 10.04 32
-
bit

Download
ubuntu
-
10.04.4
-
desktop
-
i386.iso

from
http://releases.ubuntu.com/lucid/
.

Run the iso in the VM and install as the main OS.

Set password to
breadcrumbs
.

Update everything using the Update Manager.


Parallels Tools (for Mac only)

Run
sudo apt
-
get install linux
-
headers
-
$(uname
-
r) build
-
essential
.

Install Parallels Tools.


OpenJDK 6

Run
sudo apt
-
get
install
openjdk
-
6
-
jdk
.


Tomcat 7.0.37

Download the core
.tar.gz
from
http://tomcat.apache.org/download
-
70.cgi
.

Navigate to the Downloads folder.

Unpack the tar with
tar xvzf apache
-
tomcat
-
7.0.37
.tar.gz
.

Run
sudo mv apache
-
tomcat
-
7.0.37
/

/usr/share/tomcat7
.

Run
sudo gedit /etc/environment
.

Update the path as follows:

JAVA_HOME="/usr/lib/jvm/java
-
6
-
openjdk"

JRE_HOM
E="/usr/lib/jvm/
java
-
6
-
openjdk
/jre"

PATH="...(other path):$JAVA_HOME:$JRE_HOME"

Run
sudo gedit
/usr/share/tomcat7/bin/catalina.sh
.

Update the shell file:

#!/bin/sh

JAVA_HOME="/usr/lib/jvm/java
-
6
-
openjdk "

JRE_HOME="/usr/lib/jvm/java
-
6
-
openjdk/jre"

# Licensed to the Apache Software Foundation (ASF)...

Run
sudo gedit /usr/share/tomcat7/conf/tomcat
-
use
rs.xml
.

Update tomcat
-
users as follows:

<tomcat
-
users>

<role rolename="manager
-
gui"/>

<role rolename="manager
-
script"/>

<role rolename="manager"/>

<role rolename="admin
-
gui"/>

<role rolename="admin
-
script"/>

<role rolename="admin"/>


<user
username="breadcrumbs" password="breadcrumbs
" roles="manager
-
gui,admin
-
gui,manager,admin,manager
-
script,admin
-
script"/>

</tomcat
-
users>

To test the server, run
sudo /usr/share/tomcat7/bin/startup.sh

and go to
http://localhost:8080/
.


Eclipse Juno

32
-
bit

and SVN

Download the Java EE 32
-
bit Edition from
http://www.eclipse.org/downloads
.

Unzip, go into root
and n
avigate to the eclipse folder in terminal.

Run
apt
-
ge
t install libsvn
-
java

Run
echo "deb http://opensource.wandisco.com/ubuntu lucid svn17" | sudo tee
/etc/apt/sources.list.d/svn.list

Run
wget
-
q http://opensource.wandisco.com/wandisco
-
debian.gpg
-
O
-

| sudo apt
-
key
add
-

Run
apt
-
get update

Run
apt
-
get
dist
-
upgrade

Run
gedit eclipse.ini

Add the following line under
-
vmargs
:

-
Djava.library.path=/usr/lib/jni

Go to
Help
-
> Install New Software
.

Add
http://subclipse.tigris.org/update_1.8.x

as Subclipse

1.8. Install the Subclipse
plugin.

Go to
File
-
> New
-
> Other
.

Select
SVN
-
> Checkout Projects from SVN
.

Create a new location
https://subversion.assembla.com/svn/is480_breadcrumbs/
.

Select the backend folder and click
Next
.

Make sure the project will be configured under the
New Project Wizard
.

Select Web
-
> Dynamic Web Project.

Enter a project name

and use Tomcat 7 as the runtime.

Select
src

as the source folder, and
main/webapp

as th
e content folder.

Go to
Window

-
> Preferences
-
> Team
-
> Ignored Resources
.

Add the patterns
.settings
,
.project

and
.classpath
.


Go to the project
Properties
-
> Builders

-
> New
.

Select
Ant
, click
Ok

and name it
Ant_Builder
.

Under
Main
, point
Buildfile

to
build.xml

and
Base Directory

to the project root folder.

Under
Targets
, choose the
d
efault

target

for
Manual

and
Auto
-
Build
.


LAMP

(latest version)

Run
sudo apt
-
get install lamp
-
server^
.

Set the MySQL root password as
breadcrumbs
.

Run
sudo apt
-
get install
libapache2
-
mod
-
auth
-
mysql phpmyadmin
.

IMPT: Use spacebar to select
apache2
. Make sure there’s an * next to it.

When asked if configuring of new database is needed, select
Yes
.

Enter the MySQL root password
breadcrumbs
.

Set the phpmyadmin password as
breadcrumbs
.

Apps can now be put in
/var/www
.


mod_p
roxy

(optional)

Go into root.

Run
apt
-
get install libapache2
-
mod
-
proxy
-
html

Run
apt
-
get install libxml2
-
dev

Run
gedit /etc/apache2/httpd.conf

Insert the following lines:

LoadModule proxy_module
/usr/lib/apache2/modules/mod_proxy.so

LoadModule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so

LoadModule headers_module /usr/lib/apache2/modules/mod_headers.so

LoadFile /usr/lib/libxml2.so


ProxyPass /breadcrumbs http://localh
ost:8081/breadcrumbs

ProxyPassReverse /breadcrumbs http://localhost:8081/breadcrumbs

Run
/etc/init.d/apache2 restart

Run
gedit /usr/share/tomcat7/conf/server.xml

Insert the following lines under the Connector section:

<Connector port="8081"
protocol="HTTP/1.1"


connectionTimeout="20000"


address = "0.0.0.0"


proxyName =
"
current
-
ip
-
address
"


proxyPort="80" />

Run
gedit /etc/php5/conf.d/mcrypt.ini

Change
#

to
;


MongoDB (latest version)

Run
sudo bash
-
c "echo 'deb http://downloads
-
distro.mongodb.org/repo/ubuntu
-
upstart
dist 10gen' >> /etc/apt/sources.list"

Run
sudo apt
-
key adv
--
keyserver keyserver.ubuntu.com
--
recv 7F0CEB10

Run
sudo apt
-
get update

Run
sudo apt
-
get install mongodb
-
10gen

N
ote: dbpath is /var/lib/mongodb


php_mongo extension

Go into root.

Run
apt
-
get install php
-
pear php5
-
dev

Run
pecl install mongo

Run
nano /etc/php5/conf.d/mongodb.ini

Assign the following directives:

extension=mongo.so

[mongo
]

; If the driver should reconne
ct to mongo

mongo.auto_reconnect = true

; Whether to allow persistent connections

mongo.allow_persistent = On

; Maximum number of persistent connections (
-
1 means unlimited)

mongo.max_persistent =
-
1

; Maximum number of links (persistent and
non
-
persistent,
-
1 means unlimited)

mongo.max_connections =
-
1

; Default host for mongo connection

mongo.default_host = www.example.com

; Default port for mongo database

mongo.default_port = 42

; When saving files to the database, size of chunks to split t
hem into

mongo.chunk_size = 1024

; Specify an alt

character to $ to use for special db functions ($set, $push, $exists, etc.)

mongo.cmd = "$"

Run
/etc/init.d/apache2 restart


RockMongo

1.1.5

Download
RockMongo 1.1.5

from
http://www.
r
ockmongo.com/downloads
.

Unzip the file
.

Run
sudo mv rockmongo /var/www

Note: Login and password are both
admin
.


Enable oplogs

Note: There should be an fyp database inside already.

Run
sudo gedi
t /etc/mongodb.conf
.

Set the following lines at the end of the file:

replSet=fyp

oplogSize=100

Run
sudo service mongodb restart

Run the mongo shell and switch to the fyp database.

Run
rs.initiate()


ElasticSearch

0.20.4

Download ES 0.20.4

from
http://www.elasticsearch.org/download/
.

Unzip the file and delete the zip file.

Go into root and navigate to the

Downloads

folder in terminal.

Run
apt
-
get install curl python
-
software
-
properties
-
y

Run
mv elasticsearch
-
* /usr/local/share/elasticsearch

Run
curl
-
L http://github.com/elasticsearch/elasticsearch
-
servicewrapper/tarball/master
| tar
-
xz

Run
mv *servicewrapper*/service /usr/local/share/elasticsearch/bin/

Run
rm
-
Rf *servicewrapper*

Run
/usr/local/share/elasticsearch/bin/service/elasticsearch install

Run
ln
-
s `readlink
-
f /usr/local/share/elasticsearch/bin/service/elasticsearch`
/usr/local/bin/rcelasticsearch

Run
/etc/init.d/elasticsearch start

Navigate to
/usr/local/share/elasticsearch
.

Run
bin/plugin
-
install elasticsearch/elasticsearch
-
mapper
-
attachments/1.6.0

Run
bin/plugin
-
url https://github.com/downloads/richardwilly98/elasticsearch
-
river
-
mongodb/elasticsearch
-
river
-
mongodb
-
1.6.1.zip
-
install river
-
mongodb

Run
/etc/init.d/elasticse
arch restart

Exit root. Type

into terminal:

curl
-
XPUT 'http://localhost:9200/_river/mongodb/_meta'
-
d '{


"type": "mongodb",


"mongodb": {


"db": "
fyp
",


"collection": "
restaurant
"


},


"index": {


"name": "mongoindex",


"type": "
restaurant
"


}

}'