About Amazon AWS EC2 - ruby-on-rails-3

I am new to deploy a rails3.1 app to the AWS platform(heroku only previously).
However, I want to take the advantage of EC2 + S3 free-tier micro instance.
I've heard that there's something called AMI and some other things like Capistrano etc.
Can anyone explain the whole concept of AWS cloud computing?
How can I upload files to EC2? Via the terminal?
E.g. I am using ubuntu 11.10, Can I just type "rails s" in the terminal and then Ec2 just going running in production mode?
Thanks.

Amazon ec2 is just another service just like a dedicated server that you would get from certain hosting providers, an AMI stands for Amazon Machine Images, which is basically a pre-configured operating system, it can be any linux distro or even windows, once you decide on an AMI you will get a SSH account that you can use to connect to your server, you can use the command line to connect or any number of programs that can ssh, for instance I use zend studio on my mac and thats how I edit my files on the server but I also use the command line with the rsync command to backup all my files from the server to my laptop.

Related

Is it possible to deploy Spinnaker to an instance smaller than m4.xlarge on AWS?

We are currently following the default deployment instructions for Spinnaker which states using m4.xlarge as the instance type.
http://www.spinnaker.io/v1.0/docs/creating-a-spinnaker-instance#section-amazon-web-services
We did make an unsuccessful attempt to deploy it to m4.large but the services didnt start.
Has anyone tried the something similar and succeeded?
It really depends on the size of your cloud.
There are 4 core services that you need - gate/deck/orca/clouddriver. You can shut the other ones off if say, you don't care about automated triggers, baking or jenkins integration.
I'm able to run this locally with the docker images with about 8 gigs of ram and it works. Using s3 instead of cassandra also helps here.
You can play around with the settings in the baked image of spinnaker, but for internal demos and what not, I've been able to just spin up a VM, install docker and run the docker compose config correctly on m4.large.

Amazon S3 WebDAV access

I would like to access my Amazon S3 buckets without third-party software, but simply through the WebDAV functionality available in most operating systems. Is there a way to do that ? It is important to me that no third-party software is required.
There's a number of ways to do this. I'm not sure about your situation, so here they are:
Option 1: Easiest: You can use a 3rd party "cloud gateway" provider, like http://storagemadeeasy.com/CloudDav/
Option 2: Set up your own "cloud gateway" server
Set up a dedicated server or virtual server to act as a gateway. Using Amazon's own EC2 would be a good choice.
Set up software that mounts S3 as a drive. Two I know of on Windows: (1) CloudBerry Drive http://www.cloudberrylab.com/ and (2) WebDrive (http://webdrive.com). For Linux, I have never done it, but you can try: https://github.com/s3fs-fuse/s3fs-fuse
Set up a webdav server like CrushFTP. (It comes to mind because it's stable and cheap and works on any OS.) Another option is IIS but I personally find it's harder to set up securely for webdav.
Set up a user in your WebDav server (ie CrushFTP or IIS) with access to the mapped S3 drive.
Possible snag: Assuming you're using Windows, to start your services automatically and have this work, you may need to set up both services to use the same Windows user account (Services->(Your Service)->[right-click]Properties->Log On tab). This is because the S3 mapping software might not map the S3 drive for all Windows users. Alternatively, you can use FireDaemon if you get stuck on this step to start the programs as a service all under the same username.
Other notes: I have experience using WebDrive under pretty heavy loads, and it seems to work well. Under tons of pounding (I'm talking thousands of files per hour being added to a 5 TB WebDrive) it started to crash Windows. But I'm not sure if you are going that far with it. Also, if you're using EC2, you may not have that issue since it was likely caused by a huge transfer queue in memory and EC2 will have faster transit to S3 and keep the queue smaller.
I finally gave up on this idea and today I use Rclone (https://rclone.org) to synchronize my files between AWS S3 and different computers. Rclone has the ability to mount remote storage on a local computer, but I don't use this feature. I simply use the copy and sync commands.
S3 does not support webdav, so you're out of luck!
Also, S3 does not support hierarchial name spaces, so you cant directly map a filesystem onto it
There is an example java project here for putting a webdav server over Amazon S3 - https://github.com/miltonio/milton-aws

EC2 machine ubuntu reinstall

I have an EC2 machine with ubuntu installed. I sort of messed up my apache configuration when I was trying to set up svn, so am having issues with apache. I want a fresh install of my machine with the same version of ubuntu. Is there any way to do that with the aws console other than creating a new ec2 machine?
If you look in the AWS console it will tell you what machine image you are using for that instance. You simply need to find that image again and boot a new instance based on that image.
When you launch the new instance it will ask you what image you want to use, just make sure to use the same one. That simple.

How install Wordpress in a EC2 machine?

I have an EC2 instance running with Glassfish Server Open Source Edition.
And now I need to setup the a website in wordpress.
How can I do that ?
I'm looking for 5 minutes installation tutorial but I'm stuck in the part where it's says about the webserver.
I have to install the Apache in Linux then enable the FTP access ? (to upload the wordpress files ? )
For now I'm stuck in this part guys, any tip is very welcome.
Ok. This is going to be a bit of a high level overview of what you need to do. Its a long process which you need to look into.
Glassfish server is (afaik) for Java applications. Wordpress is a PHP/mysql based system.
Apache is a free and open source web server which you can use, which integrates with php and mysql nicely. What you need is called a LAMP setup (LAMP stands for "linux, apache, mysql and php). You haven't specified what your EC2 is running (what linux distro) but lets say its Ubuntu. A quick search for "installing lamp ubuntu" on google turns up many different tutorials and walkthroughs for installing a lamp setup on your machine.
You'll need SSH access (which you'll have with EC2) then if you run through your tutorial of choice you'll have a working web server, you'll specify a public_html directory (usually by default /var/www).
Now to install Wordpress. What you could do is install an FTP server. This is going to be relatively complicated though, however it will be the easiest way to install Wordpress. Install FTP and upload the wordpress files to the public html directory, then you will be able to run through the 5 minute install process using the mysql database credentials you set up in the LAMP tutorial.
An easier way to do what you need to do is to install subversion on your EC2 instance - e.g. sudo apt-get install subversion on ubuntu. That way you can svn export the wordpress repository to your public html folder (http://codex.wordpress.org/Installing/Updating_WordPress_with_Subversion).
However, without an FTP server running on your EC2 instance you won't be able to FTP in to modify files or anything. You'll have to do everything over SSH (or SFTP) which may or may not be manageable for you.
In all honesty, and with the utmost respect, if you don't know about apache and installing a LAMP server and such then you're probably a bit out of your depth with Amazon's EC2 server. You'd be better off with a dedicated server from a hosting company who will have installed everything you need.

Rails 3 Server on EC2

I'm trying to setup a production server for a rails 3 app on a single amazon ec2 instance, and am wondering what route to take.
I'm quite new to deploying rails apps - is there a pre-existing ami I can use for rails3?
Any tips/wisdom/advice appreciated - thanks!
I'd like to suggest to use verified EC2 AMIs, for instance by Rightscale. You can not use the Rightscale as a service, but theirs AMIs are pretty stable and reliable.
UPDATE: I advice to use Amazon Linux Machine based on CentOS 6
In terms of reasonably priced EC2 management services check out scalr.com.
As for gems that makes it easier to deploy Rails to EC2 have a look at Poolparty and Rubber.
Ubuntu has a nice guide on EC2 and Ubuntu images. https://help.ubuntu.com/community/EC2StartersGuide
Also see http://alestic.com/ I just set up one of these images on my EC2 free usage tier with no issues.