WordPress on Amazon Web Services (AWS) Linux EC2 Micro Instance, For Free

I’ve been wanting to get a write up done for WordPress on AWS, the fact that it is free for a year, since they’ve released the free-tier many months ago. Well I finally got around to it, however it isn’t a write up. I went ahead and put the work in to produce a video of the steps for setup & configuration. Enjoy.

The commands to install php, mysql, httpd (apache), and manipulate the config files are included below for copy and paste needs.

Create a Linux Instance on AWS – create & assign an IP Address

Login with ‘ec2-user’

sudo -i
lsof -i

yum -y install httpd

service httpd start

yum -y install php mysql
yum install mysql-server

wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
rpm -Uvh rpmforge-release-0.3.6-1.el5.rf.i386.rpm
yum install phpmyadmin

vi /etc/httpd/conf.d/phpmyadmin.conf

Hit insert hey to make changes to the conf file.

————————————————————————————
# Web application to manage MySQL

# Order Deny,Allow
# Deny from all
Allow from all

Alias /phpmyadmin /usr/share/phpmyadmin
Alias /phpMyAdmin /usr/share/phpmyadmin
Alias /mysqladmin /usr/share/phpmyadmin
————————————————————————————

service httpd restart
service mysqld start
/usr/bin/mysqladmin -u root password ‘somepassword’
vi /etc/httpd/conf.d/phpmyadmin.conf
vi /usr/share/phpmyadmin/config.inc.php

————————————————————————————
[...] /* Authentication type */
$cfg['Servers'][$i]['auth_type'] = ‘http’;
[...]
————————————————————————————

Watch the video for the WordPress Database creation in mysql w/ phpmyadmin.

wget http://wordpress.org/latest.tar.gz
tar -xzvf latest.tar.gz -C /var/www/html/
cp -avr /var/www/html/wordpress/* /var/www/html/
rm -rf /var/www/html/wordpress/

cd /etc/httpd/conf
vi httpd.conf
Find the user here… it should be ‘apache’

cp /var/www/html/wp-config-sample.php /var/www/html/wp-config.php
vi /var/www/html/wp-config.php

…Add the database settings.

chown -R apache /var/www/html
chmod -R 755 /var/www/html

Advertisement
25 comments
  1. Pingback: DotNetShoutout

  2. Dear Mr. Hall,

    I have tried repeatedly to follow these instructions and set this up but the 2 times I did it I received the same answer. I was wondering if I might be able to chat with you some time? I can send you the notes & questions ahead of time.

    Thanks,

    Scott M. Shepard

  3. loneconspirator said:

    I found that I needed to include php-mysql in the yum -y install line

  4. Sujit Kumar said:

    Thanks a ton for this post/video.

    • Adron said:

      Yup, very true. You guys have a very easy setup too. Much easier than manually setting it up as I’ve shown in the video. However, for those that are hard core and want to manage it themselves. ;)

      I’ve actually pointed a number of people toward your AMIs. :) Cheers!

  5. Eddy Baggins said:

    “Watch the video for the WordPress Database creation in mysql w/ phpmyadmin”

    Could you type this out please? I can’t watch the video at work and it’s extremely graining on my personal computer (I’m not able to get a decent connection where I’m at geographically).
    It would be very helpful. So far, your directions have been great.

    • Adron said:

      I would if I had the time… hit up the website for mysql and phpmyadmin. There are steps on those sites that are written out. Cheers! :)

      • Eddy Baggins said:

        What sites, Adron? Thanks.

      • Eddy Baggins said:

        I’m 100% now – used your post and a couple of others to cover gaps. Great work and thanks for posting!

  6. David said:

    I’m stuck here vi /etc/httpd/conf.d/phpmyadmin.conf What commands did you use to exit the session i saw something like “ix” and then “clear” after modifying (allow from all) and etc, i can’t exit from here. Thanks.

    • Adron said:

      Yeah, just hit escape, then :x and hit enter. That’ll save your changes and exit vi.

  7. Mike said:

    Ctrl Colon and then x clear. I tried it but it doesn’t work. We need some help from the expert. Can you explain it. I will link you to all my sites if you help me with this.

  8. Eddy Baggins said:

    Dumb question #2: when I go to http://x.x.x.x/phpmyadmin and it prompts me for the username and password I’m getting stuck. I see in the video that you’re using root as the username, but when was the password set? I don’t recall setting a password for phpmyadmin. I tried the password that I set for mysql previous in the instructions, but that didn’t work. Thanks.

    • Eddy Baggins said:

      NM. Nuked my instance and started over. This time it worked with the mysql pword. PFM. Feel free to delete my last comment if you want. Thanks.

      • Adron said:

        Sure thing… glad you enjoyed the post. :)

  9. nickjam said:

    My AWS WordPress install went well. But it is not sending registration confirmation emails. All else works well. Help, please?

    • Adron said:

      Did you check any of the systems logs?

  10. Jure said:

    Hey great post and lessons, thank you! I dont know what im doing wrong: i came to: /usr/bin/mysqladmin -u root password ‘somepassword’, but then I get answer:

    /usr/bin/mysqladmin: connect to server at ‘localhost’ failed
    error: ‘Access denied for user ‘root’@'localhost’ (using password: NO)’

    Can you help me please?

  11. On your 1′s & 0′s with this one here! Nicely detailed install and I like how you cleaned the repositories and you went along. That showed “maintenance….MAAAAN!”

  12. ravi said:

    Hi adron I used your tutorial to setup my Amazon EC2 cloud when i get to command vi /usr/share/phpmyadmin/config.inc.php It works but its doesn’t show ” first server” part plz help me I would really appreciate your help

    photo/1

  13. Hi, thanks for the great tutorial, it helped me get PHP and MySQL running on an EC2 real quick!

    There’s a minor “bug” though that seems to be bothering many users – if you copy-paste the commands, then you end up with erroneus mysql root password. The reason is that your WordPress has replaced ‘ (ascii apostrophe) with some unicode counterpart.

    For example if you copy and paste the following command and replace only the somepassword part (but not the quotes), then the password will not be somepassword but ‘somepassword’ (including the unicode apostrophes).

    /usr/bin/mysqladmin -u root password ‘somepassword’

    You need to skip the quotes if the password is one word, or replace them with ascii apostrophes or quotes.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 3,399 other followers