Skip to content

Instantly share code, notes, and snippets.

@sansane123
Forked from duhaime/lamp.html
Created April 12, 2018 02:59
Show Gist options
  • Save sansane123/2d1924efae38fa32706fecbd20e7e786 to your computer and use it in GitHub Desktop.
Save sansane123/2d1924efae38fa32706fecbd20e7e786 to your computer and use it in GitHub Desktop.
Set up Wordpress + LAMP on Amazon Ec2
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta name="viewport" content="width=device-width, initial-scale=1"><meta name="description" content="Tutorial - install the Apache web server with PHP and MySQL support on your EC2 instance."><title>Tutorial: Installing a LAMP Web Server on Amazon Linux - Amazon Elastic Compute Cloud</title><link rel="home" href="#top" title="Amazon Elastic Compute Cloud"><link rel="up" href="ec2-tutorials.html" title="Tutorials for Amazon EC2 Instances Running Linux"><link rel="prev" href="ec2-tutorials.html" title="Tutorials for Amazon EC2 Instances Running Linux"><link rel="next" href="hosting-wordpress.html" title="Tutorial: Hosting a WordPress Blog with Amazon Linux"><meta name="keywords" content=""><meta name="deployment_region" content="IAD"><meta name="product" content="Amazon Elastic Compute Cloud"><meta name="guide" content="User Guide for Linux Instances"><meta name="guide-locale" content="en_us"><link rel="icon" type="image/ico" href="//media.amazonwebservices.com/favicon.ico"><link rel="shortcut icon" type="image/ico" href="//media.amazonwebservices.com/favicon.ico"><link rel="canonical" href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/install-LAMP.html"><link rel="stylesheet" type="text/css" href="/css/jquery-ui.min.css"><link rel="stylesheet" type="text/css" href="/font/css/font-awesome.min.css"><link rel="stylesheet" type="text/css" href="/css/google-font.css"><link rel="stylesheet" type="text/css" href="/css/highlight-default.css"><link rel="stylesheet" type="text/css" href="/css/jquery-ui.theme.css"><link rel="stylesheet" type="text/css" href="/css/colorbox.css"><link rel="stylesheet" type="text/css" href="/css/awsdocs.css"><script type="text/javascript" src="/js/highlight.pack.js"></script><script type="text/javascript" src="/js/jquery.min.js"></script><script type="text/javascript" src="/js/jquery-ui.min.js"></script><script type="text/javascript" src="/js/handlebars.js"></script><script type="text/javascript" src="/js/jquery.colorbox.js"></script><script type="text/javascript" src="/js/awsdocs.min.js"></script></head><body id="top"><div id="aws-nav" class="aws-nav-header"><div class="aws-nav-header-left"><div id="aws-nav-flyout-trigger" class="aws-nav-flyout-trigger"><i class="fa fa-bars fa-2x"></i>Menu</div><div class="aws-nav-logo"><a href="https://aws.amazon.com"><span>Amazon Web Services</span></a></div></div><div id="aws-nav-header-right" class="aws-nav-header-right"><div class="aws-nav-cta-button-outer"><span class="aws-nav-cta-default" id="span-conosole-signin"><a id="aws-nav-cta-button" class="aws-nav-button" href="https://console.aws.amazon.com/console/home">Sign In to the Console</a></span><span class="aws-nav-cta-default" id="span-conosole-signup" style="display:none"><a id="aws-nav-cta-button" class="aws-nav-button" href="https://portal.aws.amazon.com/gp/aws/developer/registration/index.html">Try AWS for Free</a></span></div><div class="aws-nav-popover-trigger" data-dropdown="aws-nav-dropdown-lang"><select id="languageSelection" onchange="SelectLanguage()"><option value="/de_de/AWSEC2/latest/UserGuide/install-LAMP.html">Deutsch</option><option value="/en_us/AWSEC2/latest/UserGuide/install-LAMP.html" selected>English</option><option value="/es_es/AWSEC2/latest/UserGuide/install-LAMP.html">Espa&ntilde;ol</option><option value="/fr_fr/AWSEC2/latest/UserGuide/install-LAMP.html">Fran&ccedil;ais</option><option value="/ja_jp/AWSEC2/latest/UserGuide/install-LAMP.html">&#26085;&#26412;&#35486;</option><option value="/pt_br/AWSEC2/latest/UserGuide/install-LAMP.html">Portugu&ecirc;s</option><option value="/ko_kr/AWSEC2/latest/UserGuide/install-LAMP.html">&#54620;&#44397;&#50612;</option><option value="/zh_cn/AWSEC2/latest/UserGuide/install-LAMP.html">&#20013;&#25991; (&#31616;&#20307;)</option></select></div><div id="aws-nav-quicklinks-separator" class="aws-nav-quicklinks-separator"><div class="aws-nav-left"></div><div class="aws-nav-right"></div></div></div><div id="topnav-flyout-menu-container"><ul id="topnav-flyout-menu"><script id="flyout-item-template" type="text/x-handlebars-template">
{{#flyoutList}}
<li>{{listItem}}
{{#if subList}}
<ul>
{{#subList}}
<li class="awsdocs-flyout-link-wrapper"><a href="{{target}}">{{text}}</a></li>
{{/subList}}
</ul>
{{/if}}
</li>
{{/flyoutList}}
</script></ul><div id="topnav-flyout-menu-spacer"></div></div></div><script type="text/javascript"><!--
var thispage = "install-LAMP.html";
var tocroot = location.protocol + '//' + location.hostname + location.pathname;
--></script><div id="content-container"><div id="left-column" class="ui-resizable"><div id="left-col-header"><div id="left-col-top-content"><div id="service-name">Amazon Elastic Compute Cloud </div><div id="search"><i id="search-icon" class="fa fa-search fa-2x"></i></div><div id="guide-info">User Guide for Linux Instances<div id="content-button"><i id="toggle-contents" class="fa fa-bars"></i></div></div></div><form id="finegrainedSearch" method="get" onsubmit="return searchFormSubmit(this);" action="/search/doc-search.html"><div id="search-form"><select id="search-select" name="searchPath"><option value="all">Entire Site</option><option value="AWSMarketplace">AMIs from AWS Marketplace</option><option value="amis">AMIs from All Sources</option><option value="articles">Articles &amp; Tutorials</option><option value="products_and_info">AWS Product Information</option><option value="case_studies">Case Studies</option><option value="customerapps">Customer Apps</option><option value="documentation">Documentation</option><option value="documentation-product">Documentation - This Product</option><option value="documentation-guide" selected>Documentation - This Guide</option><option value="datasets">Public Data Sets</option><option value="releasenotes">Release Notes</option><option value="solution_providers">Partners</option><option value="code">Sample Code &amp; Libraries</option></select><br><input id="search-query" name="searchQuery" type="text" placholder="$loc-search-search"><input id="search-button" src="images/search-button.png" alt="Go" type="image"></div><input type="hidden" name="this_doc_product" id="this_doc_product" value="Amazon Elastic Compute Cloud"><input type="hidden" name="this_doc_guide" id="this_doc_guide" value="User Guide for Linux Instances"><input type="hidden" name="doc_locale" value="en_us"></form></div><div id="toc"><ul class="awstoc"><li class="awstoc closed"><a class="awstoc" href="concepts.html">What Is Amazon EC2?</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="ec2-instances-and-amis.html">Instances and AMIs</a></li><li class="awstoc leaf"><a class="awstoc" href="using-regions-availability-zones.html">Regions and Availability Zones</a></li><li class="awstoc leaf"><a class="awstoc" href="RootDeviceStorage.html">Root Device Volume</a></li></ul></li><li class="awstoc leaf"><a class="awstoc" href="get-set-up-for-amazon-ec2.html">Setting Up</a></li><li class="awstoc leaf"><a class="awstoc" href="EC2_GetStarted.html">Getting Started</a></li><li class="awstoc leaf"><a class="awstoc" href="ec2-best-practices.html">Best Practices</a></li><li class="awstoc opened"><a class="awstoc" href="ec2-tutorials.html">Tutorials</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc selected" href="install-LAMP.html">Tutorial: Installing a LAMP Web Server on Amazon Linux</a></li><li class="awstoc leaf"><a class="awstoc" href="hosting-wordpress.html">Tutorial: Hosting a WordPress Blog</a></li><li class="awstoc leaf"><a class="awstoc" href="SSL-on-an-instance.html">Tutorial: Configure Apache Web Server on Amazon Linux to use
SSL/TLS</a></li><li class="awstoc leaf"><a class="awstoc" href="ec2-increase-availability.html">Tutorial: Increase the Availability of Your Application</a></li><li class="awstoc leaf"><a class="awstoc" href="tutorial_run_command.html">Tutorial: Remotely Manage Your Instances</a></li></ul></li><li class="awstoc closed"><a class="awstoc" href="AMIs.html">Amazon Machine Images</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="ComponentsAMIs.html">AMI Types</a></li><li class="awstoc leaf"><a class="awstoc" href="virtualization_types.html">Virtualization Types</a></li><li class="awstoc leaf"><a class="awstoc" href="finding-an-ami.html">Finding a Linux AMI</a></li><li class="awstoc closed"><a class="awstoc" href="sharing-amis.html">Shared AMIs</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="usingsharedamis-finding.html">Finding Shared AMIs</a></li><li class="awstoc leaf"><a class="awstoc" href="sharingamis-intro.html">Making an AMI Public</a></li><li class="awstoc leaf"><a class="awstoc" href="sharingamis-explicit.html">Sharing an AMI with Specific AWS Accounts</a></li><li class="awstoc leaf"><a class="awstoc" href="using-bookmarks.html">Using Bookmarks</a></li><li class="awstoc leaf"><a class="awstoc" href="building-shared-amis.html">Guidelines for Shared Linux AMIs</a></li></ul></li><li class="awstoc leaf"><a class="awstoc" href="paid-amis.html">Paid AMIs</a></li><li class="awstoc leaf"><a class="awstoc" href="creating-an-ami-ebs.html">Creating an Amazon EBS-Backed Linux AMI</a></li><li class="awstoc closed"><a class="awstoc" href="creating-an-ami-instance-store.html">Creating an Instance Store-Backed Linux
AMI</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="set-up-ami-tools.html">Setting Up the AMI Tools</a></li><li class="awstoc leaf"><a class="awstoc" href="create-instance-store-ami.html">Creating an AMI from an Instance Store-Backed Instance</a></li><li class="awstoc leaf"><a class="awstoc" href="Using_ConvertingS3toEBS.html">Converting to an Amazon EBS-Backed AMI</a></li></ul></li><li class="awstoc leaf"><a class="awstoc" href="AMIEncryption.html">AMIs with Encrypted Snapshots</a></li><li class="awstoc leaf"><a class="awstoc" href="CopyingAMIs.html">Copying an AMI</a></li><li class="awstoc leaf"><a class="awstoc" href="deregister-ami.html">Deregistering Your AMI</a></li><li class="awstoc leaf"><a class="awstoc" href="AmazonLinuxAMIBasics.html">Amazon Linux</a></li><li class="awstoc leaf"><a class="awstoc" href="UserProvidedKernels.html">PV-GRUB</a></li></ul></li><li class="awstoc closed"><a class="awstoc" href="Instances.html">Instances</a><ul class="awstoc"><li class="awstoc closed"><a class="awstoc" href="instance-types.html">Instance Types</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="t2-instances.html">T2 Instances</a></li><li class="awstoc leaf"><a class="awstoc" href="c4-instances.html">C4 Instances</a></li><li class="awstoc leaf"><a class="awstoc" href="using_cluster_computing.html">GPU Instances</a></li><li class="awstoc leaf"><a class="awstoc" href="i2-instances.html">I2 Instances</a></li><li class="awstoc leaf"><a class="awstoc" href="d2-instances.html">D2 Instances</a></li><li class="awstoc leaf"><a class="awstoc" href="storage_instances.html">HI1 Instances</a></li><li class="awstoc leaf"><a class="awstoc" href="high_storage_instances.html">HS1 Instances</a></li><li class="awstoc leaf"><a class="awstoc" href="concepts_micro_instances.html">T1 Micro Instances</a></li><li class="awstoc leaf"><a class="awstoc" href="x1-instances.html">X1 Instances</a></li><li class="awstoc leaf"><a class="awstoc" href="ec2-instance-resize.html">Resizing Instances</a></li></ul></li><li class="awstoc closed"><a class="awstoc" href="instance-purchasing-options.html">Instance Purchasing Options</a><ul class="awstoc"><li class="awstoc closed"><a class="awstoc" href="concepts-on-demand-reserved-instances.html">Reserved Instances</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="reserved-instances-fundamentals.html">How Reserved Instances Work</a></li><li class="awstoc leaf"><a class="awstoc" href="concepts-reserved-instances-application.html">Billing Benefits and Payment
Options</a></li><li class="awstoc closed"><a class="awstoc" href="ri-market-concepts-buying.html">Buying Reserved Instances</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="ri-market-buying-guide.html">Buying in the Reserved Instance
Marketplace</a></li></ul></li><li class="awstoc closed"><a class="awstoc" href="ri-market-selling-guide.html">Selling in the Reserved Instance Marketplace</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="ri-market-seller-profile.html">Registering as a Seller</a></li></ul></li><li class="awstoc closed"><a class="awstoc" href="ri-modifying.html">Modifying Your Reserved Instances</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="ri-modification-limits.html">Requirements for Modification</a></li><li class="awstoc leaf"><a class="awstoc" href="ri-modification-instancemove.html">Modifying the Instance Size of Your
Reservations</a></li><li class="awstoc leaf"><a class="awstoc" href="ri-modification-process.html">Submitting Modification Requests</a></li></ul></li><li class="awstoc leaf"><a class="awstoc" href="ri-modification-process-messages.html">Troubleshooting Modification
Requests</a></li></ul></li><li class="awstoc leaf"><a class="awstoc" href="ec2-scheduled-instances.html">Scheduled Instances</a></li><li class="awstoc closed"><a class="awstoc" href="using-spot-instances.html">Spot Instances</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="how-spot-instances-work.html">How Spot Instances Work</a></li><li class="awstoc leaf"><a class="awstoc" href="spot-fleet.html">How Spot Fleet Works</a></li><li class="awstoc leaf"><a class="awstoc" href="using-spot-instances-history.html">Spot Instance Pricing History</a></li><li class="awstoc closed"><a class="awstoc" href="spot-requests.html">Spot Instance Requests</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="spot-request-examples.html">Example Launch Specifications</a></li></ul></li><li class="awstoc closed"><a class="awstoc" href="spot-fleet-requests.html">Spot Fleet Requests</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="spot-fleet-examples.html">Example Configurations</a></li></ul></li><li class="awstoc leaf"><a class="awstoc" href="spot-fleet-cloudwatch-metrics.html">CloudWatch Metrics for Spot Fleet</a></li><li class="awstoc leaf"><a class="awstoc" href="spot-fleet-automatic-scaling.html">Automatic Scaling for Spot Fleet</a></li><li class="awstoc leaf"><a class="awstoc" href="spot-bid-status.html">Spot Bid Status</a></li><li class="awstoc leaf"><a class="awstoc" href="spot-interruptions.html">Spot Instance Interruptions</a></li><li class="awstoc leaf"><a class="awstoc" href="spot-data-feeds.html">Spot Instance Data Feed</a></li><li class="awstoc leaf"><a class="awstoc" href="using-spot-limits.html">Spot Instance Limits</a></li></ul></li><li class="awstoc closed"><a class="awstoc" href="dedicated-hosts-overview.html">Dedicated Hosts</a><ul class="awstoc"><li class="awstoc closed"><a class="awstoc" href="how-dedicated-hosts-work.html">Using Dedicated Hosts</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="dedicated-hosts-instance-placement.html">Understanding Instance
Placement and Host Affinity</a></li></ul></li><li class="awstoc leaf"><a class="awstoc" href="dedicated-hosts-monitoring.html">Monitoring Dedicated Hosts</a></li></ul></li></ul></li><li class="awstoc closed"><a class="awstoc" href="ec2-instance-lifecycle.html">Instance Lifecycle</a><ul class="awstoc"><li class="awstoc closed"><a class="awstoc" href="LaunchingAndUsingInstances.html">Launch</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="launching-instance.html">Launching an Instance</a></li><li class="awstoc leaf"><a class="awstoc" href="launch-more-like-this.html">Launching an Instance From an Existing Instance</a></li><li class="awstoc leaf"><a class="awstoc" href="instance-launch-snapshot.html">Launching a Linux Instance from a Backup</a></li><li class="awstoc leaf"><a class="awstoc" href="launch-marketplace-console.html">Launching an AWS Marketplace Instance</a></li></ul></li><li class="awstoc closed"><a class="awstoc" href="AccessingInstances.html">Connect</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="AccessingInstancesLinux.html">Connect Using SSH</a></li><li class="awstoc leaf"><a class="awstoc" href="putty.html">Connect Using PuTTY</a></li><li class="awstoc leaf"><a class="awstoc" href="mindterm.html">Connect Using MindTerm</a></li></ul></li><li class="awstoc leaf"><a class="awstoc" href="Stop_Start.html">Stop and Start</a></li><li class="awstoc leaf"><a class="awstoc" href="ec2-instance-reboot.html">Reboot</a></li><li class="awstoc leaf"><a class="awstoc" href="instance-retirement.html">Retire</a></li><li class="awstoc leaf"><a class="awstoc" href="terminating-instances.html">Terminate</a></li><li class="awstoc leaf"><a class="awstoc" href="ec2-instance-recover.html">Recover</a></li></ul></li><li class="awstoc closed"><a class="awstoc" href="Configure_Instance.html">Configure Instances</a><ul class="awstoc"><li class="awstoc closed"><a class="awstoc" href="managing-software.html">Managing Software</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="install-updates.html">Updating Instance Software</a></li><li class="awstoc leaf"><a class="awstoc" href="add-repositories.html">Adding Repositories</a></li><li class="awstoc leaf"><a class="awstoc" href="find-software.html">Finding Software Packages</a></li><li class="awstoc leaf"><a class="awstoc" href="install-software.html">Installing Software Packages</a></li><li class="awstoc leaf"><a class="awstoc" href="compile-software.html">Preparing to Compile Software</a></li></ul></li><li class="awstoc leaf"><a class="awstoc" href="managing-users.html">Managing Users</a></li><li class="awstoc leaf"><a class="awstoc" href="processor_state_control.html">Processor State Control</a></li><li class="awstoc leaf"><a class="awstoc" href="set-time.html">Setting the Time</a></li><li class="awstoc leaf"><a class="awstoc" href="set-hostname.html">Changing the Hostname</a></li><li class="awstoc leaf"><a class="awstoc" href="dynamic-dns.html">Setting Up Dynamic DNS</a></li><li class="awstoc leaf"><a class="awstoc" href="user-data.html">Running Commands at Launch</a></li><li class="awstoc closed"><a class="awstoc" href="ec2-instance-metadata.html">Instance Metadata and User Data</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="instance-identity-documents.html">Instance Identity Documents</a></li></ul></li></ul></li><li class="awstoc closed"><a class="awstoc" href="execute-remote-commands.html">Remotely Manage Your Instances</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="run-command-concepts.html">Components and Concepts</a></li><li class="awstoc leaf"><a class="awstoc" href="remote-commands-prereq.html">Prerequisites</a></li><li class="awstoc leaf"><a class="awstoc" href="install-ssm-agent.html">Installing the SSM Agent</a></li><li class="awstoc leaf"><a class="awstoc" href="delegate-commands.html">Delegating Access</a></li><li class="awstoc leaf"><a class="awstoc" href="managed-instances.html">Setting Up Run Command On Managed Instances</a></li><li class="awstoc closed"><a class="awstoc" href="run-command.html">Executing Commands</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="remote-commands-shellcript.html">Running Shell Scripts</a></li><li class="awstoc leaf"><a class="awstoc" href="remote-commands-updatessmagent.html">Updating the AWS SSM Agent</a></li></ul></li><li class="awstoc leaf"><a class="awstoc" href="output-commands.html">Viewing Command Output</a></li><li class="awstoc leaf"><a class="awstoc" href="create-ssm-doc.html">Creating SSM Documents</a></li><li class="awstoc closed"><a class="awstoc" href="ssm-sharing.html">Sharing SSM Documents</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="ssm-before-you-share.html">Guidelines for Sharing and Using Shared SSM
Documents</a></li><li class="awstoc leaf"><a class="awstoc" href="ssm-how-to-share.html">How to Share an SSM Document</a></li><li class="awstoc leaf"><a class="awstoc" href="ssm-share-modify.html">How to Modify Permissions for a Shared
Document</a></li><li class="awstoc leaf"><a class="awstoc" href="ssm-using-shared.html">How to Use a Shared SSM Document</a></li></ul></li><li class="awstoc closed"><a class="awstoc" href="walkthrough-commands.html">Walkthroughs</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="walkthrough-linux-ui.html">Using the Console</a></li><li class="awstoc leaf"><a class="awstoc" href="walkthrough-cli.html">Using the AWS CLI</a></li></ul></li><li class="awstoc leaf"><a class="awstoc" href="cancel-commands.html">Cancelling a Command</a></li><li class="awstoc closed"><a class="awstoc" href="monitor-commands.html">Monitoring Commands</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="rc-sns-notifications.html">Amazon SNS Notifications</a></li><li class="awstoc leaf"><a class="awstoc" href="rc-cwe.html">Log Command Execution Status Changes for Run Command</a></li></ul></li><li class="awstoc leaf"><a class="awstoc" href="troubleshooting-remote-commands.html">Troubleshooting Run Command</a></li></ul></li><li class="awstoc leaf"><a class="awstoc" href="instances_of_your_vm.html">Importing and Exporting Virtual Machines</a></li></ul></li><li class="awstoc closed"><a class="awstoc" href="monitoring_ec2.html">Monitoring</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="monitoring_automated_manual.html">Automated and Manual Monitoring</a></li><li class="awstoc leaf"><a class="awstoc" href="monitoring_best_practices.html">Best Practices for Monitoring</a></li><li class="awstoc closed"><a class="awstoc" href="monitoring-instances-status-check.html">Monitoring the Status of Your Instances</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="monitoring-system-instance-status-check.html">Instance Status Checks</a></li><li class="awstoc leaf"><a class="awstoc" href="monitoring-instances-status-check_sched.html">Scheduled Events</a></li></ul></li><li class="awstoc closed"><a class="awstoc" href="using-cloudwatch.html">Monitoring Your Instances Using CloudWatch</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="using-cloudwatch-new.html">Enable Detailed Monitoring</a></li><li class="awstoc leaf"><a class="awstoc" href="viewing_metrics_with_cloudwatch.html">List Available Metrics</a></li><li class="awstoc closed"><a class="awstoc" href="monitoring_get_statistics.html">Get Statistics for Metrics</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="US_SingleMetricPerInstance.html">Get Statistics for a Specific Instance</a></li><li class="awstoc leaf"><a class="awstoc" href="GetSingleMetricAllDimensions.html">Aggregate Statistics Across Instances</a></li><li class="awstoc leaf"><a class="awstoc" href="GetMetricAutoScalingGroup.html">Aggregate Statistics by Auto Scaling Group</a></li><li class="awstoc leaf"><a class="awstoc" href="US_SingleMetricPerAMI.html">Aggregate Statistics by Image (AMI) ID</a></li></ul></li><li class="awstoc closed"><a class="awstoc" href="graphs-in-the-aws-management-console.html">Graph Metrics</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="graph_a_metric.html">Graph a Metric</a></li><li class="awstoc leaf"><a class="awstoc" href="graph_a_metric_all_resources.html">Graph a Metric Across Resources</a></li></ul></li><li class="awstoc closed"><a class="awstoc" href="using-cloudwatch-createalarm.html">Create a CloudWatch Alarm</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="US_AlarmAtThresholdEC2.html">Send Email Based on CPU Usage Alarm</a></li><li class="awstoc leaf"><a class="awstoc" href="US_AlarmAtThresholdELB.html">Send Email Based on Load Balancer Alarm</a></li><li class="awstoc leaf"><a class="awstoc" href="US_AlarmAtThresholdEBS.html">Send Email Based on Storage Throughput Alarm</a></li></ul></li><li class="awstoc leaf"><a class="awstoc" href="UsingAlarmActions.html">Create Alarms That Stop, Terminate, Reboot, or Recover an Instance</a></li></ul></li><li class="awstoc leaf"><a class="awstoc" href="mon-scripts.html">Monitoring Memory and Disk Metrics</a></li></ul></li><li class="awstoc closed"><a class="awstoc" href="EC2_Network_and_Security.html">Network and Security</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="ec2-key-pairs.html">Key Pairs</a></li><li class="awstoc leaf"><a class="awstoc" href="using-network-security.html">Security Groups</a></li><li class="awstoc closed"><a class="awstoc" href="UsingIAM.html">Controlling Access</a><ul class="awstoc"><li class="awstoc closed"><a class="awstoc" href="iam-policies-for-amazon-ec2.html">IAM Policies</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="iam-policy-structure.html">Policy Structure</a></li><li class="awstoc leaf"><a class="awstoc" href="ec2-supported-iam-actions-resources.html">Supported Resource-Level Permissions</a></li><li class="awstoc leaf"><a class="awstoc" href="ExamplePolicies_EC2.html">Example Policies for CLI or SDK</a></li><li class="awstoc leaf"><a class="awstoc" href="iam-policies-ec2-console.html">Example Policies for the Console</a></li></ul></li><li class="awstoc leaf"><a class="awstoc" href="iam-roles-for-amazon-ec2.html">IAM Roles</a></li><li class="awstoc leaf"><a class="awstoc" href="authorizing-access-to-an-instance.html">Network Access</a></li></ul></li><li class="awstoc closed"><a class="awstoc" href="using-vpc.html">Amazon VPC</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="ec2-supported-platforms.html">Supported Platforms</a></li><li class="awstoc leaf"><a class="awstoc" href="vpc-classiclink.html">ClassicLink</a></li><li class="awstoc leaf"><a class="awstoc" href="vpc-migrate.html">Migrating from EC2-Classic to a VPC</a></li></ul></li><li class="awstoc closed"><a class="awstoc" href="using-instance-addressing.html">Instance IP Addressing</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="MultipleIP.html">Multiple Private IP Addresses</a></li></ul></li><li class="awstoc leaf"><a class="awstoc" href="elastic-ip-addresses-eip.html">Elastic IP Addresses</a></li><li class="awstoc leaf"><a class="awstoc" href="using-eni.html">Elastic Network Interfaces</a></li><li class="awstoc leaf"><a class="awstoc" href="placement-groups.html">Placement Groups</a></li><li class="awstoc leaf"><a class="awstoc" href="network_mtu.html">Network MTU</a></li><li class="awstoc closed"><a class="awstoc" href="enhanced-networking.html">Enhanced Networking</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="sriov-networking.html">Enabling Enhanced Networking: Intel 82599 VF</a></li><li class="awstoc leaf"><a class="awstoc" href="enhanced-networking-ena.html">Enabling Enhanced Networking: ENA</a></li><li class="awstoc leaf"><a class="awstoc" href="troubleshooting-ena.html">Troubleshoooting ENA</a></li></ul></li></ul></li><li class="awstoc closed"><a class="awstoc" href="Storage.html">Storage</a><ul class="awstoc"><li class="awstoc closed"><a class="awstoc" href="AmazonEBS.html">Amazon EBS</a><ul class="awstoc"><li class="awstoc closed"><a class="awstoc" href="EBSVolumes.html">EBS Volumes</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="EBSVolumeTypes.html">EBS Volume Types</a></li><li class="awstoc leaf"><a class="awstoc" href="ebs-creating-volume.html">Creating a Volume</a></li><li class="awstoc leaf"><a class="awstoc" href="ebs-restoring-volume.html">Restoring from a Snapshot</a></li><li class="awstoc leaf"><a class="awstoc" href="ebs-attaching-volume.html">Attaching a Volume to an Instance</a></li><li class="awstoc leaf"><a class="awstoc" href="ebs-using-volumes.html">Making a Volume Available for Use</a></li><li class="awstoc leaf"><a class="awstoc" href="ebs-describing-volumes.html">Volume Information</a></li><li class="awstoc leaf"><a class="awstoc" href="monitoring-volume-status.html">Monitoring the Status of Your Volumes</a></li><li class="awstoc leaf"><a class="awstoc" href="ebs-detaching-volume.html">Detaching a Volume from an Instance</a></li><li class="awstoc leaf"><a class="awstoc" href="ebs-deleting-volume.html">Deleting a Volume</a></li><li class="awstoc leaf"><a class="awstoc" href="ebs-expand-volume.html">Expanding a Volume</a></li><li class="awstoc leaf"><a class="awstoc" href="storage_expand_partition.html">Expanding a Linux Partition</a></li></ul></li><li class="awstoc closed"><a class="awstoc" href="EBSSnapshots.html">EBS Snapshots</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="ebs-creating-snapshot.html">Creating a Snapshot</a></li><li class="awstoc leaf"><a class="awstoc" href="ebs-deleting-snapshot.html">Deleting a Snapshot</a></li><li class="awstoc leaf"><a class="awstoc" href="ebs-copy-snapshot.html">Copying a Snapshot</a></li><li class="awstoc leaf"><a class="awstoc" href="ebs-describing-snapshots.html">Viewing Snapshot Information</a></li><li class="awstoc leaf"><a class="awstoc" href="ebs-modifying-snapshot-permissions.html">Sharing a Snapshot</a></li></ul></li><li class="awstoc leaf"><a class="awstoc" href="EBSOptimized.html">EBS Optimization</a></li><li class="awstoc leaf"><a class="awstoc" href="EBSEncryption.html">EBS Encryption</a></li><li class="awstoc closed"><a class="awstoc" href="EBSPerformance.html">EBS Performance</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="ebs-ec2-config.html">EC2 Configuration</a></li><li class="awstoc leaf"><a class="awstoc" href="ebs-io-characteristics.html">I/O Characteristics</a></li><li class="awstoc leaf"><a class="awstoc" href="ebs-initialize.html">Initialize Volumes</a></li><li class="awstoc leaf"><a class="awstoc" href="raid-config.html">RAID Configuration on Linux</a></li><li class="awstoc leaf"><a class="awstoc" href="benchmark_procedures.html">Benchmark EBS Volumes</a></li></ul></li></ul></li><li class="awstoc closed"><a class="awstoc" href="InstanceStorage.html">Instance Store</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="add-instance-store-volumes.html">Add Instance Store Volumes</a></li><li class="awstoc leaf"><a class="awstoc" href="ssd-instance-store.html">SSD Instance Store Volumes</a></li><li class="awstoc leaf"><a class="awstoc" href="instance-store-swap-volumes.html">Instance Store Swap Volumes</a></li><li class="awstoc leaf"><a class="awstoc" href="disk-performance.html">Optimizing Disk Performance</a></li></ul></li><li class="awstoc leaf"><a class="awstoc" href="AmazonS3.html">Amazon S3</a></li><li class="awstoc leaf"><a class="awstoc" href="volume_limits.html">Instance Volume Limits</a></li><li class="awstoc leaf"><a class="awstoc" href="device_naming.html">Device Naming</a></li><li class="awstoc leaf"><a class="awstoc" href="block-device-mapping-concepts.html">Block Device Mapping</a></li><li class="awstoc leaf"><a class="awstoc" href="using-public-data-sets.html">Using Public Data Sets</a></li></ul></li><li class="awstoc closed"><a class="awstoc" href="EC2_Resources.html">Resources and Tags</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="resources.html">Resource Locations</a></li><li class="awstoc leaf"><a class="awstoc" href="resource-ids.html">Resource IDs</a></li><li class="awstoc leaf"><a class="awstoc" href="Using_Filtering.html">Listing and Filtering Your Resources</a></li><li class="awstoc leaf"><a class="awstoc" href="Using_Tags.html">Tagging Your Resources</a></li><li class="awstoc leaf"><a class="awstoc" href="ec2-resource-limits.html">Service Limits</a></li><li class="awstoc closed"><a class="awstoc" href="usage-reports.html">Usage Reports</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="usage-reports-instance.html">Instance Usage</a></li><li class="awstoc leaf"><a class="awstoc" href="usage-reports-ri.html">Reserved Instance Utilization</a></li></ul></li></ul></li><li class="awstoc closed"><a class="awstoc" href="ec2-instance-troubleshoot.html">Troubleshooting</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="Using_InstanceStraightToTerminated.html">Launching Your Instance</a></li><li class="awstoc leaf"><a class="awstoc" href="TroubleshootingInstancesConnecting.html">Connecting to Your Instance</a></li><li class="awstoc leaf"><a class="awstoc" href="TroubleshootingInstancesStopping.html">Stopping Your Instance</a></li><li class="awstoc leaf"><a class="awstoc" href="TroubleshootingInstancesShuttingDown.html">Terminating Your Instance</a></li><li class="awstoc leaf"><a class="awstoc" href="TroubleshootingInstanceRecovery.html">Instance Recovery Failures</a></li><li class="awstoc leaf"><a class="awstoc" href="TroubleshootingInstances.html">Failed Status Checks</a></li><li class="awstoc leaf"><a class="awstoc" href="instance-capacity.html">Instance Capacity</a></li><li class="awstoc leaf"><a class="awstoc" href="instance-console.html">Getting Console Output and Rebooting Instances</a></li><li class="awstoc leaf"><a class="awstoc" href="instance-booting-from-wrong-volume.html">My Instance is Booting from the Wrong
Volume</a></li></ul></li><li class="awstoc leaf"><a class="awstoc" href="available-apis.html">Making API Requests</a></li><li class="awstoc leaf"><a class="awstoc" href="DocumentHistory.html">Document History</a></li><li class="awstoc leaf"><a class="awstoc" href="glossary.html">AWS Glossary</a></li></ul></div></div><div id="main-column"><div id="main"><div id="main-content"><div id="breadcrumbs"><table summary="Breadcrumbs"><tr><td><div class="navheader"><div class="breadcrumb"><a href="http://aws.amazon.com/documentation/">AWS Documentation</a> &raquo; <a href="http://aws.amazon.com/documentation/ec2/">Amazon EC2</a> &raquo; <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/">User Guide for Linux Instances</a> &raquo; <a href="ec2-tutorials.html">Tutorials for Amazon EC2 Instances Running Linux</a> &raquo; <span class="breadcrumb">Tutorial: Installing a LAMP Web Server on Amazon Linux</span></div></div></td></tr></table></div><div id="main-col-body"><div></div><div class="section"><div class="titlepage"><div><div><h1 class="topictitle">Tutorial: Installing a LAMP Web Server on Amazon Linux</h1></div></div></div><p>The following procedures help you install the Apache web server with PHP and MySQL support
on your Amazon Linux instance (sometimes called a LAMP web server or LAMP stack). You can use this
server to host a static website or deploy a dynamic PHP application that reads and writes
information to a database.</p><p><span class="formpara">Prerequisites</span></p><p>This tutorial assumes that you have already launched an instance with a public DNS
name that is reachable from the Internet. For more information, see <a class="xref" href="EC2_GetStarted.html#ec2-launch-instance_linux" title="Step 1: Launch an Instance">Step 1: Launch an Instance</a>. You
must also have configured your security group to allow <code class="literal">SSH</code> (port 22),
<code class="literal">HTTP</code> (port 80), and <code class="literal">HTTPS</code> (port 443)
connections. For more information about these prerequisites, see <a class="xref" href="get-set-up-for-amazon-ec2.html" title="Setting Up with Amazon EC2">Setting Up with Amazon EC2</a>.</p><div class="aws-note"><p class="aws-note">Important</p><p>If you are trying to set up a LAMP web server on an Ubuntu instance, this tutorial
will not work for you. These procedures are intended for use with Amazon Linux. For more
information about other distributions, see their specific documentation. For
information about LAMP web servers on Ubuntu, see the Ubuntu community documentation
<a class="ulink" href="https://help.ubuntu.com/community/ApacheMySQLPHP" target="_blank">ApacheMySQLPHP</a>
topic.</p></div><div class="procedure"><a name="d0e3713"></a><p class="title"><b>To install and start the LAMP web server on Amazon Linux</b></p><ol class="procedure" type="1"><li class="step"><p><a class="link" href="EC2_GetStarted.html#ec2-connect-to-instance-linux" title="Step 2: Connect to Your Instance">Connect to your
instance</a>.</p></li><li class="step"><p>To ensure that all of your software packages are up to date, perform a quick
software update on your instance. This process may take a few minutes, but it is
important to make sure you have the latest security updates and bug fixes.</p><div class="aws-note"><p class="aws-note">Note</p><p>The <code class="option">-y</code> option installs the updates without asking for
confirmation. If you would like to examine the updates before installing,
you can omit this option.</p></div><pre class="programlisting"><code class="nohighlight">[ec2-user ~]$ <strong class="userinput"><code>sudo yum update -y</code></strong></code></pre></li><li class="step"><p>Now that your instance is current, you can install the Apache web server, MySQL,
and PHP software packages. Use the <span class="command"><strong>yum install</strong></span> command to install
multiple software packages and all related dependencies at the same time.
</p><pre class="programlisting"><code class="nohighlight">[ec2-user ~]$ <strong class="userinput"><code>sudo yum install -y httpd24 php56 mysql55-server php56-mysqlnd</code></strong></code></pre></li><li class="step"><p>Start the Apache web
server.</p><pre class="programlisting"><code class="nohighlight">[ec2-user ~]$ <strong class="userinput"><code>sudo service httpd start</code></strong>
Starting httpd: [ OK ]</code></pre></li><li class="step"><p> Use the <span class="command"><strong>chkconfig</strong></span> command to configure the Apache web server
to start at each system boot.</p><pre class="programlisting"><code class="nohighlight">[ec2-user ~]$ <strong class="userinput"><code>sudo chkconfig httpd on</code></strong></code></pre><div class="aws-note"><p class="aws-note">Tip</p><p>The <span class="command"><strong>chkconfig</strong></span> command does not provide any confirmation
message when you successfully enable a service. You can verify that
<span class="command"><strong>httpd</strong></span> is on by running the following command.</p></div><pre class="programlisting"><code class="nohighlight">[ec2-user ~]$ <strong class="userinput"><code>chkconfig --list httpd</code></strong>
httpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off</code></pre><p>Here,
<span class="command"><strong>httpd</strong></span> is <code class="literal">on</code> in runlevels 2, 3, 4, and 5
(which is what you want to see).</p></li><li class="step"><p>Test your web server. In a web browser, enter the public DNS address (or the
public IP address) of your instance; you should see the Apache test page. You can
get the public DNS for your instance using the Amazon EC2 console (check the
<span class="guilabel">Public DNS</span> column; if this column is hidden, choose
<span class="guilabel">Show/Hide</span> and select <span class="guilabel">Public DNS</span>).</p><div class="aws-note"><p class="aws-note">Tip</p><p>If you are unable to see the Apache test page, check that the security
group you are using contains a rule to allow <code class="literal">HTTP</code> (port
80) traffic. For information about adding an <code class="literal">HTTP</code> rule to
your security group, see <a class="xref" href="using-network-security.html#adding-security-group-rule" title="Adding Rules to a Security Group">Adding Rules to a Security Group</a>.</p></div><div class="aws-note"><p class="aws-note">Important</p><p>If you are not using Amazon Linux, you may also need to configure the firewall on
your instance to allow these connections. For more information about how to
configure the firewall, see the documentation for your specific
distribution.</p></div><div class="mediaobject"><img src="images/apache_test_page2.4.png" alt="Apache test page"></div><div class="aws-note"><p class="aws-note">Note</p><p>This test page appears only when there is no content in
<code class="filename">/var/www/html</code>. When you add content to the document
root, your content appears at the public DNS address of your instance instead of
this test page.</p></div></li></ol></div><p>Apache <span class="command"><strong>httpd</strong></span> serves files that are kept in a directory called the
Apache document root. The Amazon Linux Apache document root is <code class="filename">/var/www/html</code>,
which is owned by <code class="literal">root</code> by
default.</p><pre class="programlisting"><code class="nohighlight">[ec2-user ~]$ <strong class="userinput"><code>ls -l /var/www</code></strong>
total 16
drwxr-xr-x 2 root root 4096 Jul 12 01:00 cgi-bin
drwxr-xr-x 3 root root 4096 Aug 7 00:02 error
drwxr-xr-x 2 root root 4096 Jan 6 2012 html
drwxr-xr-x 3 root root 4096 Aug 7 00:02 icons
</code></pre><p>To
allow <code class="literal">ec2-user</code> to manipulate files in this directory, you need to modify
the ownership and permissions of the directory. There are many ways to accomplish this task;
in this tutorial, you add a <code class="literal">www</code> group to your instance, and you give that
group ownership of the <code class="filename">/var/www</code> directory and add write permissions for
the group. Any members of that group will then be able to add, delete, and modify files for
the web server.</p><div class="procedure"><a name="SettingFilePermissions"></a><p class="title"><b>To set file permissions</b></p><ol class="procedure" type="1"><li class="step"><p>Add the <code class="literal">www</code> group to your
instance.</p><pre class="programlisting"><code class="nohighlight">[ec2-user ~]$ <strong class="userinput"><code>sudo groupadd www</code></strong></code></pre></li><li class="step"><p>Add your user (in this case, <code class="literal">ec2-user</code>) to the
<code class="literal">www</code> group.</p><pre class="programlisting"><code class="nohighlight">[ec2-user ~]$ <strong class="userinput"><code>sudo usermod -a -G www <em class="replaceable"><code>ec2-user</code></em></code></strong></code></pre><div class="aws-note"><p class="aws-note">Important</p><p>You need to log out and log back in to pick up the new group. You can use
the <span class="command"><strong>exit</strong></span> command, or close the terminal window.</p></div></li><li class="step"><p>Log out and then log back in again, and verify your membership in the
<code class="literal">www</code> group.</p><ol type="a" class="substeps"><li class="step"><p>Log
out.</p><pre class="programlisting"><code class="nohighlight">[ec2-user ~]$ <strong class="userinput"><code>exit</code></strong></code></pre></li><li class="step"><p>Reconnect to your instance, and then run the following command to verify
your membership in the <code class="literal">www</code>
group.</p><pre class="programlisting"><code class="nohighlight">[ec2-user ~]$ <strong class="userinput"><code>groups</code></strong>
ec2-user wheel www</code></pre></li></ol></li><li class="step"><p>Change the group ownership of <code class="filename">/var/www</code> and its contents to
the <code class="literal">www</code>
group.</p><pre class="programlisting"><code class="nohighlight">[ec2-user ~]$ <strong class="userinput"><code>sudo chown -R root:www /var/www</code></strong></code></pre></li><li class="step"><p>Change the directory permissions of <code class="filename">/var/www</code> and its
subdirectories to add group write permissions and to set the group ID on future
subdirectories.</p><pre class="programlisting"><code class="nohighlight">[ec2-user ~]$ <strong class="userinput"><code>sudo chmod 2775 /var/www</code></strong>
[ec2-user ~]$ <strong class="userinput"><code>find /var/www -type d -exec sudo chmod 2775 {} \;</code></strong></code></pre></li><li class="step"><p>Recursively change the file permissions of <code class="filename">/var/www</code> and its
subdirectories to add group write
permissions.</p><pre class="programlisting"><code class="nohighlight">[ec2-user ~]$ <strong class="userinput"><code>find /var/www -type f -exec sudo chmod 0664 {} \;</code></strong></code></pre></li></ol></div><p>Now <code class="literal">ec2-user</code> (and any future members of the <code class="literal">www</code>
group) can add, delete, and edit files in the Apache document root. Now you are ready to add
content, such as a static website or a PHP application.</p><p><span class="formpara">(Optional) Secure your web server</span></p><p>A web server running the HTTP protocol provides no transport security for the data
that it sends or receives. When you connect to an HTTP server using a web browser, the
URLs that you enter, the content of web pages that you receive, and the contents
(including passwords) of any HTML forms that you submit are all visible to eavesdroppers
anywhere along the network pathway. The best practice for securing your web server is to
install support for HTTPS (HTTP Secure), which protects your data with SSL/TLS
encryption.</p><p>For information about enabling HTTPS on your server, see <a class="ulink" href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/SSL-on-an-instance.html" target="_blank">Tutorial: Configure Apache Web Server on
Amazon Linux to use SSL/TLS</a>.</p><div class="procedure"><a name="d0e3961"></a><p class="title"><b>To test your LAMP web server </b></p><p>If your server is installed and running, and your file permissions are set correctly,
your <code class="literal">ec2-user</code> account should be able to create a simple PHP file in
the <code class="filename">/var/www/html</code> directory that will be available from the
Internet.</p><ol class="procedure" type="1"><li class="step"><p>Create a simple PHP file in the Apache document root.</p><pre class="programlisting"><code class="nohighlight">[ec2-user ~]$ <strong class="userinput"><code>echo "&lt;?php phpinfo(); ?&gt;" &gt; /var/www/html/phpinfo.php</code></strong></code></pre><div class="aws-note"><p class="aws-note">Tip</p><p>If you get a "<code class="literal">Permission denied</code>" error when trying to
run this command, try logging out and logging back in again to pick up the
proper group permissions that you configured in <a class="xref" href="install-LAMP.html#SettingFilePermissions" title="To set file permissions">To set file permissions</a>.</p></div></li><li class="step"><p>In a web browser, enter the URL of the file you just created. This URL is the
public DNS address of your instance followed by a forward slash and the file name.
For
example:</p><pre class="programlisting"><code class="nohighlight">http://<em class="replaceable"><code>my.public.dns.amazonaws.com</code></em>/phpinfo.php</code></pre><p>You
should see the PHP information page:</p><div class="mediaobject"><img src="images/phpinfo5.6.6.png"></div><div class="aws-note"><p class="aws-note">Note</p><p>If you do not see this page, verify that the
<code class="filename">/var/www/html/phpinfo.php</code> file was created properly in
the previous step. You can also verify that all of the required packages were
installed with the following command (the package versions in the second column
do not need to match this example
output):</p><pre class="programlisting"><code class="nohighlight">[ec2-user ~]$ <strong class="userinput"><code>sudo yum list installed httpd24 php56 mysql55-server php56-mysqlnd</code></strong>
Loaded plugins: priorities, update-motd, upgrade-helper
959 packages excluded due to repository priority protections
Installed Packages
httpd24.x86_64 2.4.16-1.62.amzn1 @amzn-main
mysql55-server.x86_64 5.5.45-1.9.amzn1 @amzn-main
php56.x86_64 5.6.13-1.118.amzn1 @amzn-main
php56-mysqlnd.x86_64 5.6.13-1.118.amzn1 @amzn-main</code></pre><p>If any of the required packages are not listed in your output, install them
with the <span class="command"><strong>sudo yum install <em class="replaceable"><code>package</code></em></strong></span>
command.</p></div></li><li class="step"><p>Delete the <code class="filename">phpinfo.php</code> file. Although this can be useful
information to you, it should not be broadcast to the Internet for security
reasons.</p><pre class="programlisting"><code class="nohighlight">[ec2-user ~]$ <strong class="userinput"><code>rm /var/www/html/phpinfo.php</code></strong></code></pre></li></ol></div><div class="procedure"><a name="SecuringMySQLProcedure"></a><p class="title"><b>To secure the MySQL server</b></p><p>The default installation of the MySQL server has several features that are great for
testing and development, but they should be disabled or removed for production servers.
The <span class="command"><strong>mysql_secure_installation</strong></span> command walks you through the process
of setting a root password and removing the insecure features from your installation.
Even if you are not planning on using the MySQL server, performing this procedure is a
good idea.</p><ol class="procedure" type="1"><li class="step"><p>Start the MySQL server.
</p><pre class="programlisting"><code class="nohighlight">[ec2-user ~]$ <strong class="userinput"><code>sudo service mysqld start</code></strong>
Initializing MySQL database: Installing MySQL system tables...
OK
Filling help tables...
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
...
Starting mysqld: [ OK ]
</code></pre></li><li class="step"><p>Run <span class="command"><strong>mysql_secure_installation</strong></span>.
</p><pre class="programlisting"><code class="nohighlight">[ec2-user ~]$ <strong class="userinput"><code>sudo mysql_secure_installation</code></strong></code></pre><ol type="a" class="substeps"><li class="step"><p>When prompted, enter a password for the <code class="literal">root</code>
account.</p><ol type="i" class="substeps"><li class="step"><p>Enter the current <code class="literal">root</code> password. By default,
the <code class="literal">root</code> account does not have a password set, so
press <span class="keycap"><strong>Enter</strong></span>.</p></li><li class="step"><p>Type <span class="keycap"><strong>Y</strong></span> to set a password, and enter a secure
password twice. For more information about creating a secure
password, see <a class="ulink" href="http://www.pctools.com/guides/password/" target="_blank">http://www.pctools.com/guides/password/</a>. Make sure to
store this password in a safe place.</p><div class="aws-note"><p class="aws-note">Note</p><p>Setting a root password for MySQL is only the most basic
measure for securing your database. When you build or install a
database-driven application, you typically create a database
service user for that application and avoid using the root
account for anything but database administration. </p></div></li></ol></li><li class="step"><p>Type <span class="keycap"><strong>Y</strong></span> to remove the anonymous user accounts.</p></li><li class="step"><p>Type <span class="keycap"><strong>Y</strong></span> to disable remote <code class="literal">root</code>
login.</p></li><li class="step"><p>Type <span class="keycap"><strong>Y</strong></span> to remove the test database.</p></li><li class="step"><p>Type <span class="keycap"><strong>Y</strong></span> to reload the privilege tables and save your
changes.</p></li></ol></li><li class="step"><p>(Optional) Stop the MySQL server if you do not plan to use it right away. You can
restart the server when you need it
again.</p><pre class="programlisting"><code class="nohighlight">[ec2-user ~]$ <strong class="userinput"><code>sudo service mysqld stop</code></strong>
Stopping mysqld: [ OK ]</code></pre></li><li class="step"><p>(Optional) If you want the MySQL server to start at every boot, enter the
following
command.</p><pre class="programlisting"><code class="nohighlight">[ec2-user ~]$ <strong class="userinput"><code>sudo chkconfig mysqld on</code></strong></code></pre></li></ol></div><p>You should now have a fully functional LAMP web server. If you add content to the Apache
document root at <code class="filename">/var/www/html</code>, you should be able to view that content
at the public DNS address for your instance. </p><div class="procedure"><a name="d0e4133"></a><p class="title"><b>(Optional) Install phpMyAdmin</b></p><p><a class="ulink" href="https://www.phpmyadmin.net/" target="_blank">phpMyAdmin</a> is a web-based database
management tool that you can use to view and edit the MySQL databases on your EC2
instance. Follow the steps below to install and configure phpMyAdmin on your Amazon Linux
instance.</p><div class="aws-note"><p class="aws-note">Important</p><p>We do not recommend using phpMyAdmin to access a LAMP server unless you have
enabled SSL/TLS in Apache; otherwise, your database administrator password and other
data will be transmitted insecurely across the Internet. For information about
configuring a secure web server on an EC2 instance, see <a class="ulink" href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/SSL-on-an-instance.html" target="_blank">Tutorial: Configure Apache Web
Server on Amazon Linux to use SSL/TLS</a>.</p></div><ol class="procedure" type="1"><li class="step"><p>Enable the Extra Packages for Enterprise Linux (EPEL) repository from the Fedora
project on your
instance.</p><pre class="programlisting"><code class="nohighlight">[ec2-user ~]$ <strong class="userinput"><code>sudo yum-config-manager --enable <em class="replaceable"><code>epel</code></em></code></strong></code></pre></li><li class="step"><p>Install the <code class="literal">phpMyAdmin</code> package.</p><pre class="programlisting"><code class="nohighlight">[ec2-user ~]$ <strong class="userinput"><code>sudo yum install -y phpMyAdmin</code></strong></code></pre><div class="aws-note"><p class="aws-note">Note</p><p>Answer <code class="literal">y</code> to import the GPG key for the EPEL repository
when prompted.</p></div></li><li class="step"><p>Configure your <code class="literal">phpMyAdmin</code> installation to allow access from
your local machine. By default, <code class="literal">phpMyAdmin</code> only allows access
from the server that it is running on, which is not very useful because Amazon Linux does
not include a web browser.</p><ol type="a" class="substeps"><li class="step"><p>Find your local IP address by visiting a service such as <a class="ulink" href="https://www.whatismyip.com/" target="_blank">whatismyip.com</a>.</p></li><li class="step"><p><a name="step-phpMyAdmin.conf"></a>Edit the <code class="filename">/etc/httpd/conf.d/phpMyAdmin.conf</code> file and
replace the server IP address (127.0.0.1) with your local IP address with
the following command, replacing <em class="replaceable"><code>your_ip_address</code></em>
with the local IP address that you identified in the previous
step.</p><pre class="programlisting"><code class="nohighlight">[ec2-user ~]$ <strong class="userinput"><code>sudo sed -i -e 's/127.0.0.1/<em class="replaceable"><code>your_ip_address</code></em>/g' /etc/httpd/conf.d/phpMyAdmin.conf</code></strong></code></pre></li></ol></li><li class="step"><p><a name="step-phpMyAdmin-restart-httpd"></a>Restart the Apache web server to pick up the new
configuration.</p><pre class="programlisting"><code class="nohighlight">[ec2-user ~]$ <strong class="userinput"><code>sudo service httpd restart</code></strong>
Stopping httpd: [ OK ]
Starting httpd: [ OK ]</code></pre></li><li class="step"><p>Restart the MySQL server to pick up the new
configuration.</p><pre class="programlisting"><code class="nohighlight">[ec2-user ~]$ <strong class="userinput"><code>sudo service mysqld restart</code></strong>
Stopping mysqld: [ OK ]
Starting mysqld: [ OK ]</code></pre></li><li class="step"><p>In a web browser, enter the URL of your <code class="literal">phpMyAdmin</code>
installation. This URL is the public DNS address of your instance followed by a
forward slash and <code class="literal">phpmyadmin</code>. For
example:</p><pre class="programlisting"><code class="nohighlight">http://<em class="replaceable"><code>my.public.dns.amazonaws.com</code></em>/phpmyadmin</code></pre><p>You
should see the phpMyAdmin login page:</p><div class="mediaobject"><img src="images/phpmyadmin_login.png"></div><div class="aws-note"><p class="aws-note">Note</p><p>If you get a <code class="literal">403 Forbidden</code> error, verify that you have set
the correct IP address in the
<code class="filename">/etc/httpd/conf.d/phpMyAdmin.conf</code> file. You can see
what IP address the Apache server is actually getting your requests from by
viewing the Apache access log with the following
command:</p><pre class="programlisting"><code class="nohighlight">[ec2-user ~]$ <strong class="userinput"><code>sudo tail -n 1 /var/log/httpd/access_log | awk '{ print $1 }'</code></strong>
<em class="replaceable"><code>205.251.233.48</code></em></code></pre><p>Repeat
<a class="xref" href="install-LAMP.html#step-phpMyAdmin.conf" title="Step 3.b">Step 3.b</a>, replacing the incorrect address that
you previously entered with the address returned here; for example:
</p><pre class="programlisting"><code class="nohighlight">[ec2-user ~]$ <strong class="userinput"><code>sudo sed -i -e 's/<em class="replaceable"><code>previous_ip_address</code></em>/<em class="replaceable"><code>205.251.233.48</code></em>/g' /etc/httpd/conf.d/phpMyAdmin.conf</code></strong></code></pre><p>After you've replaced the IP address, restart the <code class="literal">httpd</code>
service with <a class="xref" href="install-LAMP.html#step-phpMyAdmin-restart-httpd" title="Step 4">Step 4</a>.</p></div></li><li class="step"><p>Log into your <code class="literal">phpMyAdmin</code> installation with the
<code class="literal">root</code> user name and the MySQL root password you created
earlier. For more information about using <code class="literal">phpMyAdmin</code>, see the
<a class="ulink" href="http://docs.phpmyadmin.net/en/latest/user.html" target="_blank"><code class="literal">phpMyAdmin</code> User Guide</a>.</p></li></ol></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both" id="lamp-more-info">Related Topics</h2></div></div></div><p>For more information on transferring files to your instance or installing a WordPress
blog on your web server, see the following topics: </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p><a class="xref" href="putty.html#Transfer_WinSCP" title="Transferring Files to Your Linux Instance Using WinSCP">Transferring Files to Your Linux Instance Using
WinSCP</a></p></li><li class="listitem"><p><a class="xref" href="AccessingInstancesLinux.html#AccessingInstancesLinuxSCP" title="Transferring Files to Linux Instances from Linux Using SCP">Transferring Files to Linux Instances from
Linux Using SCP</a></p></li><li class="listitem"><p><a class="xref" href="hosting-wordpress.html" title="Tutorial: Hosting a WordPress Blog with Amazon Linux">Tutorial: Hosting a WordPress Blog with Amazon Linux</a></p></li></ul></div><p>For more information about the commands and software used in this topic, see the
following web pages: </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Apache web server: <a class="ulink" href="http://httpd.apache.org/" target="_blank">http://httpd.apache.org/</a></p></li><li class="listitem"><p>MySQL database server: <a class="ulink" href="http://www.mysql.com/" target="_blank">http://www.mysql.com/</a></p></li><li class="listitem"><p>PHP programming language: <a class="ulink" href="http://php.net/" target="_blank">http://php.net/</a></p></li><li class="listitem"><p>The <code class="code">chmod</code> command: <a class="ulink" href="https://en.wikipedia.org/wiki/Chmod" target="_blank">https://en.wikipedia.org/wiki/Chmod</a></p></li><li class="listitem"><p>The <code class="code">chown</code> command: <a class="ulink" href="https://en.wikipedia.org/wiki/Chown" target="_blank">https://en.wikipedia.org/wiki/Chown</a></p></li></ul></div><p>If you are interested in registering a domain name for your web server, or
transferring an existing domain name to this host, see <a class="ulink" href="http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/creating-migrating.html" target="_blank">Creating and Migrating Domains and
Subdomains to Amazon Route 53</a> in the
<span class="emphasis"><em>Amazon Route&nbsp;53 Developer Guide</em></span>.</p></div></div></div><img src="images/expanderarrow.png" style="display:none;height:0;width:0"><div id="main-col-footer"><div id="doc-conventions"><a target="_top" href="/general/latest/gr/docconventions.html">Document Conventions</a></div><div id="next"><a class="awstoc" accesskey="p" href="ec2-tutorials.html">&laquo; Previous </a><a class="awstoc" accesskey="n" href="hosting-wordpress.html">Next &raquo;</a></div><div id="copyright-main-footer">&copy; 2016, Amazon Web Services, Inc. or its affiliates. All rights reserved.</div></div></div></div><div id="right-expanded"><div id="right-content-wrapper"><div id="right-col-header"><a id="pdf_link" href="ec2-ug.pdf"> PDF </a><text> | </text><a target="_blank" href="http://www.amazon.com/dp/B007Q4H9JI">Kindle </a></div></div></div></div></div><div id="footer"><div id="footer_short_fb" class="hide" title="Feedback"><a target="_blank" href="https://docs.aws.amazon.com/forms/aws-doc-feedback?hidden_service_name=EC2&amp;hidden_guide_name=User Guide for Linux Instances&amp;hidden_api_version=&amp;hidden_file_name=install-LAMP"><i class="fa fa-envelope-o"></i></a></div><div id="footer_toggle" class="mediaobject"><img id="footer_toggle_img" src="images/expanderarrow.png"><img id="footer_toggle_img_collapse" class="hide" src="images/expanderarrowright.png"></div><div id="footer-left"><a target="_top" href="http://aws.amazon.com/terms">Terms of Use</a> | &copy; 2016, Amazon Web Services, Inc. or its affiliates. All rights reserved.</div><div id="footer-right"><div id="feedback"><div id="forums"><a id="forum_link" target="_blank" href="http://forums.aws.amazon.com/forum.jspa?forumID=30">Have a question? Try the Forums.</a></div><div id="feedback-message">Did this page help you?</div><div id="feedback-yesno-buttons"><a class="awstoc btn btn-default" target="_blank" href="feedbackyes.html?topic_id=install-LAMP">Yes</a><a class="awstoc btn btn-default" target="_blank" href="feedbackno.html?topic_id=install-LAMP">No</a></div><div id="feedback-feedback-button"><a class="awstoc btn btn-default" target="_blank" href="https://docs.aws.amazon.com/forms/aws-doc-feedback?hidden_service_name=EC2&amp;hidden_guide_name=User Guide for Linux Instances&amp;hidden_api_version=&amp;hidden_file_name=install-LAMP">Feedback</a></div></div></div></div><noscript><div><div><div><div id="error_messages"><img src="https://d1ge0kk1l5kms0.cloudfront.net/images/G/01/webservices/console/warning.png" style="float: left;" alt="Warning"><div id="js_error_message"><strong>Javascript is disabled or is unavailable in your browser.</strong><br> To use the AWS Documentation, Javascript must be enabled. Please refer to your browser's Help pages for instructions. </div></div></div></div></div></noscript><!-- SiteCatalyst code version: H.25.2.
Copyright 1996-2012 Adobe, Inc. All Rights Reserved
More info available at http://www.omniture.com --><script language="JavaScript" type="text/javascript" src="https://a0.awsstatic.com/s_code/js/1.0/awshome_s_code.js"></script><script language="JavaScript" type="text/javascript"><!--
// Documentation Service Name
s.prop66='Amazon Elastic Compute Cloud';
s.eVar66='D=c66';
// Documentation Guide Name
s.prop65='User Guide for Linux Instances';
s.eVar65='D=c65';
var s_code=s.t();if(s_code)document.write(s_code)//--></script><script language="JavaScript" type="text/javascript"><!--
if(navigator.appVersion.indexOf('MSIE')>=0)document.write(unescape('%3C')+'\!-'+'-')
//--></script><noscript><img src="http://amazonwebservices.d2.sc.omtrdc.net/b/ss/awsamazondev/1/H.25.2--NS/0" height="1" width="1" border="0" alt=""></noscript><!--/DO NOT REMOVE/--><!-- End SiteCatalyst code version: H.25.2. --></body></html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta name="viewport" content="width=device-width, initial-scale=1"><meta name="description" content="Tutorial - install, configure, and secure a WordPress blog on your Amazon Linux instance."><title>Tutorial: Hosting a WordPress Blog with Amazon Linux - Amazon Elastic Compute Cloud</title><link rel="home" href="#top" title="Amazon Elastic Compute Cloud"><link rel="up" href="ec2-tutorials.html" title="Tutorials for Amazon EC2 Instances Running Linux"><link rel="prev" href="install-LAMP.html" title="Tutorial: Installing a LAMP Web Server on Amazon Linux"><link rel="next" href="SSL-on-an-instance.html" title="Tutorial: Configure Apache Web Server on Amazon Linux to use SSL/TLS"><meta name="keywords" content=""><meta name="deployment_region" content="IAD"><meta name="product" content="Amazon Elastic Compute Cloud"><meta name="guide" content="User Guide for Linux Instances"><meta name="guide-locale" content="en_us"><link rel="icon" type="image/ico" href="//media.amazonwebservices.com/favicon.ico"><link rel="shortcut icon" type="image/ico" href="//media.amazonwebservices.com/favicon.ico"><link rel="canonical" href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/hosting-wordpress.html"><link rel="stylesheet" type="text/css" href="/css/jquery-ui.min.css"><link rel="stylesheet" type="text/css" href="/font/css/font-awesome.min.css"><link rel="stylesheet" type="text/css" href="/css/google-font.css"><link rel="stylesheet" type="text/css" href="/css/highlight-default.css"><link rel="stylesheet" type="text/css" href="/css/jquery-ui.theme.css"><link rel="stylesheet" type="text/css" href="/css/colorbox.css"><link rel="stylesheet" type="text/css" href="/css/awsdocs.css"><script type="text/javascript" src="/js/highlight.pack.js"></script><script type="text/javascript" src="/js/jquery.min.js"></script><script type="text/javascript" src="/js/jquery-ui.min.js"></script><script type="text/javascript" src="/js/handlebars.js"></script><script type="text/javascript" src="/js/jquery.colorbox.js"></script><script type="text/javascript" src="/js/awsdocs.min.js"></script></head><body id="top"><div id="aws-nav" class="aws-nav-header"><div class="aws-nav-header-left"><div id="aws-nav-flyout-trigger" class="aws-nav-flyout-trigger"><i class="fa fa-bars fa-2x"></i>Menu</div><div class="aws-nav-logo"><a href="https://aws.amazon.com"><span>Amazon Web Services</span></a></div></div><div id="aws-nav-header-right" class="aws-nav-header-right"><div class="aws-nav-cta-button-outer"><span class="aws-nav-cta-default" id="span-conosole-signin"><a id="aws-nav-cta-button" class="aws-nav-button" href="https://console.aws.amazon.com/console/home">Sign In to the Console</a></span><span class="aws-nav-cta-default" id="span-conosole-signup" style="display:none"><a id="aws-nav-cta-button" class="aws-nav-button" href="https://portal.aws.amazon.com/gp/aws/developer/registration/index.html">Try AWS for Free</a></span></div><div class="aws-nav-popover-trigger" data-dropdown="aws-nav-dropdown-lang"><select id="languageSelection" onchange="SelectLanguage()"><option value="/de_de/AWSEC2/latest/UserGuide/hosting-wordpress.html">Deutsch</option><option value="/en_us/AWSEC2/latest/UserGuide/hosting-wordpress.html" selected>English</option><option value="/es_es/AWSEC2/latest/UserGuide/hosting-wordpress.html">Espa&ntilde;ol</option><option value="/fr_fr/AWSEC2/latest/UserGuide/hosting-wordpress.html">Fran&ccedil;ais</option><option value="/ja_jp/AWSEC2/latest/UserGuide/hosting-wordpress.html">&#26085;&#26412;&#35486;</option><option value="/pt_br/AWSEC2/latest/UserGuide/hosting-wordpress.html">Portugu&ecirc;s</option><option value="/ko_kr/AWSEC2/latest/UserGuide/hosting-wordpress.html">&#54620;&#44397;&#50612;</option><option value="/zh_cn/AWSEC2/latest/UserGuide/hosting-wordpress.html">&#20013;&#25991; (&#31616;&#20307;)</option></select></div><div id="aws-nav-quicklinks-separator" class="aws-nav-quicklinks-separator"><div class="aws-nav-left"></div><div class="aws-nav-right"></div></div></div><div id="topnav-flyout-menu-container"><ul id="topnav-flyout-menu"><script id="flyout-item-template" type="text/x-handlebars-template">
{{#flyoutList}}
<li>{{listItem}}
{{#if subList}}
<ul>
{{#subList}}
<li class="awsdocs-flyout-link-wrapper"><a href="{{target}}">{{text}}</a></li>
{{/subList}}
</ul>
{{/if}}
</li>
{{/flyoutList}}
</script></ul><div id="topnav-flyout-menu-spacer"></div></div></div><script type="text/javascript"><!--
var thispage = "hosting-wordpress.html";
var tocroot = location.protocol + '//' + location.hostname + location.pathname;
--></script><div id="content-container"><div id="left-column" class="ui-resizable"><div id="left-col-header"><div id="left-col-top-content"><div id="service-name">Amazon Elastic Compute Cloud </div><div id="search"><i id="search-icon" class="fa fa-search fa-2x"></i></div><div id="guide-info">User Guide for Linux Instances<div id="content-button"><i id="toggle-contents" class="fa fa-bars"></i></div></div></div><form id="finegrainedSearch" method="get" onsubmit="return searchFormSubmit(this);" action="/search/doc-search.html"><div id="search-form"><select id="search-select" name="searchPath"><option value="all">Entire Site</option><option value="AWSMarketplace">AMIs from AWS Marketplace</option><option value="amis">AMIs from All Sources</option><option value="articles">Articles &amp; Tutorials</option><option value="products_and_info">AWS Product Information</option><option value="case_studies">Case Studies</option><option value="customerapps">Customer Apps</option><option value="documentation">Documentation</option><option value="documentation-product">Documentation - This Product</option><option value="documentation-guide" selected>Documentation - This Guide</option><option value="datasets">Public Data Sets</option><option value="releasenotes">Release Notes</option><option value="solution_providers">Partners</option><option value="code">Sample Code &amp; Libraries</option></select><br><input id="search-query" name="searchQuery" type="text" placholder="$loc-search-search"><input id="search-button" src="images/search-button.png" alt="Go" type="image"></div><input type="hidden" name="this_doc_product" id="this_doc_product" value="Amazon Elastic Compute Cloud"><input type="hidden" name="this_doc_guide" id="this_doc_guide" value="User Guide for Linux Instances"><input type="hidden" name="doc_locale" value="en_us"></form></div><div id="toc"><ul class="awstoc"><li class="awstoc closed"><a class="awstoc" href="concepts.html">What Is Amazon EC2?</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="ec2-instances-and-amis.html">Instances and AMIs</a></li><li class="awstoc leaf"><a class="awstoc" href="using-regions-availability-zones.html">Regions and Availability Zones</a></li><li class="awstoc leaf"><a class="awstoc" href="RootDeviceStorage.html">Root Device Volume</a></li></ul></li><li class="awstoc leaf"><a class="awstoc" href="get-set-up-for-amazon-ec2.html">Setting Up</a></li><li class="awstoc leaf"><a class="awstoc" href="EC2_GetStarted.html">Getting Started</a></li><li class="awstoc leaf"><a class="awstoc" href="ec2-best-practices.html">Best Practices</a></li><li class="awstoc opened"><a class="awstoc" href="ec2-tutorials.html">Tutorials</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="install-LAMP.html">Tutorial: Installing a LAMP Web Server on Amazon Linux</a></li><li class="awstoc leaf"><a class="awstoc selected" href="hosting-wordpress.html">Tutorial: Hosting a WordPress Blog</a></li><li class="awstoc leaf"><a class="awstoc" href="SSL-on-an-instance.html">Tutorial: Configure Apache Web Server on Amazon Linux to use
SSL/TLS</a></li><li class="awstoc leaf"><a class="awstoc" href="ec2-increase-availability.html">Tutorial: Increase the Availability of Your Application</a></li><li class="awstoc leaf"><a class="awstoc" href="tutorial_run_command.html">Tutorial: Remotely Manage Your Instances</a></li></ul></li><li class="awstoc closed"><a class="awstoc" href="AMIs.html">Amazon Machine Images</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="ComponentsAMIs.html">AMI Types</a></li><li class="awstoc leaf"><a class="awstoc" href="virtualization_types.html">Virtualization Types</a></li><li class="awstoc leaf"><a class="awstoc" href="finding-an-ami.html">Finding a Linux AMI</a></li><li class="awstoc closed"><a class="awstoc" href="sharing-amis.html">Shared AMIs</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="usingsharedamis-finding.html">Finding Shared AMIs</a></li><li class="awstoc leaf"><a class="awstoc" href="sharingamis-intro.html">Making an AMI Public</a></li><li class="awstoc leaf"><a class="awstoc" href="sharingamis-explicit.html">Sharing an AMI with Specific AWS Accounts</a></li><li class="awstoc leaf"><a class="awstoc" href="using-bookmarks.html">Using Bookmarks</a></li><li class="awstoc leaf"><a class="awstoc" href="building-shared-amis.html">Guidelines for Shared Linux AMIs</a></li></ul></li><li class="awstoc leaf"><a class="awstoc" href="paid-amis.html">Paid AMIs</a></li><li class="awstoc leaf"><a class="awstoc" href="creating-an-ami-ebs.html">Creating an Amazon EBS-Backed Linux AMI</a></li><li class="awstoc closed"><a class="awstoc" href="creating-an-ami-instance-store.html">Creating an Instance Store-Backed Linux
AMI</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="set-up-ami-tools.html">Setting Up the AMI Tools</a></li><li class="awstoc leaf"><a class="awstoc" href="create-instance-store-ami.html">Creating an AMI from an Instance Store-Backed Instance</a></li><li class="awstoc leaf"><a class="awstoc" href="Using_ConvertingS3toEBS.html">Converting to an Amazon EBS-Backed AMI</a></li></ul></li><li class="awstoc leaf"><a class="awstoc" href="AMIEncryption.html">AMIs with Encrypted Snapshots</a></li><li class="awstoc leaf"><a class="awstoc" href="CopyingAMIs.html">Copying an AMI</a></li><li class="awstoc leaf"><a class="awstoc" href="deregister-ami.html">Deregistering Your AMI</a></li><li class="awstoc leaf"><a class="awstoc" href="AmazonLinuxAMIBasics.html">Amazon Linux</a></li><li class="awstoc leaf"><a class="awstoc" href="UserProvidedKernels.html">PV-GRUB</a></li></ul></li><li class="awstoc closed"><a class="awstoc" href="Instances.html">Instances</a><ul class="awstoc"><li class="awstoc closed"><a class="awstoc" href="instance-types.html">Instance Types</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="t2-instances.html">T2 Instances</a></li><li class="awstoc leaf"><a class="awstoc" href="c4-instances.html">C4 Instances</a></li><li class="awstoc leaf"><a class="awstoc" href="using_cluster_computing.html">GPU Instances</a></li><li class="awstoc leaf"><a class="awstoc" href="i2-instances.html">I2 Instances</a></li><li class="awstoc leaf"><a class="awstoc" href="d2-instances.html">D2 Instances</a></li><li class="awstoc leaf"><a class="awstoc" href="storage_instances.html">HI1 Instances</a></li><li class="awstoc leaf"><a class="awstoc" href="high_storage_instances.html">HS1 Instances</a></li><li class="awstoc leaf"><a class="awstoc" href="concepts_micro_instances.html">T1 Micro Instances</a></li><li class="awstoc leaf"><a class="awstoc" href="x1-instances.html">X1 Instances</a></li><li class="awstoc leaf"><a class="awstoc" href="ec2-instance-resize.html">Resizing Instances</a></li></ul></li><li class="awstoc closed"><a class="awstoc" href="instance-purchasing-options.html">Instance Purchasing Options</a><ul class="awstoc"><li class="awstoc closed"><a class="awstoc" href="concepts-on-demand-reserved-instances.html">Reserved Instances</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="reserved-instances-fundamentals.html">How Reserved Instances Work</a></li><li class="awstoc leaf"><a class="awstoc" href="concepts-reserved-instances-application.html">Billing Benefits and Payment
Options</a></li><li class="awstoc closed"><a class="awstoc" href="ri-market-concepts-buying.html">Buying Reserved Instances</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="ri-market-buying-guide.html">Buying in the Reserved Instance
Marketplace</a></li></ul></li><li class="awstoc closed"><a class="awstoc" href="ri-market-selling-guide.html">Selling in the Reserved Instance Marketplace</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="ri-market-seller-profile.html">Registering as a Seller</a></li></ul></li><li class="awstoc closed"><a class="awstoc" href="ri-modifying.html">Modifying Your Reserved Instances</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="ri-modification-limits.html">Requirements for Modification</a></li><li class="awstoc leaf"><a class="awstoc" href="ri-modification-instancemove.html">Modifying the Instance Size of Your
Reservations</a></li><li class="awstoc leaf"><a class="awstoc" href="ri-modification-process.html">Submitting Modification Requests</a></li></ul></li><li class="awstoc leaf"><a class="awstoc" href="ri-modification-process-messages.html">Troubleshooting Modification
Requests</a></li></ul></li><li class="awstoc leaf"><a class="awstoc" href="ec2-scheduled-instances.html">Scheduled Instances</a></li><li class="awstoc closed"><a class="awstoc" href="using-spot-instances.html">Spot Instances</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="how-spot-instances-work.html">How Spot Instances Work</a></li><li class="awstoc leaf"><a class="awstoc" href="spot-fleet.html">How Spot Fleet Works</a></li><li class="awstoc leaf"><a class="awstoc" href="using-spot-instances-history.html">Spot Instance Pricing History</a></li><li class="awstoc closed"><a class="awstoc" href="spot-requests.html">Spot Instance Requests</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="spot-request-examples.html">Example Launch Specifications</a></li></ul></li><li class="awstoc closed"><a class="awstoc" href="spot-fleet-requests.html">Spot Fleet Requests</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="spot-fleet-examples.html">Example Configurations</a></li></ul></li><li class="awstoc leaf"><a class="awstoc" href="spot-fleet-cloudwatch-metrics.html">CloudWatch Metrics for Spot Fleet</a></li><li class="awstoc leaf"><a class="awstoc" href="spot-fleet-automatic-scaling.html">Automatic Scaling for Spot Fleet</a></li><li class="awstoc leaf"><a class="awstoc" href="spot-bid-status.html">Spot Bid Status</a></li><li class="awstoc leaf"><a class="awstoc" href="spot-interruptions.html">Spot Instance Interruptions</a></li><li class="awstoc leaf"><a class="awstoc" href="spot-data-feeds.html">Spot Instance Data Feed</a></li><li class="awstoc leaf"><a class="awstoc" href="using-spot-limits.html">Spot Instance Limits</a></li></ul></li><li class="awstoc closed"><a class="awstoc" href="dedicated-hosts-overview.html">Dedicated Hosts</a><ul class="awstoc"><li class="awstoc closed"><a class="awstoc" href="how-dedicated-hosts-work.html">Using Dedicated Hosts</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="dedicated-hosts-instance-placement.html">Understanding Instance
Placement and Host Affinity</a></li></ul></li><li class="awstoc leaf"><a class="awstoc" href="dedicated-hosts-monitoring.html">Monitoring Dedicated Hosts</a></li></ul></li></ul></li><li class="awstoc closed"><a class="awstoc" href="ec2-instance-lifecycle.html">Instance Lifecycle</a><ul class="awstoc"><li class="awstoc closed"><a class="awstoc" href="LaunchingAndUsingInstances.html">Launch</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="launching-instance.html">Launching an Instance</a></li><li class="awstoc leaf"><a class="awstoc" href="launch-more-like-this.html">Launching an Instance From an Existing Instance</a></li><li class="awstoc leaf"><a class="awstoc" href="instance-launch-snapshot.html">Launching a Linux Instance from a Backup</a></li><li class="awstoc leaf"><a class="awstoc" href="launch-marketplace-console.html">Launching an AWS Marketplace Instance</a></li></ul></li><li class="awstoc closed"><a class="awstoc" href="AccessingInstances.html">Connect</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="AccessingInstancesLinux.html">Connect Using SSH</a></li><li class="awstoc leaf"><a class="awstoc" href="putty.html">Connect Using PuTTY</a></li><li class="awstoc leaf"><a class="awstoc" href="mindterm.html">Connect Using MindTerm</a></li></ul></li><li class="awstoc leaf"><a class="awstoc" href="Stop_Start.html">Stop and Start</a></li><li class="awstoc leaf"><a class="awstoc" href="ec2-instance-reboot.html">Reboot</a></li><li class="awstoc leaf"><a class="awstoc" href="instance-retirement.html">Retire</a></li><li class="awstoc leaf"><a class="awstoc" href="terminating-instances.html">Terminate</a></li><li class="awstoc leaf"><a class="awstoc" href="ec2-instance-recover.html">Recover</a></li></ul></li><li class="awstoc closed"><a class="awstoc" href="Configure_Instance.html">Configure Instances</a><ul class="awstoc"><li class="awstoc closed"><a class="awstoc" href="managing-software.html">Managing Software</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="install-updates.html">Updating Instance Software</a></li><li class="awstoc leaf"><a class="awstoc" href="add-repositories.html">Adding Repositories</a></li><li class="awstoc leaf"><a class="awstoc" href="find-software.html">Finding Software Packages</a></li><li class="awstoc leaf"><a class="awstoc" href="install-software.html">Installing Software Packages</a></li><li class="awstoc leaf"><a class="awstoc" href="compile-software.html">Preparing to Compile Software</a></li></ul></li><li class="awstoc leaf"><a class="awstoc" href="managing-users.html">Managing Users</a></li><li class="awstoc leaf"><a class="awstoc" href="processor_state_control.html">Processor State Control</a></li><li class="awstoc leaf"><a class="awstoc" href="set-time.html">Setting the Time</a></li><li class="awstoc leaf"><a class="awstoc" href="set-hostname.html">Changing the Hostname</a></li><li class="awstoc leaf"><a class="awstoc" href="dynamic-dns.html">Setting Up Dynamic DNS</a></li><li class="awstoc leaf"><a class="awstoc" href="user-data.html">Running Commands at Launch</a></li><li class="awstoc closed"><a class="awstoc" href="ec2-instance-metadata.html">Instance Metadata and User Data</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="instance-identity-documents.html">Instance Identity Documents</a></li></ul></li></ul></li><li class="awstoc closed"><a class="awstoc" href="execute-remote-commands.html">Remotely Manage Your Instances</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="run-command-concepts.html">Components and Concepts</a></li><li class="awstoc leaf"><a class="awstoc" href="remote-commands-prereq.html">Prerequisites</a></li><li class="awstoc leaf"><a class="awstoc" href="install-ssm-agent.html">Installing the SSM Agent</a></li><li class="awstoc leaf"><a class="awstoc" href="delegate-commands.html">Delegating Access</a></li><li class="awstoc leaf"><a class="awstoc" href="managed-instances.html">Setting Up Run Command On Managed Instances</a></li><li class="awstoc closed"><a class="awstoc" href="run-command.html">Executing Commands</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="remote-commands-shellcript.html">Running Shell Scripts</a></li><li class="awstoc leaf"><a class="awstoc" href="remote-commands-updatessmagent.html">Updating the AWS SSM Agent</a></li></ul></li><li class="awstoc leaf"><a class="awstoc" href="output-commands.html">Viewing Command Output</a></li><li class="awstoc leaf"><a class="awstoc" href="create-ssm-doc.html">Creating SSM Documents</a></li><li class="awstoc closed"><a class="awstoc" href="ssm-sharing.html">Sharing SSM Documents</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="ssm-before-you-share.html">Guidelines for Sharing and Using Shared SSM
Documents</a></li><li class="awstoc leaf"><a class="awstoc" href="ssm-how-to-share.html">How to Share an SSM Document</a></li><li class="awstoc leaf"><a class="awstoc" href="ssm-share-modify.html">How to Modify Permissions for a Shared
Document</a></li><li class="awstoc leaf"><a class="awstoc" href="ssm-using-shared.html">How to Use a Shared SSM Document</a></li></ul></li><li class="awstoc closed"><a class="awstoc" href="walkthrough-commands.html">Walkthroughs</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="walkthrough-linux-ui.html">Using the Console</a></li><li class="awstoc leaf"><a class="awstoc" href="walkthrough-cli.html">Using the AWS CLI</a></li></ul></li><li class="awstoc leaf"><a class="awstoc" href="cancel-commands.html">Cancelling a Command</a></li><li class="awstoc closed"><a class="awstoc" href="monitor-commands.html">Monitoring Commands</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="rc-sns-notifications.html">Amazon SNS Notifications</a></li><li class="awstoc leaf"><a class="awstoc" href="rc-cwe.html">Log Command Execution Status Changes for Run Command</a></li></ul></li><li class="awstoc leaf"><a class="awstoc" href="troubleshooting-remote-commands.html">Troubleshooting Run Command</a></li></ul></li><li class="awstoc leaf"><a class="awstoc" href="instances_of_your_vm.html">Importing and Exporting Virtual Machines</a></li></ul></li><li class="awstoc closed"><a class="awstoc" href="monitoring_ec2.html">Monitoring</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="monitoring_automated_manual.html">Automated and Manual Monitoring</a></li><li class="awstoc leaf"><a class="awstoc" href="monitoring_best_practices.html">Best Practices for Monitoring</a></li><li class="awstoc closed"><a class="awstoc" href="monitoring-instances-status-check.html">Monitoring the Status of Your Instances</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="monitoring-system-instance-status-check.html">Instance Status Checks</a></li><li class="awstoc leaf"><a class="awstoc" href="monitoring-instances-status-check_sched.html">Scheduled Events</a></li></ul></li><li class="awstoc closed"><a class="awstoc" href="using-cloudwatch.html">Monitoring Your Instances Using CloudWatch</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="using-cloudwatch-new.html">Enable Detailed Monitoring</a></li><li class="awstoc leaf"><a class="awstoc" href="viewing_metrics_with_cloudwatch.html">List Available Metrics</a></li><li class="awstoc closed"><a class="awstoc" href="monitoring_get_statistics.html">Get Statistics for Metrics</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="US_SingleMetricPerInstance.html">Get Statistics for a Specific Instance</a></li><li class="awstoc leaf"><a class="awstoc" href="GetSingleMetricAllDimensions.html">Aggregate Statistics Across Instances</a></li><li class="awstoc leaf"><a class="awstoc" href="GetMetricAutoScalingGroup.html">Aggregate Statistics by Auto Scaling Group</a></li><li class="awstoc leaf"><a class="awstoc" href="US_SingleMetricPerAMI.html">Aggregate Statistics by Image (AMI) ID</a></li></ul></li><li class="awstoc closed"><a class="awstoc" href="graphs-in-the-aws-management-console.html">Graph Metrics</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="graph_a_metric.html">Graph a Metric</a></li><li class="awstoc leaf"><a class="awstoc" href="graph_a_metric_all_resources.html">Graph a Metric Across Resources</a></li></ul></li><li class="awstoc closed"><a class="awstoc" href="using-cloudwatch-createalarm.html">Create a CloudWatch Alarm</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="US_AlarmAtThresholdEC2.html">Send Email Based on CPU Usage Alarm</a></li><li class="awstoc leaf"><a class="awstoc" href="US_AlarmAtThresholdELB.html">Send Email Based on Load Balancer Alarm</a></li><li class="awstoc leaf"><a class="awstoc" href="US_AlarmAtThresholdEBS.html">Send Email Based on Storage Throughput Alarm</a></li></ul></li><li class="awstoc leaf"><a class="awstoc" href="UsingAlarmActions.html">Create Alarms That Stop, Terminate, Reboot, or Recover an Instance</a></li></ul></li><li class="awstoc leaf"><a class="awstoc" href="mon-scripts.html">Monitoring Memory and Disk Metrics</a></li></ul></li><li class="awstoc closed"><a class="awstoc" href="EC2_Network_and_Security.html">Network and Security</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="ec2-key-pairs.html">Key Pairs</a></li><li class="awstoc leaf"><a class="awstoc" href="using-network-security.html">Security Groups</a></li><li class="awstoc closed"><a class="awstoc" href="UsingIAM.html">Controlling Access</a><ul class="awstoc"><li class="awstoc closed"><a class="awstoc" href="iam-policies-for-amazon-ec2.html">IAM Policies</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="iam-policy-structure.html">Policy Structure</a></li><li class="awstoc leaf"><a class="awstoc" href="ec2-supported-iam-actions-resources.html">Supported Resource-Level Permissions</a></li><li class="awstoc leaf"><a class="awstoc" href="ExamplePolicies_EC2.html">Example Policies for CLI or SDK</a></li><li class="awstoc leaf"><a class="awstoc" href="iam-policies-ec2-console.html">Example Policies for the Console</a></li></ul></li><li class="awstoc leaf"><a class="awstoc" href="iam-roles-for-amazon-ec2.html">IAM Roles</a></li><li class="awstoc leaf"><a class="awstoc" href="authorizing-access-to-an-instance.html">Network Access</a></li></ul></li><li class="awstoc closed"><a class="awstoc" href="using-vpc.html">Amazon VPC</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="ec2-supported-platforms.html">Supported Platforms</a></li><li class="awstoc leaf"><a class="awstoc" href="vpc-classiclink.html">ClassicLink</a></li><li class="awstoc leaf"><a class="awstoc" href="vpc-migrate.html">Migrating from EC2-Classic to a VPC</a></li></ul></li><li class="awstoc closed"><a class="awstoc" href="using-instance-addressing.html">Instance IP Addressing</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="MultipleIP.html">Multiple Private IP Addresses</a></li></ul></li><li class="awstoc leaf"><a class="awstoc" href="elastic-ip-addresses-eip.html">Elastic IP Addresses</a></li><li class="awstoc leaf"><a class="awstoc" href="using-eni.html">Elastic Network Interfaces</a></li><li class="awstoc leaf"><a class="awstoc" href="placement-groups.html">Placement Groups</a></li><li class="awstoc leaf"><a class="awstoc" href="network_mtu.html">Network MTU</a></li><li class="awstoc closed"><a class="awstoc" href="enhanced-networking.html">Enhanced Networking</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="sriov-networking.html">Enabling Enhanced Networking: Intel 82599 VF</a></li><li class="awstoc leaf"><a class="awstoc" href="enhanced-networking-ena.html">Enabling Enhanced Networking: ENA</a></li><li class="awstoc leaf"><a class="awstoc" href="troubleshooting-ena.html">Troubleshoooting ENA</a></li></ul></li></ul></li><li class="awstoc closed"><a class="awstoc" href="Storage.html">Storage</a><ul class="awstoc"><li class="awstoc closed"><a class="awstoc" href="AmazonEBS.html">Amazon EBS</a><ul class="awstoc"><li class="awstoc closed"><a class="awstoc" href="EBSVolumes.html">EBS Volumes</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="EBSVolumeTypes.html">EBS Volume Types</a></li><li class="awstoc leaf"><a class="awstoc" href="ebs-creating-volume.html">Creating a Volume</a></li><li class="awstoc leaf"><a class="awstoc" href="ebs-restoring-volume.html">Restoring from a Snapshot</a></li><li class="awstoc leaf"><a class="awstoc" href="ebs-attaching-volume.html">Attaching a Volume to an Instance</a></li><li class="awstoc leaf"><a class="awstoc" href="ebs-using-volumes.html">Making a Volume Available for Use</a></li><li class="awstoc leaf"><a class="awstoc" href="ebs-describing-volumes.html">Volume Information</a></li><li class="awstoc leaf"><a class="awstoc" href="monitoring-volume-status.html">Monitoring the Status of Your Volumes</a></li><li class="awstoc leaf"><a class="awstoc" href="ebs-detaching-volume.html">Detaching a Volume from an Instance</a></li><li class="awstoc leaf"><a class="awstoc" href="ebs-deleting-volume.html">Deleting a Volume</a></li><li class="awstoc leaf"><a class="awstoc" href="ebs-expand-volume.html">Expanding a Volume</a></li><li class="awstoc leaf"><a class="awstoc" href="storage_expand_partition.html">Expanding a Linux Partition</a></li></ul></li><li class="awstoc closed"><a class="awstoc" href="EBSSnapshots.html">EBS Snapshots</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="ebs-creating-snapshot.html">Creating a Snapshot</a></li><li class="awstoc leaf"><a class="awstoc" href="ebs-deleting-snapshot.html">Deleting a Snapshot</a></li><li class="awstoc leaf"><a class="awstoc" href="ebs-copy-snapshot.html">Copying a Snapshot</a></li><li class="awstoc leaf"><a class="awstoc" href="ebs-describing-snapshots.html">Viewing Snapshot Information</a></li><li class="awstoc leaf"><a class="awstoc" href="ebs-modifying-snapshot-permissions.html">Sharing a Snapshot</a></li></ul></li><li class="awstoc leaf"><a class="awstoc" href="EBSOptimized.html">EBS Optimization</a></li><li class="awstoc leaf"><a class="awstoc" href="EBSEncryption.html">EBS Encryption</a></li><li class="awstoc closed"><a class="awstoc" href="EBSPerformance.html">EBS Performance</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="ebs-ec2-config.html">EC2 Configuration</a></li><li class="awstoc leaf"><a class="awstoc" href="ebs-io-characteristics.html">I/O Characteristics</a></li><li class="awstoc leaf"><a class="awstoc" href="ebs-initialize.html">Initialize Volumes</a></li><li class="awstoc leaf"><a class="awstoc" href="raid-config.html">RAID Configuration on Linux</a></li><li class="awstoc leaf"><a class="awstoc" href="benchmark_procedures.html">Benchmark EBS Volumes</a></li></ul></li></ul></li><li class="awstoc closed"><a class="awstoc" href="InstanceStorage.html">Instance Store</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="add-instance-store-volumes.html">Add Instance Store Volumes</a></li><li class="awstoc leaf"><a class="awstoc" href="ssd-instance-store.html">SSD Instance Store Volumes</a></li><li class="awstoc leaf"><a class="awstoc" href="instance-store-swap-volumes.html">Instance Store Swap Volumes</a></li><li class="awstoc leaf"><a class="awstoc" href="disk-performance.html">Optimizing Disk Performance</a></li></ul></li><li class="awstoc leaf"><a class="awstoc" href="AmazonS3.html">Amazon S3</a></li><li class="awstoc leaf"><a class="awstoc" href="volume_limits.html">Instance Volume Limits</a></li><li class="awstoc leaf"><a class="awstoc" href="device_naming.html">Device Naming</a></li><li class="awstoc leaf"><a class="awstoc" href="block-device-mapping-concepts.html">Block Device Mapping</a></li><li class="awstoc leaf"><a class="awstoc" href="using-public-data-sets.html">Using Public Data Sets</a></li></ul></li><li class="awstoc closed"><a class="awstoc" href="EC2_Resources.html">Resources and Tags</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="resources.html">Resource Locations</a></li><li class="awstoc leaf"><a class="awstoc" href="resource-ids.html">Resource IDs</a></li><li class="awstoc leaf"><a class="awstoc" href="Using_Filtering.html">Listing and Filtering Your Resources</a></li><li class="awstoc leaf"><a class="awstoc" href="Using_Tags.html">Tagging Your Resources</a></li><li class="awstoc leaf"><a class="awstoc" href="ec2-resource-limits.html">Service Limits</a></li><li class="awstoc closed"><a class="awstoc" href="usage-reports.html">Usage Reports</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="usage-reports-instance.html">Instance Usage</a></li><li class="awstoc leaf"><a class="awstoc" href="usage-reports-ri.html">Reserved Instance Utilization</a></li></ul></li></ul></li><li class="awstoc closed"><a class="awstoc" href="ec2-instance-troubleshoot.html">Troubleshooting</a><ul class="awstoc"><li class="awstoc leaf"><a class="awstoc" href="Using_InstanceStraightToTerminated.html">Launching Your Instance</a></li><li class="awstoc leaf"><a class="awstoc" href="TroubleshootingInstancesConnecting.html">Connecting to Your Instance</a></li><li class="awstoc leaf"><a class="awstoc" href="TroubleshootingInstancesStopping.html">Stopping Your Instance</a></li><li class="awstoc leaf"><a class="awstoc" href="TroubleshootingInstancesShuttingDown.html">Terminating Your Instance</a></li><li class="awstoc leaf"><a class="awstoc" href="TroubleshootingInstanceRecovery.html">Instance Recovery Failures</a></li><li class="awstoc leaf"><a class="awstoc" href="TroubleshootingInstances.html">Failed Status Checks</a></li><li class="awstoc leaf"><a class="awstoc" href="instance-capacity.html">Instance Capacity</a></li><li class="awstoc leaf"><a class="awstoc" href="instance-console.html">Getting Console Output and Rebooting Instances</a></li><li class="awstoc leaf"><a class="awstoc" href="instance-booting-from-wrong-volume.html">My Instance is Booting from the Wrong
Volume</a></li></ul></li><li class="awstoc leaf"><a class="awstoc" href="available-apis.html">Making API Requests</a></li><li class="awstoc leaf"><a class="awstoc" href="DocumentHistory.html">Document History</a></li><li class="awstoc leaf"><a class="awstoc" href="glossary.html">AWS Glossary</a></li></ul></div></div><div id="main-column"><div id="main"><div id="main-content"><div id="breadcrumbs"><table summary="Breadcrumbs"><tr><td><div class="navheader"><div class="breadcrumb"><a href="http://aws.amazon.com/documentation/">AWS Documentation</a> &raquo; <a href="http://aws.amazon.com/documentation/ec2/">Amazon EC2</a> &raquo; <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/">User Guide for Linux Instances</a> &raquo; <a href="ec2-tutorials.html">Tutorials for Amazon EC2 Instances Running Linux</a> &raquo; <span class="breadcrumb">Tutorial: Hosting a WordPress Blog with Amazon Linux</span></div></div></td></tr></table></div><div id="main-col-body"><div></div><div class="section"><div class="titlepage"><div><div><h1 class="topictitle">Tutorial: Hosting a WordPress Blog with Amazon Linux</h1></div></div></div><p>The following procedures will help you install, configure, and secure a WordPress blog on
your Amazon Linux instance.</p><div class="aws-note"><p class="aws-note">Important</p><p>These procedures are intended for use with Amazon Linux. For more information about other
distributions, see their specific documentation. Many steps in this tutorial do not work
on Ubuntu instances. For help installing WordPress on an Ubuntu instance, see <a class="ulink" href="https://help.ubuntu.com/community/WordPress" target="_blank">WordPress</a> in the Ubuntu
documentation.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both" id="hosting-wordpress-prereqs">Prerequisites</h2></div></div></div><p>This tutorial assumes that you have launched an Amazon Linux instance with a functional
web server with PHP and MySQL support by following all of the steps in <a class="xref" href="install-LAMP.html" title="Tutorial: Installing a LAMP Web Server on Amazon Linux">Tutorial: Installing a LAMP Web Server on Amazon Linux</a>. This tutorial also has
steps for configuring a security group to allow <code class="literal">HTTP</code> and
<code class="literal">HTTPS</code> traffic, as well as several steps to ensure that file
permissions are set properly for your web server. If you have not already done so,
see <a class="xref" href="install-LAMP.html" title="Tutorial: Installing a LAMP Web Server on Amazon Linux">Tutorial: Installing a LAMP Web Server on Amazon Linux</a> to meet these
prerequisites and then return to this tutorial to install WordPress. For information
about adding rules to your security group, see <a class="xref" href="using-network-security.html#adding-security-group-rule" title="Adding Rules to a Security Group">Adding Rules to a Security Group</a>.</p><p>We strongly recommend that you associate an Elastic IP address (EIP) to the
instance you are using to host a WordPress blog. This prevents the public DNS
address for your instance from changing and breaking your installation. If you own a
domain name and you want to use it for your blog, you can update the DNS record for
the domain name to point to your EIP address (for help with this, contact your
domain name registrar). You can have one EIP address associated with a running
instance at no charge. For more information, see <a class="xref" href="elastic-ip-addresses-eip.html" title="Elastic IP Addresses">Elastic IP Addresses</a>.</p><p>If you don't already have a domain name for your blog, you can register a domain
name with Amazon Route&nbsp;53 and associate your instance's EIP address with your domain name. For more
information, see <a class="ulink" href="http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/registrar.html" target="_blank">Registering Domain Names Using Amazon Route 53</a> in the
<span class="emphasis"><em>Amazon Route&nbsp;53 Developer Guide</em></span>.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both" id="install-wordpress">Install WordPress</h2></div></div></div><p>This tutorial is a good introduction to using Amazon EC2 in that you have full control over
a web server that hosts your WordPress blog, which is not typical with a traditional
hosting service. Of course, that means that you are responsible for updating the
software packages and maintaining security patches for your server as well. For a more
automated WordPress installation that does not require direct interaction with the web
server configuration, the AWS CloudFormation service provides a WordPress template that can also get
you started quickly. For more information, see <a class="ulink" href="http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/GettingStarted.Walkthrough.html" target="_blank">Getting Started</a> in the
<span class="emphasis"><em>AWS CloudFormation User Guide</em></span>. If you'd prefer to host your WordPress blog
on a Windows instance, see <a class="ulink" href="http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/EC2Win_CreateWordPressBlog.html" target="_blank">Deploying a WordPress Blog on Your Amazon EC2 Windows Instance</a> in the
<span class="emphasis"><em>Amazon EC2 User Guide for Microsoft Windows Instances</em></span>.</p><div class="procedure"><a name="d0e4411"></a><p class="title"><b>To download and unzip the WordPress installation package</b></p><ol class="procedure" type="1"><li class="step"><p>Download the latest WordPress installation package with the
<span class="command"><strong>wget</strong></span> command. The following command should always
download the latest
release.</p><pre class="programlisting"><code class="nohighlight">[ec2-user ~]$ <strong class="userinput"><code>wget https://wordpress.org/latest.tar.gz</code></strong>
--2013-08-09 17:19:01-- https://wordpress.org/latest.tar.gz
Resolving wordpress.org (wordpress.org)... 66.155.40.249, 66.155.40.250
Connecting to wordpress.org (wordpress.org)|66.155.40.249|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4028740 (3.8M) [application/x-gzip]
Saving to: latest.tar.gz
100%[======================================&gt;] 4,028,740 20.1MB/s in 0.2s
2013-08-09 17:19:02 (20.1 MB/s) - latest.tar.gz saved [4028740/4028740]
</code></pre></li><li class="step"><p>Unzip and unarchive the installation package. The installation folder is
unzipped to a folder called
<code class="filename">wordpress</code>.</p><pre class="programlisting"><code class="nohighlight">[ec2-user ~]$ <strong class="userinput"><code>tar -xzf latest.tar.gz</code></strong>
[ec2-user ~]$ <strong class="userinput"><code>ls</code></strong>
latest.tar.gz wordpress
</code></pre></li></ol></div><div class="procedure"><a name="create_user_and_database"></a><p class="title"><b>To create a MySQL user and database for your
WordPress installation</b></p><p>Your WordPress installation needs to store information, such as blog post entries
and user comments, in a database. This procedure helps you create a database for
your blog and a user that is authorized to read and save information to that
database. </p><ol class="procedure" type="1"><li class="step"><p>Start the MySQL
server.</p><pre class="programlisting"><code class="nohighlight">[ec2-user ~]$ <strong class="userinput"><code>sudo service mysqld start</code></strong></code></pre></li><li class="step"><p>Log in to the MySQL server as the <code class="literal">root</code> user. Enter your
MySQL <code class="literal">root</code> password when prompted; this may be different than
your <code class="literal">root</code> system password, or it may even be empty if you
have not secured your MySQL server.</p><div class="aws-note"><p class="aws-note">Important</p><p>If you have not secured your MySQL server yet, it is very important
that you do so. For more information, see <a class="xref" href="install-LAMP.html#SecuringMySQLProcedure" title="To secure the MySQL server">To secure the MySQL server</a>.</p></div><pre class="programlisting"><code class="nohighlight">[ec2-user ~]$ <strong class="userinput"><code>mysql -u root -p</code></strong>
Enter password:</code></pre></li><li class="step"><p><a name="create_database_user"></a>Create a user and password for your MySQL database. Your WordPress
installation uses these values to communicate with your MySQL database. Enter
the following command, substituting a unique user name and
password.</p><pre class="programlisting"><code class="nohighlight">mysql&gt; <strong class="userinput"><code>CREATE USER '<em class="replaceable"><code>wordpress-user</code></em>'@'localhost' IDENTIFIED BY '<em class="replaceable"><code>your_strong_password</code></em>';</code></strong>
Query OK, 0 rows affected (0.00 sec)</code></pre><p>Make
sure that you create a strong password for your user. Do not use the single
quote character ( ' ) in your password, because this will break the preceding
command. For more information about creating a secure password, go to <a class="ulink" href="http://www.pctools.com/guides/password/" target="_blank">http://www.pctools.com/guides/password/</a>. Do not reuse an existing
password, and make sure to store this password in a safe place.</p></li><li class="step"><p><a name="create_database"></a>Create your database. Give your database a descriptive, meaningful name, such
as <code class="literal">wordpress-db</code>.</p><div class="aws-note"><p class="aws-note">Note</p><p>The punctuation marks surrounding the database name in the command
below are called backticks. The backtick (<span class="keycap"><strong>`</strong></span>) key is
usually located above the <span class="keycap"><strong>Tab</strong></span> key on a standard
keyboard. Backticks are not always required, but they allow you to use
otherwise illegal characters, such as hyphens, in database names.</p></div><pre class="programlisting"><code class="nohighlight">mysql&gt; <strong class="userinput"><code>CREATE DATABASE `<em class="replaceable"><code>wordpress-db</code></em>`;</code></strong>
Query OK, 1 row affected (0.01 sec)</code></pre></li><li class="step"><p>Grant full privileges for your database to the WordPress user that you created
earlier.</p><pre class="programlisting"><code class="nohighlight">mysql&gt; <strong class="userinput"><code>GRANT ALL PRIVILEGES ON `<em class="replaceable"><code>wordpress-db</code></em>`.* TO "<em class="replaceable"><code>wordpress-user</code></em>"@"localhost";</code></strong>
Query OK, 0 rows affected (0.00 sec)</code></pre></li><li class="step"><p>Flush the MySQL privileges to pick up all of your
changes.</p><pre class="programlisting"><code class="nohighlight">mysql&gt; <strong class="userinput"><code>FLUSH PRIVILEGES;</code></strong>
Query OK, 0 rows affected (0.01 sec)</code></pre></li><li class="step"><p>Exit the <code class="literal">mysql</code>
client.</p><pre class="programlisting"><code class="nohighlight">mysql&gt; <strong class="userinput"><code>exit</code></strong>
Bye</code></pre></li></ol></div><div class="procedure"><a name="d0e4547"></a><p class="title"><b>To create and edit the wp-config.php file</b></p><p>The WordPress installation folder contains a sample configuration file called
<code class="filename">wp-config-sample.php</code>. In this procedure, you copy this file
and edit it to fit your specific configuration.</p><ol class="procedure" type="1"><li class="step"><p>Copy the <code class="filename">wp-config-sample.php</code> file to a file called
<code class="filename">wp-config.php</code>. This creates a new configuration file
and keeps the original sample file intact as a
backup.</p><pre class="programlisting"><code class="nohighlight">[ec2-user ~]$ <strong class="userinput"><code>cd wordpress/</code></strong>
[ec2-user wordpress]$ <strong class="userinput"><code>cp wp-config-sample.php wp-config.php</code></strong></code></pre></li><li class="step"><p>Edit the <code class="filename">wp-config.php</code> file with your favorite text
editor (such as <span class="command"><strong>nano</strong></span> or <span class="command"><strong>vim</strong></span>) and enter
values for your installation. If you do not have a favorite text editor,
<code class="literal">nano</code> is much easier for beginners to
use.</p><pre class="programlisting"><code class="nohighlight">[ec2-user wordpress]$ <strong class="userinput"><code>nano wp-config.php</code></strong></code></pre><ol type="a" class="substeps"><li class="step"><p>Find the line that defines <code class="literal">DB_NAME</code> and change
<code class="literal">database_name_here</code> to the database name that you
created in <a class="xref" href="hosting-wordpress.html#create_database" title="Step 4">Step 4</a> of <a class="xref" href="hosting-wordpress.html#create_user_and_database" title="To create a MySQL user and database for your WordPress installation">To create a MySQL user and database for your
WordPress installation</a>.</p><pre class="programlisting"><code class="nohighlight">define('DB_NAME', '<em class="replaceable"><code>wordpress-db</code></em>');</code></pre></li><li class="step"><p>Find the line that defines <code class="literal">DB_USER</code> and change
<code class="literal">username_here</code> to the database user that you
created in <a class="xref" href="hosting-wordpress.html#create_database_user" title="Step 3">Step 3</a> of <a class="xref" href="hosting-wordpress.html#create_user_and_database" title="To create a MySQL user and database for your WordPress installation">To create a MySQL user and database for your
WordPress installation</a>.</p><pre class="programlisting"><code class="nohighlight">define('DB_USER', '<em class="replaceable"><code>wordpress-user</code></em>');</code></pre></li><li class="step"><p>Find the line that defines <code class="literal">DB_PASSWORD</code> and change
<code class="literal">password_here</code> to the strong password that you
created in <a class="xref" href="hosting-wordpress.html#create_database_user" title="Step 3">Step 3</a> of <a class="xref" href="hosting-wordpress.html#create_user_and_database" title="To create a MySQL user and database for your WordPress installation">To create a MySQL user and database for your
WordPress installation</a>.</p><pre class="programlisting"><code class="nohighlight">define('DB_PASSWORD', '<em class="replaceable"><code>your_strong_password</code></em>');</code></pre></li><li class="step"><p>Find the section called <code class="literal">Authentication Unique Keys and
Salts</code>. These <code class="literal">KEY</code> and
<code class="literal">SALT</code> values provide a layer of encryption to the
browser cookies that WordPress users store on their local machines.
Basically, adding long, random values here makes your site more secure.
Visit <a class="ulink" href="https://api.wordpress.org/secret-key/1.1/salt/" target="_blank">https://api.wordpress.org/secret-key/1.1/salt/</a> to randomly
generate a set of key values that you can copy and paste into your
<code class="filename">wp-config.php</code> file. To paste text into a PuTTY
terminal, place the cursor where you want to paste the text and
right-click your mouse inside the PuTTY terminal.</p><p>For more information about security keys, go to <a class="ulink" href="http://codex.wordpress.org/Editing_wp-config.php#Security_Keys" target="_blank">http://codex.wordpress.org/Editing_wp-config.php#Security_Keys</a>.</p><div class="aws-note"><p class="aws-note">Note</p><p>The values below are for example purposes only; do not use
these values for your installation.</p></div><pre class="programlisting"><code class="nohighlight">define('AUTH_KEY', '<em class="replaceable"><code> #U$$+[RXN8:b^-L 0(WU_+ c+WFkI~c]o]-bHw+)/Aj[wTwSiZ&lt;Qb[mghEXcRh-</code></em>');
define('SECURE_AUTH_KEY', '<em class="replaceable"><code>Zsz._P=l/|y.Lq)XjlkwS1y5NJ76E6EJ.AV0pCKZZB,*~*r ?6OP$eJT@;+(ndLg</code></em>');
define('LOGGED_IN_KEY', '<em class="replaceable"><code>ju}qwre3V*+8f_zOWf?{LlGsQ]Ye@2Jh^,8x&gt;)Y |;(^[Iw]Pi+LG#A4R?7N`YB3</code></em>');
define('NONCE_KEY', '<em class="replaceable"><code>P(g62HeZxEes|LnI^i=H,[XwK9I&amp;[2s|:?0N}VJM%?;v2v]v+;+^9eXUahg@::Cj</code></em>');
define('AUTH_SALT', '<em class="replaceable"><code>C$DpB4Hj[JK:?{ql`sRVa:{:7yShy(9A@5wg+`JJVb1fk%_-Bx*M4(qc[Qg%JT!h</code></em>');
define('SECURE_AUTH_SALT', '<em class="replaceable"><code>d!uRu#}+q#{f$Z?Z9uFPG.${+S{n~1M&amp;%@~gL&gt;U&gt;NV&lt;zpD-@2-Es7Q1O-bp28EKv</code></em>');
define('LOGGED_IN_SALT', '<em class="replaceable"><code>;j{00P*owZf)kVD+FVLn-~ &gt;.|Y%Ug4#I^*LVd9QeZ^&amp;XmK|e(76miC+&amp;W&amp;+^0P/</code></em>');
define('NONCE_SALT', '<em class="replaceable"><code>-97r*V/cgxLmp?Zy4zUU4r99QQ_rGs2LTd%P;|_e1tS)8_B/,.6[=UK&lt;J_y9?JWG</code></em>');</code></pre></li><li class="step"><p>Save the file and exit your text editor.</p></li></ol></li></ol></div><div class="procedure"><a name="d0e4700"></a><p class="title"><b>To move your WordPress installation to the Apache document root</b></p><p>Now that you've unzipped the installation folder, created a MySQL database and
user, and customized the WordPress configuration file, you are ready to move your
installation files to your web server document root so you can run the installation
script that completes your installation. The location of these files depends on
whether you want your WordPress blog to be available at the root of your web server
(for example,
<code class="literal"><em class="replaceable"><code>my.public.dns.amazonaws.com</code></em></code>) or in
a subdirectory or folder (for example,
<code class="literal"><em class="replaceable"><code>my.public.dns.amazonaws.com/blog</code></em></code>).</p><ul class="procedure"><li class="step"><p>Choose the location where you want your blog to be available and only run the
<span class="command"><strong>mv</strong></span> associated with that location. </p><div class="aws-note"><p class="aws-note">Important</p><p>If you run both sets of commands below, you will get an error message
on the second <span class="command"><strong>mv</strong></span> command because the files you are
trying to move are no longer there.</p></div><ul class="stepalternatives">
<li class="step"><p>To make your blog available at
<code class="literal"><em class="replaceable"><code>my.public.dns.amazonaws.com</code></em></code>,
move the files in the <code class="filename">wordpress</code> folder (but not the
folder itself) to the Apache document root
(<code class="filename">/var/www/html</code> on Amazon Linux
instances).</p><pre class="programlisting"><code class="nohighlight">[ec2-user wordpress]$ <strong class="userinput"><code>mv * /var/www/html/</code></strong></code></pre></li>
<li class="step"><p><span class="emphasis"><em>OR</em></span>, to make your blog available at
<code class="literal"><em class="replaceable"><code>my.public.dns.amazonaws.com/blog</code></em></code>
instead, create a new folder called <code class="filename">blog</code> inside the
Apache document root and move the files in the
<code class="filename">wordpress</code> folder (but not the folder itself) to
the new <code class="filename">blog</code>
folder.</p><pre class="programlisting"><code class="nohighlight">[ec2-user wordpress]$ <strong class="userinput"><code>mkdir /var/www/html/blog</code></strong>
[ec2-user wordpress]$ <strong class="userinput"><code>mv * /var/www/html/blog</code></strong></code></pre></li>
</ul></li></ul></div><div class="aws-note"><p class="aws-note">Important</p><p>For security purposes, if you are not moving on to the next procedure immediately,
stop the Apache web server (<code class="literal">httpd</code>) now. After you move your
installation to the Apache document root, the WordPress installation script is
unprotected and an attacker could gain access to your blog if the Apache web server
were running. To stop the Apache web server, enter the command <span class="command"><strong>sudo service
httpd stop</strong></span>. If you are moving on to the next procedure, you do not
need to stop the Apache web server.</p></div><div class="procedure"><a name="d0e4780"></a><p class="title"><b>To allow WordPress to use permalinks</b></p><p>WordPress permalinks need to use Apache <code class="filename">.htaccess</code> files to
work properly, but this is not enabled by default on Amazon Linux. Use this
procedure to allow all overrides in the Apache document root.</p><ol class="procedure" type="1"><li class="step"><p>Open the <code class="filename">httpd.conf</code> file with your favorite text editor
(such as <span class="command"><strong>nano</strong></span> or <span class="command"><strong>vim</strong></span>). If you do not have
a favorite text editor, <code class="literal">nano</code> is much easier for beginners to
use.</p><pre class="programlisting"><code class="nohighlight">[ec2-user wordpress]$ <strong class="userinput"><code>sudo vim /etc/httpd/conf/httpd.conf</code></strong></code></pre></li><li class="step"><p>Find the section that starts with <code class="literal">&lt;Directory
"/var/www/html"&gt;</code>.</p><pre class="programlisting"><code class="nohighlight">&lt;Directory "/var/www/html"&gt;
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
<span class="bold"><strong>AllowOverride <em class="replaceable"><code>None</code></em></strong></span>
#
# Controls who can get stuff from this server.
#
Require all granted
&lt;/Directory&gt;</code></pre></li><li class="step"><p>Change the <code class="literal">AllowOverride None</code> line in the above section to
read <code class="literal">AllowOverride <em class="replaceable"><code>All</code></em></code>. </p><div class="aws-note"><p class="aws-note">Note</p><p>There are multiple <code class="literal">AllowOverride</code> lines in this
file; be sure you change the line in the <code class="literal">&lt;Directory
"/var/www/html"&gt;</code> section.</p></div><pre class="programlisting"><code class="nohighlight">AllowOverride <em class="replaceable"><code>All</code></em></code></pre></li><li class="step"><p>Save the file and exit your text editor.</p></li></ol></div><div class="procedure"><a name="d0e4847"></a><p class="title"><b>To fix file permissions for the Apache web server</b></p><p>Some of the available features in WordPress require write access to the Apache
document root (such as uploading media though the Administration screens). The web
server runs as the <code class="literal">apache</code> user, so you need to add that user to
the <code class="literal">www</code> group that was created in the <a class="link" href="install-LAMP.html" title="Tutorial: Installing a LAMP Web Server on Amazon Linux">LAMP web server tutorial</a>.</p><ol class="procedure" type="1"><li class="step"><p>Add the <code class="literal">apache</code> user to the <code class="literal">www</code>
group.</p><pre class="programlisting"><code class="nohighlight">[ec2-user wordpress]$ <strong class="userinput"><code>sudo usermod -a -G www apache</code></strong></code></pre></li><li class="step"><p>Change the file ownership of <code class="filename">/var/www</code> and its contents to
the <code class="literal">apache</code>
user.</p><pre class="programlisting"><code class="nohighlight">[ec2-user wordpress]$ <strong class="userinput"><code>sudo chown -R apache /var/www</code></strong></code></pre></li><li class="step"><p>Change the group ownership of <code class="filename">/var/www</code> and its contents
to the <code class="literal">www</code>
group.</p><pre class="programlisting"><code class="nohighlight">[ec2-user wordpress]$ <strong class="userinput"><code>sudo chgrp -R www /var/www</code></strong></code></pre></li><li class="step"><p>Change the directory permissions of <code class="filename">/var/www</code> and its
subdirectories to add group write permissions and to set the group ID on future
subdirectories.</p><pre class="programlisting"><code class="nohighlight">[ec2-user wordpress]$ <strong class="userinput"><code>sudo chmod 2775 /var/www</code></strong>
[ec2-user wordpress]$ <strong class="userinput"><code>find /var/www -type d -exec sudo chmod 2775 {} \;</code></strong></code></pre></li><li class="step"><p>Recursively change the file permissions of <code class="filename">/var/www</code> and
its subdirectories to add group write
permissions.</p><pre class="programlisting"><code class="nohighlight">[ec2-user wordpress]$ <strong class="userinput"><code>find /var/www -type f -exec sudo chmod 0664 {} \;</code></strong></code></pre></li><li class="step"><p>Restart the Apache web server to pick up the new group and
permissions.</p><pre class="programlisting"><code class="nohighlight">[ec2-user wordpress]$ <strong class="userinput"><code>sudo service httpd restart</code></strong>
Stopping httpd: [ OK ]
Starting httpd: [ OK ]</code></pre></li></ol></div><div class="procedure"><a name="d0e4931"></a><p class="title"><b>To run the WordPress installation script</b></p><ol class="procedure" type="1"><li class="step"><p>Use the <span class="command"><strong>chkconfig</strong></span> command to ensure that the
<code class="literal">httpd</code> and <code class="literal">mysqld</code> services start at
every system
boot.</p><pre class="programlisting"><code class="nohighlight">[ec2-user wordpress]$ <strong class="userinput"><code>sudo chkconfig httpd on</code></strong>
[ec2-user wordpress]$ <strong class="userinput"><code>sudo chkconfig mysqld on</code></strong></code></pre></li><li class="step"><p>Verify that the MySQL server (<code class="literal">mysqld</code>) is
running.</p><pre class="programlisting"><code class="nohighlight">[ec2-user wordpress]$ <strong class="userinput"><code>sudo service mysqld status</code></strong>
mysqld (pid 4746) is running...</code></pre><p>If
the <code class="literal">mysqld</code> service is not running, start
it.</p><pre class="programlisting"><code class="nohighlight">[ec2-user wordpress]$ <strong class="userinput"><code>sudo service mysqld start</code></strong>
Starting mysqld: [ OK ]</code></pre></li><li class="step"><p>Verify that your Apache web server (<code class="literal">httpd</code>) is
running.</p><pre class="programlisting"><code class="nohighlight">[ec2-user wordpress]$ <strong class="userinput"><code>sudo service httpd status</code></strong>
httpd (pid 502) is running...</code></pre><p>If
the <code class="literal">httpd</code> service is not running, start
it.</p><pre class="programlisting"><code class="nohighlight">[ec2-user wordpress]$ <strong class="userinput"><code>sudo service httpd start</code></strong>
Starting httpd: [ OK ]</code></pre></li><li class="step"><p>In a web browser, enter the URL of your WordPress blog (either the public DNS
address for your instance, or that address followed by the
<code class="literal">blog</code> folder). You should see the WordPress installation
screen.</p><pre class="programlisting"><code class="nohighlight">http://<em class="replaceable"><code>my.public.dns.amazonaws.com</code></em></code></pre><div class="mediaobject"><img src="images/wordpress_install.png" alt="Wordpress installation screen"></div></li><li class="step"><p>Enter the remaining installation information into the WordPress installation
wizard.</p><div class="informaltable"><div class="informaltable-contents"><table id="d0e5013" cellspacing="0" border="1"><colgroup><col class="c1"><col class="c2"></colgroup><thead><tr><th>Field</th><th>Value</th></tr></thead><tbody><tr><td><span class="guilabel">Site Title</span></td><td>Enter a name for your WordPress site.</td></tr><tr><td><span class="guilabel">Username</span></td><td>Enter a name for your WordPress administrator. For
security purposes, you should choose a unique name for this
user, because it will be more difficult to exploit than the
default user name, <code class="literal">admin</code>.</td></tr><tr><td><span class="guilabel">Password</span></td><td>Enter a strong password, and then enter it again to
confirm. Do not reuse an existing password, and make sure to
store this password in a safe place.</td></tr><tr><td><span class="guilabel">Your E-mail</span></td><td>Enter the email address you want to use for
notifications.</td></tr></tbody></table></div></div></li><li class="step"><p>Click <span class="guilabel">Install WordPress</span> to complete the
installation.</p></li></ol></div><p>Congratulations, you should now be able to log into your WordPress blog and start
posting entries.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both" id="wordpress-next-steps">Next Steps</h2></div></div></div><p>After you have tested your initial WordPress blog, consider updating its configuration.</p><p><span class="formpara">Use a Custom Domain Name</span></p><p>If you have a domain name associated with your EC2 instance's EIP address, you can
configure your blog to use that name instead of the EC2 public DNS address. For more
information, see <a class="ulink" href="http://codex.wordpress.org/Changing_The_Site_URL" target="_blank">http://codex.wordpress.org/Changing_The_Site_URL</a>.</p><p><span class="formpara">Configure Your Blog</span></p><p>You can configure your blog to use different <a class="ulink" href="https://wordpress.org/themes/" target="_blank">themes</a> and <a class="ulink" href="https://wordpress.org/plugins/" target="_blank">plugins</a> to offer a more personalized
experience for your readers. However, sometimes the installation process can backfire,
causing you to lose your entire blog. We strongly recommend that you create a backup
Amazon Machine Image (AMI) of your instance before attempting to install any themes or plugins so
you can restore your blog if anything goes wrong during installation. For more
information, see <a class="xref" href="AMIs.html#creating-an-ami" title="Creating Your Own AMI">Creating Your Own AMI</a>.</p><p><span class="formpara">Increase Capacity</span></p><p>If your WordPress blog becomes popular and you need more compute power or storage,
consider the following steps:</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Expand the storage space on your instance. For more information, see <a class="xref" href="ebs-expand-volume.html" title="Expanding the Storage Space of an EBS Volume on Linux">Expanding the Storage Space of an EBS Volume on
<span>Linux</span></a>.</p></li><li class="listitem"><p>Move your MySQL database to <a class="ulink" href="http://aws.amazon.com/rds" target="_blank">Amazon RDS</a>
to take advantage of the service's ability to scale automatically.</p></li><li class="listitem"><p>Migrate to a larger instance type. For more information, see <a class="xref" href="ec2-instance-resize.html" title="Resizing Your Instance">Resizing Your Instance</a>.</p></li><li class="listitem"><p>Add additional instances. For more information, see <a class="xref" href="ec2-increase-availability.html" title="Tutorial: Increase the Availability of Your Application on Amazon EC2">Tutorial: Increase the Availability of Your Application on Amazon EC2</a>.</p></li></ul></div><p><span class="formpara">Learn More about WordPress</span></p><p> For information about WordPress, see the WordPress Codex help documentation at <a class="ulink" href="http://codex.wordpress.org/" target="_blank">http://codex.wordpress.org/</a>. For more
information about troubleshooting your installation, go to <a class="ulink" href="http://codex.wordpress.org/Installing_WordPress#Common_Installation_Problems" target="_blank">http://codex.wordpress.org/Installing_WordPress#Common_Installation_Problems</a>.
For information about making your WordPress blog more secure, go to <a class="ulink" href="http://codex.wordpress.org/Hardening_WordPress" target="_blank">http://codex.wordpress.org/Hardening_WordPress</a>. For information about
keeping your WordPress blog up-to-date, go to <a class="ulink" href="http://codex.wordpress.org/Updating_WordPress" target="_blank">http://codex.wordpress.org/Updating_WordPress</a>.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both" id="wordpress-troubleshooting">Help! My Public DNS Name Changed and now my Blog is Broken</h2></div></div></div><p>Your WordPress installation is automatically configured using the public DNS address
for your EC2 instance. If you stop and restart the instance, the public DNS address
changes (unless it is associated with an Elastic IP address) and your blog will not work
anymore because it references resources at an address that no longer exists (or is
assigned to another EC2 instance). A more detailed description of the problem and
several possible solutions are outlined in <a class="ulink" href="http://codex.wordpress.org/Changing_The_Site_URL" target="_blank">http://codex.wordpress.org/Changing_The_Site_URL</a>.</p><p>If this has happened to your WordPress installation, you may be able to recover your
blog with the procedure below, which uses the <span class="command"><strong>wp-cli</strong></span> command line
interface for WordPress.</p><div class="procedure"><a name="d0e5141"></a><p class="title"><b>To change your WordPress site URL with the <span class="command"><strong>wp-cli</strong></span></b></p><ol class="procedure" type="1"><li class="step"><p>Connect to your EC2 instance with SSH. </p></li><li class="step"><p>Note the old site URL and the new site URL for your instance. The old site URL
is likely the public DNS name for your EC2 instance when you installed
WordPress. The new site URL is the current public DNS name for your EC2
instance. If you are not sure of your old site URL, you can use
<span class="command"><strong>curl</strong></span> to find it with the following
command.</p><pre class="programlisting"><code class="nohighlight">[ec2-user ~]$ <strong class="userinput"><code>curl localhost | grep wp-content</code></strong></code></pre><p>
You should see references to your old public DNS name in the output, which will
look like this (old site URL in
red):</p><pre class="programlisting"><code class="nohighlight">&lt;script type='text/javascript' src='<em class="replaceable"><code>http://ec2-52-8-139-223.us-west-1.compute.amazonaws.com</code></em>/wp-content/themes/twentyfifteen/js/functions.js?ver=20150330'&gt;&lt;/script&gt;</code></pre></li><li class="step"><p>Download the <span class="command"><strong>wp-cli</strong></span> with the following
command.</p><pre class="programlisting"><code class="nohighlight">[ec2-user ~]$ <strong class="userinput"><code>curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar</code></strong></code></pre></li><li class="step"><p>Search and replace the old site URL in your WordPress installation with the
following command. Substitute the old and new site URLs for your EC2 instance
and the path to your WordPress installation (usually
<code class="filename">/var/www/html</code> or
<code class="filename">/var/www/html/blog</code>).</p><pre class="programlisting"><code class="nohighlight">[ec2-user ~]$ <strong class="userinput"><code>php wp-cli.phar search-replace '<em class="replaceable"><code>old_site_url</code></em>' '<em class="replaceable"><code>new_site_url</code></em>' --path=<em class="replaceable"><code>/path/to/wordpress/installation</code></em> --skip-columns=guid</code></strong></code></pre></li><li class="step"><p>In a web browser, enter the new site URL of your WordPress blog to verify that
the site is working properly again. If it is not, see <a class="ulink" href="http://codex.wordpress.org/Changing_The_Site_URL" target="_blank">http://codex.wordpress.org/Changing_The_Site_URL</a> and <a class="ulink" href="http://codex.wordpress.org/Installing_WordPress#Common_Installation_Problems" target="_blank">http://codex.wordpress.org/Installing_WordPress#Common_Installation_Problems</a>
for more information.</p></li></ol></div></div></div></div><img src="images/expanderarrow.png" style="display:none;height:0;width:0"><div id="main-col-footer"><div id="doc-conventions"><a target="_top" href="/general/latest/gr/docconventions.html">Document Conventions</a></div><div id="next"><a class="awstoc" accesskey="p" href="install-LAMP.html">&laquo; Previous </a><a class="awstoc" accesskey="n" href="SSL-on-an-instance.html">Next &raquo;</a></div><div id="copyright-main-footer">&copy; 2016, Amazon Web Services, Inc. or its affiliates. All rights reserved.</div></div></div></div><div id="right-expanded"><div id="right-content-wrapper"><div id="right-col-header"><a id="pdf_link" href="ec2-ug.pdf"> PDF </a><text> | </text><a target="_blank" href="http://www.amazon.com/dp/B007Q4H9JI">Kindle </a></div><div id="pagetoc"><p>On this page:</p><ul class="pagetoc"><li class="pagetoc" name="Prerequisites"><a class="pagetoc" href="#hosting-wordpress-prereqs">Prerequisites</a></li><li class="pagetoc" name="Install WordPress"><a class="pagetoc" href="#install-wordpress">Install WordPress</a></li><li class="pagetoc" name="Next Steps"><a class="pagetoc" href="#wordpress-next-steps">Next Steps</a></li><li class="pagetoc" name="Help! My Public DNS Name Changed and now my Blog is Broken"><a class="pagetoc" href="#wordpress-troubleshooting">Help! My Public DNS Name Changed and now my Blog is Broken</a></li></ul></div></div></div></div></div><div id="footer"><div id="footer_short_fb" class="hide" title="Feedback"><a target="_blank" href="https://docs.aws.amazon.com/forms/aws-doc-feedback?hidden_service_name=EC2&amp;hidden_guide_name=User Guide for Linux Instances&amp;hidden_api_version=&amp;hidden_file_name=hosting-wordpress"><i class="fa fa-envelope-o"></i></a></div><div id="footer_toggle" class="mediaobject"><img id="footer_toggle_img" src="images/expanderarrow.png"><img id="footer_toggle_img_collapse" class="hide" src="images/expanderarrowright.png"></div><div id="footer-left"><a target="_top" href="http://aws.amazon.com/terms">Terms of Use</a> | &copy; 2016, Amazon Web Services, Inc. or its affiliates. All rights reserved.</div><div id="footer-right"><div id="feedback"><div id="forums"><a id="forum_link" target="_blank" href="http://forums.aws.amazon.com/forum.jspa?forumID=30">Have a question? Try the Forums.</a></div><div id="feedback-message">Did this page help you?</div><div id="feedback-yesno-buttons"><a class="awstoc btn btn-default" target="_blank" href="feedbackyes.html?topic_id=hosting-wordpress">Yes</a><a class="awstoc btn btn-default" target="_blank" href="feedbackno.html?topic_id=hosting-wordpress">No</a></div><div id="feedback-feedback-button"><a class="awstoc btn btn-default" target="_blank" href="https://docs.aws.amazon.com/forms/aws-doc-feedback?hidden_service_name=EC2&amp;hidden_guide_name=User Guide for Linux Instances&amp;hidden_api_version=&amp;hidden_file_name=hosting-wordpress">Feedback</a></div></div></div></div><noscript><div><div><div><div id="error_messages"><img src="https://d1ge0kk1l5kms0.cloudfront.net/images/G/01/webservices/console/warning.png" style="float: left;" alt="Warning"><div id="js_error_message"><strong>Javascript is disabled or is unavailable in your browser.</strong><br> To use the AWS Documentation, Javascript must be enabled. Please refer to your browser's Help pages for instructions. </div></div></div></div></div></noscript><!-- SiteCatalyst code version: H.25.2.
Copyright 1996-2012 Adobe, Inc. All Rights Reserved
More info available at http://www.omniture.com --><script language="JavaScript" type="text/javascript" src="https://a0.awsstatic.com/s_code/js/1.0/awshome_s_code.js"></script><script language="JavaScript" type="text/javascript"><!--
// Documentation Service Name
s.prop66='Amazon Elastic Compute Cloud';
s.eVar66='D=c66';
// Documentation Guide Name
s.prop65='User Guide for Linux Instances';
s.eVar65='D=c65';
var s_code=s.t();if(s_code)document.write(s_code)//--></script><script language="JavaScript" type="text/javascript"><!--
if(navigator.appVersion.indexOf('MSIE')>=0)document.write(unescape('%3C')+'\!-'+'-')
//--></script><noscript><img src="http://amazonwebservices.d2.sc.omtrdc.net/b/ss/awsamazondev/1/H.25.2--NS/0" height="1" width="1" border="0" alt=""></noscript><!--/DO NOT REMOVE/--><!-- End SiteCatalyst code version: H.25.2. --></body></html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment