Reminder - Digital Publishing Suite (DPS) will End of Life on August 31st, 2019.
by Scott Dreier
Table of contents
26 July 2013
Original publication date 04/15/2013
Modified: 07/26/2013 (Change log)
Additional required other products:
Note: If you have questions about this article, use the comments feature 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:
- Follow this link: http://aws.amazon.com/amis/dps-push-for-ua
Figure 1: Public AMI listing at aws.amazon.com
- Launch the AMI. You will be able to choose which region.
Figure 2: Choosing region for the AMI
- Select Continue to accept the defaults on the next few screens.
Figure 3: First step of “Request Instances Wizard”
Figure 4: Defaults for first part of “Instance Details” step of the wizard
Figure 5: Defaults for “Advanced Instance Options”
Figure 6: Defaults for “Storage Device Configuration”
- Choose a key pair. If you do not have any (typical), then choose “Create a new Key Pair”.
Figure 7: Creating a new key pair
- Setup a new security group (unless you already have one).
- Give it a name and description.
- You will need to do the following for each of the ports you want to open up. These ports are SSH (port 22), HTTP(80), and MYSQL(3306).
- Select “Create a new rule”; select either SSH, HTTP or MYSQL; then press the “Add Rule” button.
- Also add the FTP port. “Create a new rule” and select the “Custom TCP rule” and enter port 21. This is the FTP port and is not in the pre-defined list. Press the “Add Rule” button to add it.
Figure 8: Creating a new Security Group
- Once complete, select Continue.
Figure 9: Continuing through the Security Group step after adding all the port rules
- Now…Launch your new instance based upon mine.
Figure 10: Launching your instance
- After it is launched, note the subdomain name of your instance. You will need this for later.
Figure 11: Subdomain name of your EC2 instance
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.
Figure 12: Connecting to your instance using FTP
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 firstname.lastname@example.org)
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.
Figure 13: Using the supplied form to send a Newsstand notification or alert text notification
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.
Figure 14: Sending an alert text notification via the Urban Airship dashboard
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.
Figure 15: Newsstand notification status
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:
- Always on availability. Devices can register 24/7/265.
- A non-changing domain name. Every time you stop/restart your AMI, you will get a different domain name which is incompatible with device registration.
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.