Part 4- Install WordPress with EC2 and RDS Instance

Continued from – Fast Amazon AWS Optimized WordPress EC2 RDS S3 Manual Cache Gzip Config – Part 1
Continued from – Amazon EC2 RDS WordPress – Part 2
Continued from – Tutorial on Amazon EC2 RDS WordPress with SSH – Part 3

Now we are going to be creating a directory under in the directory path /var.

Login to your AWS server using the command:

ssh -i /yourcomputers/path/directory/YOURKEYPAIRNAME.pem ubuntu@Yo.ur.El.ast.ic.IP

Quick Learning Terminal Command Line Tips

For the beginner Terminal command user, once logged in, use this command until it stops going back directories:

cd ..

You can then advance forward through the terminal directories using the command “cd /var” or “cd /etc” and so on. To see a list of directories and files use the command “ls”

Get the latest update from WordPress!

In the command line you are first going to use wget to download the latest WordPress files onto your server in a gzipped file. You are then going to unzip this into the /var/ directory. It will create a folder in the var directory, typically like this var/wordpress. In this folder will be wp-config, wp-content and so on. We will be changing the folder name to www. The file structure will be similar to var/www/wp-content/plugins/coolplug/cool.css:

If you have trouble check this out:

sudo wget
cd /var
sudo tar xfz ~/latest.tar.gz
sudo chown -R www-data:www-data www
mv wordpress www
cd www
sudo rm license.txt readme.html
sudo touch .htaccess
sudo chown www-data:www-data .htaccess
sudo mv wp-config-sample.php wp-config.php

We are now ready to edit the wp-config.php file to tie together the RDS database and EC2 Ubuntu 12.10 server instance.

Editing wp-config.php for AWS EC2 RDS S3

In Terminal while logged onto the server through SSH issue this command:
Wait… First get to the www directory.
“cd ..” or “ls” but get to /var/www/
then command:

sudo vi wp-config.php

Using insert change the following to match the details you have used during this tutorial. YourDBName is from Part 2.

/** The name of the database for WordPress */
define(‘DB_NAME’, ‘YourDBName’);

/** MySQL database username */
define(‘DB_USER’, ‘NAME’);

/** MySQL database password */

/** MySQL hostname */
define(‘DB_HOST’, ‘HOST.END.POINT’);

Next Change out the WordPress Salts using this Salts Generator for WordPress. It should look like:

define(‘AUTH_KEY’, ‘S}.x~}S)tvdtIfFhuk[#]|I5C&$|aU6#7u}(fw?`^/-[42!-bnv~gcx9|V1kr/Vj’);
define(‘SECURE_AUTH_KEY’, ‘`rGc/4^?s|OSZ 2|}pkp1][;=71lyER!I,a<o33brHBf|o9LwZKz{+N+f+cotx3~’); define(‘LOGGED_IN_KEY’, ‘S#*aW|&kibF&sR3I`U)rX#yKpVbR,_/.>Q2Z!ejJVt=r}qJp+=^5|X~a)WAc’);
define(‘NONCE_KEY’, ‘AS#x.)08o5{W:J;zQE4mTrR!@kF&TQ*?e?@)N-}!H|p8)%m9s.yqvuB42-nhF.;B’);
define(‘AUTH_SALT’, ‘,s*q)kZ_5Ep4&mG`L=W<uEh&h4qM-AY?o0{0k#WMV4.5HVT}[_dcyk P&j RH’);
define(‘SECURE_AUTH_SALT’, ‘v4{.ks|<DCUm<.x|-f}BXJ$d?j b4C9Zp=(.N$$jew2Gr`&OPrFQP)sY4FhnZ#Wl’); define(‘LOGGED_IN_SALT’, ‘D6u,h`dN#X&tKbm()fo4L)c>:S04)=s)_m/K|-}wL]UWORS7a^2=^.jj)hJ+L?I6’);
define(‘NONCE_SALT’, ‘ehNmNK / QFb=`yw}x}jr$eF /M3:=OW-Kx+wr1%s.N:d<*U69Q(3#.JbDlD:)?z’);

DO NOT use the salts above. Generate your own following the generator link above.

If the current WordPress site that you have has a database table prefix other than wp_, now is the time to let this installation know. When you are importing in your site this will save you lots of headaches if you do it now. If this is a new install, the options is yours. Read about it at

Install WordPress at the Elastic IP

Now is time for a drum roll. Open a new browser window. Where you would normally put a url such as put the Elastic Ip address of your site. Hit enter… Ta dah!

It is now time to begin setting up your WordPress installation and connecting it to S3.

Continue on to Part 5- Settings for WordPress and Amazon AWS S3.

Comments are closed.