Powerpoint exploring the locations used in television show Time Clash
WordPress & Cloud: integration with AWS
1. WORDPRESS &
AMAZON WEB SERVICES
Cascina Roccafranca – Torino – 16 giugno 2012
Gabriele Mittica – gabrielemittica.com – gabriele.mittica@corley.it - @gabrielemittica
1 di 47
2. CHAPTER 1.
INTRODUCING THE CLOUD
Corley S.r.l.
Piazza Statuto 10, Torino (10122) 2 di 47
P.Iva 10669790015
www.corley.it
3. What is CLOUD COMPUTING?
Cloud computing refers to the delivery of computing
and storage capacity as a service to a heterogeneous
community of end-recipients.
Cloud computing entrusts services with a user's data,
software and computation over a network.
It has considerable overlap with software as a
service (SaaS).
Corley S.r.l.
Piazza Statuto 10, Torino (10122) 3 di 47
P.Iva 10669790015
www.corley.it
4. FAQ about the cloud…
Is the cloud just a fad?
1. No.
It’s a rational evolution of IT architecture towards a more efficient way
of managing resources and designing Web applications efficiently.
2. Is the cloud cheap?
No.
The cloud allows you to pay the right for each service involved.
Is the cloud just a scalable vps?
3. No.
The cloud is a set of services designed to meet specific computing needs.
Corley S.r.l.
Piazza Statuto 10, Torino (10122) 4 di 47
P.Iva 10669790015
www.corley.it
5. Advantages
- access to unlimited resources
- scalable architecture
- no hardware dependency
- pay as you go
- geographical redundancy
- high availability
- increased competition for start-up
Corley S.r.l.
Piazza Statuto 10, Torino (10122) 5 di 47
P.Iva 10669790015
www.corley.it
6. AWS - Amazon Web Services
Services Pricing Dev & Social
Scalable virtual machines On-demand & reserved servers SDK & xml webservices
Storage services Storage starting from 0.093$ / GB Community forum
Content delivery network Bill by credit card Premium support
Autoscaling & loadbalancing Consolidated billing Events & webinar
Realational & No-SQL DB Free tier Start-up challenge
Private Cloud & Policies No setup fee
… much more
Corley S.r.l.
Piazza Statuto 10, Torino (10122) 6 di 47
P.Iva 10669790015
www.corley.it
7.
8.
9.
10. AWS - Links
- Home page: http://aws.amazon.com/
- About AWS: https://aws.amazon.com/what-is-aws/
- All products: http://aws.amazon.com/products/
- Dev area: http://aws.amazon.com/resources/
- Documentation: http://aws.amazon.com/documentation/
- SDK: http://aws.amazon.com/code/
- Community: https://forums.aws.amazon.com/index.jspa
- AWS Blog: http://aws.typepad.com/
- Events: https://aws.amazon.com/about-aws/events/
- Services Health Dashboard: http://status.aws.amazon.com/
- Pricing Calculator: http://calculator.s3.amazonaws.com/calc5.html
Corley S.r.l.
Piazza Statuto 10, Torino (10122) 10 di 47
P.Iva 10669790015
www.corley.it
12. WP + S3 + CloudFront
Uploads your wordpress attachements Services involved:
to S3 with an option CloudFront Simple Storage Service (S3):
distribution. S3 provides a simple web services
interface that can be used to store and
This WordPress plugin allows you to use retrieve any amount of data, at any time,
Amazon's Simple Storage Service to host from anywhere on the web.
your media for your WordPress powered It provides 99.999999999% durability.
blog with an optional CloudFront
distribution. CloudFront:
CF can be used to deliver your entire
Plugin homepage: website, including dynamic, static and
http://wordpress.org/extend/plugins/tan streaming content using a global network
tan-s3-cloudfront/ of edge locations.
Over 30 edge locations.
Corley S.r.l.
Piazza Statuto 10, Torino (10122) 12 di 47
P.Iva 10669790015
www.corley.it
13. WP + S3 + CloudFront
Tipical use of WordPress: html and media files are provided by apache (http
request):
Corley S.r.l.
Piazza Statuto 10, Torino (10122) 13 di 47
P.Iva 10669790015
www.corley.it
14. WP + S3 + CloudFront
Thanks to S3 and CloudFront, you can easily send all your media files through
the content Delivery Network
Corley S.r.l.
Piazza Statuto 10, Torino (10122) 14 di 47
P.Iva 10669790015
www.corley.it
15. WP + S3 + CloudFront: config
Create a new user in aws console:
Corley S.r.l.
Piazza Statuto 10, Torino (10122) 15 di 47
P.Iva 10669790015
www.corley.it
17. WP + S3 + CloudFront: config
Then set the policy:
Corley S.r.l.
Piazza Statuto 10, Torino (10122) 17 di 47
P.Iva 10669790015
www.corley.it
18. WP + S3 + CloudFront: config
Grant full access to S3 management:
Corley S.r.l.
Piazza Statuto 10, Torino (10122) 18 di 47
P.Iva 10669790015
www.corley.it
19. WP + S3 + CloudFront: config
Create a new bucket in S3 console:
Corley S.r.l.
Piazza Statuto 10, Torino (10122) 19 di 47
P.Iva 10669790015
www.corley.it
20. WP + S3 + CloudFront: config
Then go in CloudFront console and create a new CF distribution:
Corley S.r.l.
Piazza Statuto 10, Torino (10122) 20 di 47
P.Iva 10669790015
www.corley.it
21. WP + S3 + CloudFront: config
Select the bucket created as origin:
Corley S.r.l.
Piazza Statuto 10, Torino (10122) 21 di 47
P.Iva 10669790015
www.corley.it
22. WP + S3 + CloudFront: config
Enable the new cloudfront distribution:
Corley S.r.l.
Piazza Statuto 10, Torino (10122) 22 di 47
P.Iva 10669790015
www.corley.it
23. WP + S3 + CloudFront: config
Download the wordpress Plugin (http://wordpress.org/extend/plugins/tantan-
s3-cloudfront/) and follow these steps:
- Upload tantan-s3-cloudfront to the /wp-content/plugins/ directory
- Activate the plugin through the 'Plugins' menu in WordPress
- Configure the plugin in the 'Options' (or 'Settings') screen by following the
onscreen prompts.
- Set an optional CloudFront distribution URL (must be paired with your S3
bucket on AWS)
Corley S.r.l.
Piazza Statuto 10, Torino (10122) 23 di 47
P.Iva 10669790015
www.corley.it
24. WP + S3 + CloudFront: config
Set the plugin options:
Corley S.r.l.
Piazza Statuto 10, Torino (10122) 24 di 47
P.Iva 10669790015
www.corley.it
25. WP + S3 + CloudFront: usage
Now each file uploaded is hosted by S3 and provided by CloudFront:
Corley S.r.l.
Piazza Statuto 10, Torino (10122) 25 di 47
P.Iva 10669790015
www.corley.it
26. WP + S3 + CloudFront: advantages
- Easy to use
- Cost affordable
- Very-low latency
- Reduced load on the server
- Increased page speed
- Useful in big files hosting, download repository, media files
- Useful in js/css/images distribution
Corley S.r.l.
Piazza Statuto 10, Torino (10122) 26 di 47
P.Iva 10669790015
www.corley.it
27. CHAPTER 3.
WP + CLOUDFRONT
Corley S.r.l.
Piazza Statuto 10, Torino (10122) 27 di 47
P.Iva 10669790015
www.corley.it
28. WP + CloudFront
CloudFront helps you to provide your Services involved:
content through a world wild content
delivery network. CloudFront:
CF can be used to deliver your entire
Following this how-to you can easily set website, including dynamic, static and
CloudFront to provide all your data (html, streaming content using a global network
css, js, images, videos and more). of edge locations.
Over 30 edge locations.
You need:
- An active AWS account
- Dns management You need to edit the dns configuration of your
- Edit your wp-config.php file website in order to use properly this tutorial.
- No plugins required
Corley S.r.l.
Piazza Statuto 10, Torino (10122) 28 di 47
P.Iva 10669790015
www.corley.it
29. WP + CloudFront
Tipical use of WordPress:
Corley S.r.l.
Piazza Statuto 10, Torino (10122) 29 di 47
P.Iva 10669790015
www.corley.it
30. WP + CloudFront
Wordpress hosted by CloudFront:
Corley S.r.l.
Piazza Statuto 10, Torino (10122) 30 di 47
P.Iva 10669790015
www.corley.it
31. WP + CloudFront: config
Edit the dns configuration of your website:
www.example.com. CNAME your-cloudfront-distribution-url
cdn.example.com. A your-server-ip
Corley S.r.l.
Piazza Statuto 10, Torino (10122) 31 di 47
P.Iva 10669790015
www.corley.it
32. WP + CloudFront: config
Then go in CloudFront console and create a new CF distribution:
Corley S.r.l.
Piazza Statuto 10, Torino (10122) 32 di 47
P.Iva 10669790015
www.corley.it
33. WP + CloudFront: config
Set your subdomain as origin:
Corley S.r.l.
Piazza Statuto 10, Torino (10122) 33 di 47
P.Iva 10669790015
www.corley.it
34. WP + CloudFront: config
Enable the new CloudFront distribution:
Corley S.r.l.
Piazza Statuto 10, Torino (10122) 34 di 47
P.Iva 10669790015
www.corley.it
35. WP + CloudFront: config
Place in your wp-config.php file:
define('WP_ALLOW_MULTISITE', true);
define('COOKIEPATH', '/');
define('COOKIE_DOMAIN', '. example.com');
if(strpos($_SERVER['SCRIPT_NAME'], "/wp-login")===0 ||
strpos($_SERVER['SCRIPT_NAME'], "/wp-admin")===0)
{
define('WP_HOME','http://cdn.example.com');
define('WP_SITEURL','http://cdn.example.com');
}
Corley S.r.l.
Piazza Statuto 10, Torino (10122) 35 di 47
P.Iva 10669790015
www.corley.it
36. WP + CloudFront: pros & cons
PROS: CONS:
- Fast implementation - No POST data managed
- No-load on your server - Comment system unavailable
- High-speed, low-latency (use DISQUS instead)
- Useful for product website or - Pay attention to cache timeout
website with heavy traffic
Corley S.r.l.
Piazza Statuto 10, Torino (10122) 36 di 47
P.Iva 10669790015
www.corley.it
37. CHAPTER 4.
SENDING EMAILS WITH SES
Corley S.r.l.
Piazza Statuto 10, Torino (10122) 37 di 47
P.Iva 10669790015
www.corley.it
38. Sending emails with SES
WP-SES is a plugin that redirects all Services involved:
outgoing WordPress emails through
Amazon Simple Email Service (SES) for Simple Email Service (SES):
maximum email delivrability. SES is a highly scalable and cost-effective
bulk and transactional email-sending
You can download this plugin on official service for businesses and developers
website http://wp-ses.com/ Only $0.10 per thousand.
Requires: 3.0.0 or higher
Compatible up to: 3.0.5
Corley S.r.l.
Piazza Statuto 10, Torino (10122) 38 di 47
P.Iva 10669790015
www.corley.it
39. Sending emails with SES: features
- Ability to adjust WordPress Default Sender Email and Name
- Validation of Amazon API Credentials
- Request confirmation for sender Emails
- Test message within Amazon Sandbox mode
- Full Test message within Amazon Production mode
- Full integration as seamless replacement for wp_mail internal function
- Dasboard panel with Quota and statistics
- Ability to customize return path for delivery failure notifications
Corley S.r.l.
Piazza Statuto 10, Torino (10122) 39 di 47
P.Iva 10669790015
www.corley.it
41. Sending emails with SES: config
First, install like any other plugin:
- Upload and activate the plugin
- The setting are in settings / WP SES
Then, proceed to the settings:
- Fill the email address and name to use as the sender for all emails
- Fill in Amazon API credentials
- Save changes (Important !)
- Ask to add the email as a confirmed sender
- Click on the link you got by email from Amazon SES
- Refresh the plugin, send a test email
- If ok, ask Amazon to go out of sandbox into production mode
- Once in production mode, you can use the top button to activate the plugin.
Corley S.r.l.
Piazza Statuto 10, Torino (10122) 41 di 47
P.Iva 10669790015
www.corley.it
42. Sending emails with SES: config
Plugin configuration:
Corley S.r.l.
Piazza Statuto 10, Torino (10122) 42 di 47
P.Iva 10669790015
www.corley.it
43. CHAPTER 5.
WP HOSTING WITH AWS
Corley S.r.l.
Piazza Statuto 10, Torino (10122) 43 di 47
P.Iva 10669790015
www.corley.it
44. WP hosting with AWS
Autoscaling+High Availability
Thanks to AWS you can setup Wordpress to
scaling up and down and grant high-
availability to your customers.
Some advantages:
- Ability to Serve millions of pages/day
- Ability to scale out/down dynamically
- Should be Highly available
- Automated Backup and Monitoring This process involves a lot of services: EC2,
- Cost effective Autoscaling, RDS, S3, ROUTE 53, CloudFront…
http://aws.amazon.com/products/
-
Corley S.r.l.
Piazza Statuto 10, Torino (10122) 44 di 47
P.Iva 10669790015
www.corley.it
45.
46. WP hosting with AWS: links
- How-to part one: http://harish11g.blogspot.it/2012/01/scaling-wordpress-aws-
amazon-ec2-high.html
- How-to part two: http://harish11g.blogspot.it/2012/02/wordpress-aws-ec2-
architecture-part2.html
- FAQ about WP on AWS: http://harish11g.blogspot.in/2012/02/faq-scaling-wordpress-
aws-ec2-million.html
- Slides on SlideShare: http://www.slideshare.net/harishganesan/scaling-wordpress-in-
aws-amazon-ec2
- AWS Architecture Center: http://aws.amazon.com/architecture/
- AWS Web hosting architecture:
http://d36cz9buwru1tt.cloudfront.net/architecturecenter/AWS_ac_ra_web_01.pdf
- WP on EC2 + RDS tutorial: http://wp.tutsplus.com/tutorials/scaling-caching/deploy-
your-wordpress-blog-to-the-cloud/
Corley S.r.l.
Piazza Statuto 10, Torino (10122) 46 di 47
P.Iva 10669790015
www.corley.it
47. Thank you for listening
Cascina Roccafranca – Torino – 16 giugno 2012
Gabriele Mittica – gabrielemittica.com – gabriele.mittica@corley.it - @gabrielemittica
47 di 47