EzDevInfo.com

amazon-ec2

A Ruby Gem that gives you full access to several of the Amazon Web Services API from your Ruby/Ruby on Rails apps grempe/amazon-ec2 · GitHub amazon-ec2 - a ruby gem that gives you full access to several of the amazon web services api from your ruby/ruby on rails apps

Where is my httpd.conf file located apache [closed]

I am new to Apache and I wanted to ask, where is my httpd.conf file located? I am running a server from the amazon ec2 (elastic compute cloud) and I can't find my apache config. Can someone please tell me where it is located? Thanks!


Source: (StackOverflow)

Find out the instance id from within an ec2 machine

How can I find out from within an ec2 machine (user root) what my instance id is?


Source: (StackOverflow)

Advertisements

SSH to Elastic Beanstalk instance

I just signed up for Amazon's new Elastic Beanstalk offering and loving it. What I can't figure out is how to SSH to a Beanstalk instance. I don't have a private key because Beanstalk generated the instance on my behalf. Ideas?

Thanks, Benno


Source: (StackOverflow)

Trying to SSH into an Amazon Ec2 instance - permission error

This is probably a stupidly simple question to some :)

I've created a new linux instance on Amazon EC2, and as part of that downloaded the .pem file to allow me to SSH in.

When I tried to ssh with:

ssh -i myfile.pem <public dns>

I got:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for 'amazonec2.pem' are too open.
It is recommended that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: amazonec2.pem
Permission denied (publickey).

Following this post I tried to chmod +600 the pem file, but now when I ssh I just get:

Permission denied (publickey).

What school-boy error am I making here? The .pem file is in my home folder (in osx). It's permissions look like this:

-rw-------@   1 mattroberts  staff    1696 19 Nov 11:20 amazonec2.pem

Source: (StackOverflow)

What data is stored in Ephemeral Storage of Amazon EC2 instance?

I am trying to stop a Amazon EC2 instance and get the warning message

Warning: Please note that any data on the ephemeral storage of your instance will be lost when it is stopped.

My Question

  1. What data is stored in ephemeral storage of an Amazon EC2 instance?

Source: (StackOverflow)

Add EBS to Ubuntu EC2 Instance

I'm having problem connecting EBS volume to my Ubuntu EC2 Instance.

Here's what I did:

  1. From the Amazon AWS Console, I created a EBS 150GB volume and attached it to an Ubuntu 11.10 EC2 instance. Under the EBS volume properties, "Attachment" shows: "[my Ubuntu instance id]:/dev/sdf (attached)"

  2. Tried mounting the drive on the Ubuntu box, and it told me "mount: /dev/sdf is not a block device"

    sudo mount /dev/sdf /vol

  3. So I checked with fdisk and tried to mount from the new location and it told me it wasn't the right file system.

    sudo fdisk -l

    sudo mount -v -t ext4 /dev/xvdf /vol

    the error:

    mount: wrong fs type, bad option, bad superblock on /dev/xvdf, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so

    "dmesg | tail" told me it gave the following error:

    EXT4-fs (sda1): VFS: Can't find ext4 filesystem

I also tried putting the configurations into /etc/fstab file as instructed on http://www.webmastersessions.com/how-to-attach-ebs-volume-to-amazon-ec2-instance, but still gave same not the right file system error.

Questions:

Q1: Based on point 1 (above), why was the volume mapped to 'dev/sdf' when it's really mapped to '/dev/xvdf'?

Q2: What else do I need to do to get the EBS volume loaded? I thought it'll just take care of everything for me when I attach it to a instance.


Source: (StackOverflow)

Permission denied (publickey) when SSH Access to Amazon EC2 instance

I want to use my Amazon ec2 instance but faced the following error:

Permission denied (publickey).

I have created my key pair and downloaded .pem file.

Given:

chmod  600 pem file.

Then, this command

 ssh -i /home/kashif/serverkey.pem  ubuntu@ec2-54-227-242-179.compute-1.amazonaws.com

But have this error:

          Permission denied (publickey)

Also, how can I connect with filezilla to upload/download files?


Source: (StackOverflow)

What are the respective advantages/limitations of Amazon RDS vs. EC2 with MySQL?

I realize a couple of basic differences between the two, i.e.

  1. EC2 is going to be cheaper

  2. RDS I wouldn't have to do maintenance

Other than those two, are there any advantages to running my database from RDS as opposed to a separate EC2 server acting as a MySQL server. Assuming similar instance sizes, are both going to run into the same limitations in terms of being able to handle a load?

To give you a little bit more info about my use, I've got a database, nothing too big or anything (biggest table 1 million rows), just high SELECT volume.


Source: (StackOverflow)

Setting up FTP on Amazon Cloud Server

I am trying to set up FTP on Amazon Cloud Server, but without luck... I search over net and there is no concrete steps how to do it...

Since there is no steps on web, can someone help me finding it or write it here?

I usually use dedicated server or shared hosting, but I am not that good with those Cloud servers...

I found those commands to run:

