26 July 2013
Original publication date: 04/15/2013
Modified: 07/26/2013 (Change log)
Note: If you have questions about this article, use the tutorial feedback link at the bottom of the article. Please don’t contact technical support with questions about Adobe Developer Connection articles.
This article describes how to quickly leverage an Amazon Managed Instance (AMI) to host the Urban Airship push connector referenced in this article. For publishers that prefer hosted services, we have made a community contribution of an AMI. This will allow you to purchase and create a managed instance that comes complete with all the HTTP, PHP, MySQL, curl tools that you need to support Adobe DPS Push for Urban Airship. Furthermore, since you are starting with an AMI, all the services and users have been pre-defined and setup for you. Simply clone this Instance and add your Urban Airship account keys and will be done.
This article discusses deployment of a DPS Push Connector for Urban Airship on Amazon Web Services (AWS). Please read this article first for an overview of the service that is being created by this AMI. You will need to have your Urban Airship account information (Application Secret and Master Secret). You will also want to have access to DPS App Builder in order to create a DPS Application that communicates with this EC2 AMI.
You will NOT need any of the PHP files from the archive’s in previous articles. All of these files have been pre-loaded onto the AMI.
We have published a public AMI that has everything preloaded. You will need to log into your Amazon Web Service account:
The AMI comes completely populated and configured for my Urban Airship account. You will need to tell it about your Urban Airship account.
I use Fetch (http://fetchsoftworks.com) on my Mac. Any FTP client should work, but I know that Fetch does. Use the following credentials to connect to the FTP server on your Instance.
Hostname: Enter the complete subdomain name of your AWS AMI.
When we created the security group prior to launching the AMI, we added SSH (Secure Shell). Using the public/private key PEM file you downloaded at the beginning of this process, log into your new Instance.
Open up a terminal window on a Mac (you can obviously do this this with any SSH client, but I use Terminal and Bash SSH).
At the command prompt, type:
ssh -i <yourpemfilename> ec2-user@<your_subdomain_name>
(eg. ssh -i sdreierkey_for_AWS.pem email@example.com)
You will want to ensure that your PEM is only owned by you. The AMI instance may complain if not. To fix, type: chmod 400 <your pem file>
Now that you have connected via either FTP or SSH, navigate to “/var/www/html/apns” and edit the file ‘settings.php’. You will need set the $user and $pass to your Urban Airship’s Application Key and Application Master Secret respectively.
<?php $user = $appKey = " 07esg54qTCaevdij0kV1Rw";// UA Application Key $pass = $appMasterSecret = " xxxxxxxxxxxx";// UA Master Secret $appId = "reference app"; // Some human readable description
You will need to create a DPS Application using DPS App Builder that is enabled for Push. You should un-select “Use Adobe Push” and provide the full URL to your AMI Instance’s ‘uaproxy.php.
If you will be sending Newsstand Notifications (i.e. Your application presents itself within the Newsstand), then you will want to use the PHP form deployed on your instance. This form properly sequences notifications to devices in order to maximize the bandwidth of our Folio Fulfillment service. The form is found on your instance and is the default page of the ‘apns’ directory.
Alternatively, if your application is not in Newsstand, you can use the Broadcast feature at your Urban Airship dashboard. This will send out notificaitons to all devices immediately.
For the non-Newsstand user, you are welcome to use either method. For Newsstand enabled applications, Newsstand notifications MUST use the form on your instance.
At this point, you should be completely Push Enabled. Since you created your own private AWS AMI from a common, publicly available AMI, I strongly recommend changing passwords and/usernames. Or to put it another way – every publisher that deploys this EC2 instance will all have the same FTP access.
Another good customization is to turn off the MYSQL port (3306) by removing it from the security group you created and re-booting the instance. As you may have noticed, we didn’t need to do anything to customize or setup the MYSQL instance. All database creation and management was provided with the AMI. For reference, username/password for MYSQL is ‘root’, ‘password’ in case you want to inspect it or customize it.
SSH access is only available to those in possession of the public/private key file (.PEM), so you do not need to change that.
Another customization would be to change the graphics/fonts/messaging on the PHP form.
Finally, when you are comfortable with this AMI, you SHOULD purchase a reserved instance from Amazon so that you can have:
Amazon cloud services are a paid service. I strongly recommend familiarizing yourself with the different payment terms. It is likely that you will want to create a ‘Reserved Instance’. This allows you to make a single yearly (or 3 year) payment at significant cost savings.
7/26/13 Updated the implementation to use the new version of the DPS Push Connector for Urban Airship (published in July 2013 here . Also created a published a public AMI instance to make it even easier to get up and running with your own instance.