and I’ve built one in less than 90 minutes thanks to Mosso Cloud Server
Let me describe the procedure, it might be helpful for those of you willing to set-up a server instance on-demand.
Indeed, I’ve been working on a RESTful API for my wireless sensors. I was a newbie and despite many roadblocks, let me assure you that it is amazing how server/web services technologies are accessible nowadays!
Anyway, now that I have a home-brew Java web services running locally, I tried to load it on a cloud server and below is the procedure I followed.
Cloud server providers:
- Price: Mosso provides cloud server starting at about 15$ a month for 256MB RAM or 30$ for a 512MB.
- Ease-of-use: Creating a server instance is straight-forward with Mosso.
Once the server is created, server informations ( login/pw/ip ) are sent over by email. SSH connection gives you root permissions.
Whereas EC2 server configuration is more tricky
- Reliability, scalability, security: I would discuss those topics later on since I haven’t been confronted to them yet.
Should you have any opinion, please chime in!
Server creation with Mosso:
Launching a server instance with Mosso is a breeze. Once an account is registered, one can access a neat admin page whereby a new server instance can be created on-demand.
Several OS are available and I’ve picked up CentOS 5.2 because it was the first one in the list !
Below is a server creation page screenshot:
To install MySQL, just follow the procedure below:
- Connect to your server:
- Download and install MySQL thanks to ‘yum” command:
yum install mysql-server mysql mysql-devel
- Start MySQL:
- Add MySQL user:
CREATE USER 'yourUsername' IDENTIFIED BY 'yourPassword';
CREATE USER 'yourUsername'@'localhost' IDENTIFIED BY 'yourPassword';
GRANT ALL ON *.* TO 'yourUsername' IDENTIFIED BY 'yourPassword';
GRANT ALL ON *.* TO 'yourUsername'@'localhost' IDENTIFIED BY 'yourPassword';
- That’s it!
Tomcat 6, Java 1.6 and ActiveMQ 5.2:
Although ‘yum’ could be used, I’d rather download locally the packages for Tomact, Java and ActiveMQ.
Now, let’s schlep those packages to my cloud server:
- Download Tomcat 6 , Java 6 and ActiveMQ 5.2
- Uncompress and copy the binaries respectively under /usr/tomcat , /usr/java/ and usr/activemq/ as below:
scp -r /jdk1.6.0_05 root@yourIP:/usr/java/
scp -r 6.0.18/ root@yourIP:/usr/tomcat/
scp -r activemq5.2/ root@yourIP:/usr/activemq
Let’s create a .bash_profile file to set environment variables properly as below:
My .bash profile:
Start Tomcat and ActiveMQ:
- Start ActiveMQ ( if needed ):
- Start Tomcat:
- That’s it…. check whether http://yourIP:8080 loads the Tomcat admin page.
Within few steps away, one can easily create a server instance on-demand.
Mosso Cloud Server is very appealing and user-friendly. However I am contemplating to switch over to Amazon EC2 for evaluation purposes.
The reasoning is that Mosso does not provide a way to save home-brew server configurations with specific load of applications whereas Amazon EC2 with its AMIs ( Amazon Machine Instance ) may provide this useful capability.
I’ll keep you posted!