Web App Development - Systems Architecture - API Building - Security Audits

Want your own Cloud API?

Posted by David in API, Cloud Computing, PHP, frapi
Monday, August 9th, 2010 at 15:41

logo_awsEver considered developing a RESTful API? Ever wondered what is FRAPI and how it works? Well apart from reading the frameworks’s website, there was no real way to assess FRAPI as a RESTful API Framework — Not until recently.

In order to ease adoption and make it more accessible for people to evaluate FRAPI, we’ve put an Amazon AMI together. This AMI comes pre-installed with Linux Lucid Lynx (Ubuntu 10.04 LTS), NGINX as the webserver, Memcached — (And no, port 11211 isn’t opened to the public), PHP5-FPM, APC and obviously FRAPI.

If you’d like to give this public AMI a spin, just go to Amazon’s instance management section, click on “Launch Instance, go to community AMIs, and search for : “ami-0adf2f63″ . Once you found it, click on “Select” (And make sure to select Port HTTP (80) when asked about which ports to open).

It’s running, now what?

You can go directly to the AMI’s host name in a browser and you will get FRAPI’s default invalid action error, or you can follow these steps to customise it a bit more.

Now that you see your new shiny FRAPI-AMI instance running in your management console, you have a few options:

First option is: Find the “Public DNS” and the “Public IP Address” of the instance you just launched and point your domain-name’s DNS to the IP you found — Your domains could be: api.mydomain.com and admin.api.mydomain.com

Second Option is: If you do not currently hold a domain name for your API, edit your /etc/hosts file (Or the equivalent in your OS) to have an entry that points to the IP of your instance

10.0.0.1 api.mydomain.com admin.api.mydomain.com.

Once you are done with either Option 1 or Option 2, you’ll need to connect to your instance over SSH (ssh ubuntu@hostname-of-the-instance -i your-amazon-cert.pem). Upon connection, you’ll be greeted with a welcome screen giving you some information about FRAPI and the server’s software :

Once you are connected, make sure to “sudo su” and then edit the files that are in /home/ubuntu/sites/. The only thing you have to modify in those files are the “server_name” details. Put either your domain name or your made up domain name that is setup in your /etc/hosts file. The end result should be an admin file with something that contains something along the lines of

and an api configuration file that contains

Don’t give up, you are nearly there, now you have to run : “/etc/init.d/nginx restart && /etc/init.d/php5-fpm restart” and you are done.

If you go to the api.mydomain.com in your browser you should now see FRAPI’s default invalid action XML error. If you go to admin.api.mydomain.com you should be able to login with the username “admin” and password “password” — Hint: You should go to the “configurations -> users” section and modify that password.

I want to code something!

SSH into your instance, and go to /home/ubuntu/development/custom/Actions, you will see all your API Controllers there and you can follow the steps here http://wiki.github.com/frapi/frapi/creating-actions (In our case, the generated files go into /home/ubuntu/development/custom/Actions)

To get accustomed you can start playing with Testing1.php and Testing2.php

Don’t hesitate to jump on IRC or on the mailing list and ask questions!

You can leave a response, or trackback from your own site.

Comments (7 Responses)

[...] This post was mentioned on Twitter by David Coallier, Trevor Morse. Trevor Morse said: RT @davidcoallier: Run the FRAPI AMI in the cloud on #EC2: http://blog.echolibre.com/2010/08/want-your-own-cloud-api/ #buzzwordsss [...]

Akvario

“and search for : “ami-8c28c3e5””

Can’t find this AMI in the list :(

Yes sorry, I am currently creating an EBS instance so people can run it for free and removed the instance mentioned in this post 2 days ago because I didn’t want to leave the outdated version out there.

I’ll have a new instance for you within the next few days. Keep an eye on here either Thursday or Friday and I’ll post an update to the post with the new AMI ids.

Akvario

Thanks. I’ll look for updates ;)

Hey there, the article is updated with the new ami and the new AMI is ami-0adf2f63. That is for instance store. The EBS instance will come later.

Greetings, we looked for the AMI in AWS, but it’s not there. Do you have a new instance? We’re very interested in FRAPI.
thanks much

Hey all, we’ve found some pretty serious issues with the AMI so we are repackaging and putting it live next week again.

I’ll update you when it’s ready :)

Leave a comment




About this blog

We like to blog about things we're passionate about. We love PHP, MySQL, CouchDB, Linux, Apache - web development standards. We also like writing about building web apps and working with web technology.
You can email us on freedom@echolibre.com

Follow us on Twitter

Eamon Leonard - @EamonLeonard
David Coallier - @DavidCoallier
Helgi Þormar Þorbjörnsson - @h
J.D Fitz.Gerald - @jdfitzgerald
Noah Slater - @nslater
Court Ewing - @courtewing

 

 

 

echolibre limited is registered in Ireland, company number 451576. Directors: Eamon Leonard, J.D Fitz.Gerald. Registered Office: 64 Dame Street, Dublin 2, Ireland.