ppyordanov / Dynamic-Noise-and-Pollution-Map

A dynamically generated University of Glasgow noise and pollution campus map via the innovative Smart Citizen Kit developed in Barcelona, Spain by FabLab.
0 stars 0 forks source link

Server Configuration #59

Closed ppyordanov closed 9 years ago

ppyordanov commented 9 years ago

The server of the application needs to be configured in order to enable web application deployment. The chosen hosting provider is the cloud-based Digital Ocean:

https://www.digitalocean.com/

ppyordanov commented 9 years ago

The configuration involved installing the main system environment requirements. Some of the steps required significant trial and error as there is poor documentation for some software facets and the existing tutorials on the website ( https://www.digitalocean.com/community/tutorials ) are deprecated:

//The main terminal window was used for the execution of most of the operations although it would have been much more flexible to enable users to open multiple bash consoles especially when deploying new features/components:

console

This did not solve the issue as yum found broken packages during installation ("faulty dependency resolution /requires bin/sh/"). Using --skip -broken did not help either as it entirely discarded the mongo-db server installation and only reinstalled the client, which was working without issues before.

I decided to resort back to the manual configuration approach. Once I manually modified the bash script I was running to also install the server as specified on Mongo DB's website with a little tweaking ( http://docs.mongodb.org/manual/reference/program/mongod/#bin.mongod ), the database started running like a charm. Here is the final mongo.bash script:

apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
echo "deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen" | tee -a /etc/apt/sources.list.d/10gen.list
apt-get -y update
apt-get -y install mongodb-org

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
sudo apt-get update
sudo apt-get install mongodb-org-server

I configured it to automatically start on server power-on. Even the instructions for this are deprecated on the tutorial page ( https://www.digitalocean.com/community/tutorials/how-to-set-up-a-scalable-mongodb-database ). The recommended tool for the purpose is chkconfig which is no longer supported on Ubuntu. An analogue (as recommended on StackOverflow) is sysv-rc-conf which was used to configure the system for automatic DB instance initialization at startup:

With all of the steps above completed, the initial server configuration was complete. Not great first impressions of DigitalOcean, but will be using the cloud hosting as it is flexible and the best hosting option at the moment.

Some of the guides on the official website that were used can be seen below:

Question posted on DC's community forum seeking advice on how to proceed with DB setup (I did not find any questions about Spring MVC and Java WAF questions seem to be a rarity; most of the support provided is for Python-based systems such as Django as it looks like):

ppyordanov commented 9 years ago

The server has been experiencing some issues for the past few hours:

d

ppyordanov commented 9 years ago

Server is now running on port 80 by default and can be accessed at: http://178.62.100.239/

mvn -Djetty.port=80 jetty:run

ppyordanov commented 9 years ago

Update: the server is communicating through a domain name and can be accessed at: http://ugmap.me/

ppyordanov commented 9 years ago

This task has been completed and can be closed now.