Codeable info

Putting WordPress in the Cloud for Free

Posted on by in WordPress Tutorials

This WordPress tutorial is a semi-advanced tutorial that requires some server administration skills and basic WordPress installation skills. I do my best to describe the process in simple terms so that almost everyone should be able to follow along and establish a WordPress blog in the cloud without much trouble. With the technique described in this tutorial, you will be able to host a free blog using WordPress on one of the fastest servers available in the cloud. Cloud servers are a rapidly growing industry and companies like Amazon are fighting to gain market share. This is great for consumers because they are giving their services away for nothing just to show people how great they work. This tutorial describes how to make use of this opportunity by using the Amazon free usage tier to host a WordPress blog for absolutely free. Amazon VPS cloud servers charge by the hour, by disc space and by ram usage depending on your plan. Since the disk space needed to host a WordPress blog is not very significant, you can almost always get away with hosting one for up to a year for no charge at all!

Advantages to Using a Cloud Server with WordPress

Here is a list of noted advantages of using an Amazon cloud server to host your blog instead of a paid host.

  • Faster server – Amazon cloud servers are faster than regular paid web hosts even if you use the free usage tier and a micro-instance. Pages load faster and run smoother.
  • Free for a year – With Amazons free usage tier promotion, you shouldn’t have to pay anything for the first year, then you can decide if you like it and can choose to pay or close your account after the free service has run out.
  • Complete control – You can install your own software and have complete control over the administration of your server. This allows you to run anything you want how and when you choose. You are not restricted to any certain version of PHP or anything else. You have complete shell access.
  • Tools – Amazon also offers a very wide range of support tools for scripting and account management that will help you manage your WordPress blog and server.

Disadvantages to Using Amazon Cloud servers with WordPress

When ever I mention advantages, I feel compelled to mention any possible disadvantages as well, so here are a few I can think of.

  • Possible charges – if you don’t monitor your account carefully and are not careful what services you add, you may end up paying a monthly bill with Amazon.
  • Support – While Amazon does offer support, you will not have the traditional type of support you may be accustomed to with another paid web host. You are 100% responsible for the administration of your servers in the cloud which isn’t all bad, but for those accustomed to support, it could be a small nuisance to figure some things out on your own.
  • Learning curve – there is a slight learning curve when it comes to learning how to set up servers in the cloud. If you are not accustomed to server administration at all, this may be a real challenge for you. Don’t worry too much though because by following this tutorial, you should learn how to set up a server in the cloud fairly easily. Then doing it again will become much simpler.

Setting up a Cloud Server

