How to run your own Cloud on a PC using OpenStack on Ubuntu 12.04

For one of our research projects we wanted to have our own OpenStack private cloud on one of our university servers. But before trying that, I was curious to set it up on my own laptop. So I installed DevStack on Ubuntu 12.04 and played a bit with it. DevStack is the recommended option if you want to try OpenStack on your own PC. It provides the same OpenStack dashboard using which you can manage your cloud setup. In this post, I’m going to provide a step by step guide to set up a DevStack cloud.
If you already have Ubuntu 12.04 running on your PC, you can try DevStack on that. But it can make changes to your system. Therefore I didn’t want to take the risk and I went for a VM. So I installed VMware player 5 on Windows 7 and installed Ubuntu 12.04 on VMware. If you want to try the same, my previous post might be useful for you. Once you have your Ubuntu 12.04 running follow these steps.
Step 1 : Install git on Ubuntu using the following command
1
sudo apt-get install git
Step 2 : Install DevStack by following 3 simple steps given here. You’ll be asked to enter some passwords for different components. It will take some time to complete stack.sh execution and you’ll see following printed on your console.
1
2
3
4
5
6
7
Horizon is now available at http://x.x.x.x/
Keystone is serving at http://x.x.x.x:5000/v2.0/
Examples on using novaclient command line is in exercise.sh
The default users are: admin and demo
The password: xxxx
This is your host ip: x.x.x.x
stack.sh completed in 168 seconds
Step 3 : Access the dashboard by using the Horizen (name of OpenStack dashboard) URL printed above. Log in as ‘admin’ using the printed password.
Step 4 : Before creating any instances on our cloud, we have to set up some security options. Go the the ‘Project’ tab on the left and click on the ‘Access & Security’ link as shown below.
shot1
You can either edit the existing “default” security group or add a new security group. Then click on “Edit Rules” on the relevant gropu and first add a rule to enable incoming SSH connections on port 22.
shot2
Then add another rule to enable incoming ping requests on ICMP protocol. Set -1 for ICMP type and code.
shot3
So the 2 rules added should look like this.
shot4
Then we have to generate a key pair which will be used to authenticate users into the VMs. Click on the “Keypairs” tab on “Access & Security” page and click on “Create Keypair”.
shot7
Then provide a name for the keypair and click on “Create Keypair”.
shot8
Download and save the key file. It will be used to log into the VMs from outside.
shot9
Step 5 : Now we can create an instance using the security group and the key pair we created. Click on “Instances” link under “Project” tab and click on “Launch Instance”.
shot5
In the UI popped up, you can configure the instance by providing a name, size etc. under “Details” tab.
shot6
Under “Access & Security” tab we can select the key pair and the security group we created above.
shot10
After configuring the instance, click on “Launch”. Then wait till the instance comes into “Running” state.
shot11
Once the instance is up and running, you can check the log and the console.
shot12
Once you get the console, log into the instance by providing the default username and password printed on the console.
shot13
When you check the log, you’ll see something like this.
shot14
Now we have successfully created an instance on our DevStack cloud.
Step 6 : Finally if you want to SSH your instance from outside using the key file downloaded, use the following commands.
1
2
3
$ chmod 0600 MyKey.pem
$ ssh-add MyKey.pem
$ ssh -i MyKey.pem cirrois@10.0.0.2

Change default ‘From’ email name from www-data in PHP

I’ve been seeing up an Amazon EC-2 server with Debian Squeeze and used tasksel to install Web Server and Mail Server. Like all things debian, this worked pretty well after the installation completed and everything ‘just worked’ however I wasn’t happy with the default from name and email address assigned to emails sent by PHP – www-data .

I discovered a quick and simple fix to change these defaults for all mail sent with PHP:

Open /etc/php5/apache2/php.ini and set

Commandsendmail_path = ‘/usr/sbin/sendmail -t -i -fno-reply@my.domain.com -Fno-reply’

Restart apache

sendmail_path = ‘/usr/sbin/sendmail -t -i -fno-reply@my.domain.com -Fno-reply’

amazon server login with .ppk file in ubuntu

To convert the ppk file into openssh standard, we need to install the puttygen tool:

sudo apt-get install putty

Here is the ppk key that we want to convert:
Now,convert the ppk file into openssh standard using the following command:

puttygen private.ppk -o private-key -O private-openssh

Where “private.ppk” is the PuTTY .ppk file to convert, and “private-key” is the name of the converted key file.

After the execution of above command:

Now, you can easily access the remote server using the openssh standard private key:

ssh -i private-key username@remote-server-ip

Nodejs,express,jade,mangodb

This is the link get base and start nodejs to create a website

http://cwbuecheler.com/web/tutorials/2013/node-express-mongo

To instal mango db in ubuntu

http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/

To learn a jade and see the output in html use this link

http://jade-lang.com/demo/

Monogo db Queries excution types

https://github.com/variety/variety

link to refer nodejs

1) http://blog.modulus.io/nodejs-and-express-create-rest-api
2) http://www.ibm.com/developerworks/library/wa-nodejs-polling-app/
3) https://www.udemy.com/blog/node-js-express-tutorial/
4) http://scotch.io/tutorials/javascript/scraping-the-web-with-node-js
5) http://scotch.io/tutorials/javascript/creating-a-single-page-todo-app-with-node-and-angular