Hosting wordpress on amazon s3 client

The following procedures will help you install, configure, and secure a WordPress blog on your Amazon Linux instance. 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.

You are responsible for updating the software packages and maintaining security patches for your server. 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 Getting Started in the AWS CloudFormation User Guide. If you'd prefer to host your WordPress blog on a Windows instance, see Deploying a WordPress Blog on Your Amazon EC2 Windows Instance in the Amazon EC2 User Guide for Windows Instances. If you need a high-availability solution with a decoupled database, see Deploying a High-Availability WordPress Website in the AWS Elastic Beanstalk Developer Guide.

Hosting wordpress on amazon s3 client procedure, you do not

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 WordPress in the Ubuntu documentation.

Prerequisites

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 Tutorial: Installing a LAMP Web Server on Amazon Linux. This tutorial also has steps for configuring a security group to allow HTTP and HTTPS 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 Tutorial: Installing a LAMP Web Server on Amazon Linux to meet these prerequisites and then return to this tutorial to install WordPress. For information about adding rules to your security group, see Adding Rules to a Security Group.

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 Elastic IP Addresses.

Hosting wordpress on amazon s3 client add that user

If you don't already have a domain name for your blog, you can register a domain name with Amazon RouteВ 53 and associate your instance's EIP address with your domain name. For more information, see Registering Domain Names Using Amazon Route 53 in the Amazon RouteВ 53 Developer Guide.

Install WordPress

Connect to your instance, and download the WordPress installation package.

To download and unzip the WordPress installation package

Download the latest WordPress installation package with the wget command. The following command should always download the latest release.

Unzip and unarchive the installation package. The installation folder is unzipped to a folder called wordpress.

To create a MySQL user and database for your WordPress installation

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.

Start the MySQL server.

Log in to the MySQL server as the root user. Enter your MySQL root password when prompted; this may be different than your root system password, or it may even be empty if you have not secured your MySQL server.

If you have not secured your MySQL server yet, it is very important that you do so. For more information, see To secure the MySQL server.

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.

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 www.pctools.com/guides/password/. Do not reuse an existing password, and make sure to store this password in a safe place.

Create your database. Give your database a descriptive, meaningful name, such as wordpress-db.

The punctuation marks surrounding the database name in the command below are called backticks. The backtick (` ) key is usually located above the Tab 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.

Grant full privileges for your database to the WordPress user that you created earlier.

Flush the MySQL privileges to pick up all of your changes.

Exit the mysql client.

To create and edit the wp-config.php file

The WordPress installation folder contains a sample configuration file called wp-config-sample.php. In this procedure, you copy this file and edit it to fit your specific configuration.

Copy the wp-config-sample.php file to a file called wp-config.php. This creates a new configuration file and keeps the original sample file intact as a backup.

Edit the wp-config.php file with your favorite text editor (such as nano or vim ) and enter values for your installation. If you do not have a favorite text editor, nano is much easier for beginners to use.

Find the line that defines DB_NAME and change database_name_here to the database name that you created in StepВ 4 of To create a MySQL user and database for your WordPress installation.

Find the line that defines DB_USER and change username_here to the database user that you created in StepВ 3 of To create a MySQL user and database for your WordPress installation.

Find the line that defines DB_PASSWORD and change password_here to the strong password that you created in StepВ 3 of To create a MySQL user and database for your WordPress installation.

Find the section called Authentication Unique Keys and Salts. These KEY and SALT 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 https://api.wordpress.org/secret-key/1.1/salt/ to randomly generate a set of key values that you can copy and paste into your wp-config.php 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.

The values below are for example purposes only; do not use these values for your installation.

Save the file and exit your text editor.

To move your WordPress installation to the Apache document root

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, my.public.dns.amazonaws.com ) or in a subdirectory or folder (for example, my.public.dns.amazonaws.com/blog ).

Choose the location where you want your blog to be available and only run the mv associated with that location.

If you run both sets of commands below, you will get an error message on the second mv command because the files you are trying to move are no longer there.

To make your blog available at my.public.dns.amazonaws.com. move the files in the wordpress folder (but not the folder itself) to the Apache document root ( /var/www/html on Amazon Linux instances).

OR. to make your blog available at my.public.dns.amazonaws.com/blog instead, create a new folder called blog inside the Apache document root and move the files in the wordpress folder (but not the folder itself) to the new blog folder.

For security purposes, if you are not moving on to the next procedure immediately, stop the Apache web server ( httpd ) 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 sudo service httpd stop. If you are moving on to the next procedure, you do not need to stop the Apache web server.

To allow WordPress to use permalinks

WordPress permalinks need to use Apache .htaccess 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.

Open the httpd.conf file with your favorite text editor (such as nano or vim ). If you do not have a favorite text editor, nano is much easier for beginners to use.

Find the section that starts with .

Change the AllowOverride None line in the above section to read AllowOverride All.

There are multiple AllowOverride lines in this file; be sure you change the line in the section.

Save the file and exit your text editor.

To fix file permissions for the Apache web server

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 apache user, so you need to add that user to the www group that was created in the LAMP web server tutorial.

Add the apache user to the www group.

Change the file ownership of /var/www and its contents to the apache user.

Change the group ownership of /var/www and its contents to the www group.

Change the directory permissions of /var/www and its subdirectories to add group write permissions and to set the group ID on future subdirectories.

Recursively change the file permissions of /var/www and its subdirectories to add group write permissions.

Restart the Apache web server to pick up the new group and permissions.

To run the WordPress installation script

Use the chkconfig command to ensure that the httpd and mysqld services start at every system boot.

Verify that the MySQL server ( mysqld ) is running. If the mysqld service is not running, start it.

Verify that your Apache web server ( httpd ) is running. If the httpd service is not running, start it.

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 blog folder). You should see the WordPress installation screen.

Enter the remaining installation information into the WordPress installation wizard.

Related articles

How to install wordpress on 000webhost free hostingInstall WordPress on 000webhost WordPress is one of the best blogging platforms. Nowadays, People are moving to WordPress due to its user friendliness, advanced themes, plugins and options for...
Aws elastic beanstalk wordpress hostingThis tutorial walks you through the process of launching an RDS DB instance external to AWS Elastic Beanstalk, and configuring a high-availability environment running a WordPress website to...
Web hosting one-click wordpress install wampHow to Install WordPress WordPress, as one of the most user-friendly CMSs online, has been downloaded for millions of thousands of times all over the world. Its easy-to-understand interface,...
Hosting wordpress on iisby Eric Woersching Introduction WordPress is a blog publishing application and content management system. According to wordpress.org,WordPress is "a state-of-the-art semantic personal...
Hosting wordpress on iis 7by Eric Woersching Introduction WordPress is a blog publishing application and content management system. According to wordpress.org,WordPress is "a state-of-the-art semantic personal...