$ yum install vsftpd
$ ec2-authorize default -p 20-21
$ ec2-authorize default -p 1024-1048
$ vi /etc/vsftpd/vsftpd.conf
#<em>---Add following lines at the end of file---</em>
    pasv_enable=YES
    pasv_min_port=1024
    pasv_max_port=1048
    pasv_address=<Public IP of your instance>
$ /etc/init.d/vsftpd restart

But I don't know where to write them...

Help?


Source: (StackOverflow)

Do on-demand Mac OS X cloud services exist, comparable to Amazon's EC2 on-demand instances? [closed]

Amazon's EC2 service offers a variety of Linux and Windows OS choices, but I haven't found a service offering a similar "rent by the hour" service for a remote Mac OS X virtual machine. Does such a service exist? (iCloud looks to be just a data storage service, rather than a service allowing remote login, etc.)

Such a virtual machine service would be very useful for testing software in a reproducible, "neutral" location.


Update 1: Just to be clear, I'm referring to services similar to EC2's on-demand or spot instances, where the machine (or virtual machine) is rented per hour, rather than typical web hosting services that involve a monthly subscription. As @Erik has pointed out, there are several good options for that route. As my searches for queries for OS X hosting with terms like "per hour" or "hourly rates" are turning up very little (basically, just labor fees for hourly repairs), I am inclined to believe that this doesn't exist for some reason. If it did, it seems reasonable that such a firm would advertise for precisely these queries.

Update 2: I see that this question is getting a lot of views over time. If someone encounters a change in the situation, i.e. that there is a provider of such services, please post and I will accept that answer instead.


Source: (StackOverflow)

"Public key certificate and private key doesn't match" when using Godaddy issued certificate

I'm trying to install a GoDaddy SSL certificate on a new load balancer I'm setting up on Amazon AWS. I originally created the certificate at Godaddy using the keytool program for direct installation on a Glassfish 3.1 server (Amazon linux ami). I had no problems getting that setup directly on the server. I now need to move the certificate from the web server to the new load balancer. Amazon requires the private key and certs to be in PEM format, so I used the "rekey" tool at GoDaddy to create new certs. When I load those in the load balancer setup screen on AWS Mgmt Console, I get the error message: "Public Key Certificate and Private Key doesn't match."

Here is how I'm creating the keys:

$ openssl genrsa -des3 -out private.key 2048
$ openssl req -new -key private.key -out apps.mydomain.com.csr

I then submit the .csr file to GoDaddy during the "rekey" process. Once the rekey is complete, I download the 2 newly created certs (apps.mydomain.com.crt & gd_bundle.crt). I download them selecting (Apache) as the type of server (I've also tried "other" and "Cpanel" but the all look to be the same).

At this point, I remove the encryption from the private.key file by using the following command:

$ openssl rsa -in private.key -out private.pem

At this point, I go back into the AWS Mgmt console, create the load balancer, add the secure server redirect and put the contents of the following files in the respective fields on the screen where it asks to setup the ssl certificate:

private.pem --> Private Key
apps.mydomain.com.crt --> Public Key Certificate
gd_bundle.crt --> Certificate Chain

When I click the "continue button" I get the error "Error: Public Key Certificate and Private Key doesn't match."

-Is there a way that I can test that I'm getting a valid error message from Amazon? It seems odd to me that the keys wouldn't match when I'm following GoDaddy's instructions pretty closely.

I've tried creating the private.key file without RSA encryption prior to creating the .csr and that doesn't seem to make any difference.

I'm also assuming that the .crt files I'm downloading from GoDaddy are in .PEM format, but I'm not sure how to verify this.

Any ideas?


Source: (StackOverflow)

When to use Amazon Cloudfront or S3

Are there use cases that lend themselves better to Amazon cloudfront over s3 or the other way around? I'm trying to understand the difference between the 2 through examples.


Source: (StackOverflow)

Can you attach Amazon EBS to multiple instances?

We currently use multiple webservers accessing one mysql server and fileserver. Looking at moving to the cloud, can I use this same setup and attach the EBS to multiple machine instances or what's another solution?


Source: (StackOverflow)

Auto Shutdown and Start Amazon EC2 Instance

Can I automatically start and terminate my Amazon instance using Amazon API? Can you please describe how this can be done? I ideally need to start the instance and stop the instance at specified time intervals every day.


Source: (StackOverflow)

On EC2: sudo node command not found, but node without sudo is ok

I have just installed nodejs on a new EC2 micro instance.

I installed it normally, ./configure -> make -> sudo make install.

Problem: When I run "node" under ec2-user, it runs perfectly. When I run "sudo node", it fails.

I found out that node is in:

[ec2-user@XXXX ~]$ whereis node
node: /usr/local/bin/node /usr/local/lib/node

and the current path is

[ec2-user@XXXX ~]$ echo $PATH
/usr/local/bin:/bin:/usr/bin:/opt/aws/bin:/home/ec2-user/bin

but, the sudo path is

[root@ip-10-112-222-32 ~]# echo $PATH
/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/aws/bin:/root/bin

then I tried to edit the root PATH to include the paths to node, so "node" runs when I'm logged in as root - but it still won't work when I log in as ec2-user and run "sudo node".

I need this to install npm properfly. Any idea on how to include the node path while running "sudo node"?


Source: (StackOverflow)