The first step to your free WordPress blog in the cloud is to set up an account with Amazon cloud servers. Here is how.

  1. Goto aws.amazon.com. Sign up & log in to your AWS Management Console.
  2. Open EC2 tab and click “Launch Instance”.
  3. Select Linux 64bit with the star by it in first step of wizard then click Continue 2 times until you see the screen to enter a key/value pair.
  4. Leave the first key field set to “name”. Set the value to something unique that will identify your server and click Continue.
  5. If it’s your first time making an instance, choose “create new key pair” and follow the procedure to do so. Otherwise, chose one that you have created before and continue.
  6. If you haven’t created a security key, choose “default” here and continue to the launch page and click “Launch”.
  7. Click on the text link that reads “View your instances on the Instances page”.
  8. Open Putty and enter the public DNS you were given during instance creation i.e.: ec2-23-50-63-219.compute-1.amazonaws.com into the host field.
  9. Still using Putty, in the left column, expand “ssh” by clicking the “x” by it and click on “auth” then browse to where you saved your .ppk key file. If you have a .pem file instead, use Puttygen to reformat it. Click “open” when you are done.
  10. A fresh command line prompt will appear. Enter the user name “ec2-user” and you will get a command prompt if everything has worked so far. If not, go back and check each step above for errors.
  11. Type the following command line commands at the command prompt and hit enter after each:
  12. sudo yum install php-mysql php php-xml php-mcrypt php-mbstring php-cli mysql httpd
     
    sudo yum install mysql-server
     
    sudo /etc/init.d/mysqld start
     
    mysqladmin -u root password UrPassWord
     
    mysql -u root –p
     
    CREATE DATABASE MYSQL;
     
    use MYSQL
     
    CREATE USER 'MYSQL_admin'@'localhost' IDENTIFIED BY ‘myadminpass’;
     
    GRANT ALL PRIVILEGES ON MYSQL TO 'MYSQL_admin'@'localhost';
     
    CREATE USER 'MYSQL_user'@'localhost' IDENTIFIED BY 'myuserpass';
     
    GRANT SELECT, INSERT, UPDATE, DELETE ON [DataBase NAME].* TO '[DataBase NAME]_user'@'localhost';
     
    Exit;
     
    Sudo chown e2c-user /var/www/html
     
    sudo vim /var/www/html/index.php

    At this point if you typed all the above commands correctly you should be in the middle of editing a file with the vim editor. Type “I” to put it into insert mode and type something for the contents of a test PHP page, Then hit the [Esc] key to get out of insert mode and type “:wq” to save your file.

    Type:

    Sudo service httpd start

    Go to your public DNS and see if you see your test page. If you don’t try these possible fixes.

    Your test page may not have proper file permissions, so type:

    Sudo chown ec2-user /var/www/html/index.php

    If it is still not to working, restart the httpd server by typing:

    service httpd restart

    If you got a response saying “ok”, then it was successful, so try again and it should work.

    Installing PHPMyAdmin

    Now type the following commands to install PHPMyAdmin if you want it:

    cd /var/www/html
     
    wget http://www.sourceforge.net/projects/phpmyadmin/files/phpMyAdmin/3.4.1/phpMyAdmin-3.4.1-all-languages.tar.bz2
     
    tar -jxf phpMyAdmin-3.4.1-all-languages.tar.bz2 -C /var/www/html
    mv phpMyAdmin-3.4.1-all-languages phpmyadmin
    cd /var/www/html/phpmyadmin
    mkdir config
    cp /var/www/html/phpmyadmin/config.sample.inc.php /var/www/html/phpmyadmin/config/config.inc.php
    Sudo vim /var/www/html/phpmyadmin/config/config.inc.php

    The last command above should have opened the config.inc.php file in your VIM editor. Find the line that reads “$cfg[‘blowfish_secret’] = ”;” and add a value of a secret pass code. It can be anything.

    Find the line that reads “$cfg[‘Servers’][$i][‘AllowNoPassword’] = false;” and change false to true.

    Now hit the [Esc] key and type :wq to save and quit. Finally go to your public DNS followed by /PHPMyAdmin and if it worked you will be on your new PHPMyAdmin page.

    Installing WordPress On Amazon VPS

    1. Now go to your PHPMyAdmin and create a new database named wps.
    2. Open Filezilla, click on “edit” select “settings” then select “sftp” in the left column and click on “add keyfile…” in the right column. Select your .ppk file and make a private key out of it. If you already have a private key stored in the box above the button, you may be able to use that instead.
    3. Go to the site manager, click “new site” and enter the public DNS into the host field. Select “SFTP” as the protocol. Log on type needs to be “Normal” and finally enter the user name and click “connect”.
    4. Once connected via FTP using Filezilla or another FTP program, go down two directories to get to the root. Then navigate back up to the HTML directory by going to /var/www/html.
    5. Download and extract WordPress from http://wordpress.org/download/
    • Make changes to files from your desktop – Open the new folder named “wordpress” created on your desktop. Locate the file named “wp-config-sample.php” and rename it to “wp-config.php”. Open the config.php file in notepad and fill in your own database details where they are required. You will clearly see where they go as the file is well notated for this purpose./li>
    • Upload the WordPress files via FTP – Now create a directory on your server for your blog. If you want your blog to be in the root directory, like example.com, then upload all the files in your WordPress installation to the root folder, but do not include the folder itself, just the files. If you want a separate directory for your blog, make a new directory for your blog, like example.com/blog. Use your favorite FTP client such as FileZilla to upload the files./li>
    • Run the WordPress installation script – This is done by accessing the wp-admin/install.php file from a web browser. You would go to example.com/wp-admin/install.php or example.com/blog/wp-admin/install.php depending on how you uploaded it in the previous step./li>

    Summary

    That is all there is to it. If you followed this tutorial step by step, you should now have a completely free web host with WordPress installed. It will last one year, so be sure to make arrangements to pay after that year. You can install other servers in the cloud with the same Amazon account, but if you have more than one instance running, you will more than likely accumulate more hours than are provided for free each month and will get charged. Be sure to read everything you sign up for carefully and investigate any possible charges before expanding any of your services with Amazon because there may be charges associated with any extras you add to your account.

    If you just follow the instructions provided in this tutorial and make sure everything you do is on the free tier, you should not get charged anything for the first year. Be sure to monitor your account regularly to make sure you are not exceeding usage allotted in the free tier Amazon offers. I have successfully ran a WordPress blog for several months without any fees, but if you have a larger site and require more ram, hard drive space or bandwidth to run your blog than normal, your blog could end up exceeding that which is provided for free and could accumulate charges. It is up to you to monitor your own Amazon account to make sure you don’t have to pay for extras. You will have to tie a credit card to your Amazon account to open it, so they will charge you if you exceed the allowed server time. Good luck managing your new WordPress blog in the cloud and above all, have fun doing it!

    Let me know if you have any questions in the comments section below.

Comments Closed

Codeable info