In this intermediate level WordPress tutorial, I will cover how you can host an absolutely free WordPress blog that you can customize as you see fit. The only alternative solution for a free WordPress blog has to do with signing up with WordPress.com and hosting your blog with them, but they do not offer you the freedom that hosting your site on the Amazon free usage tier does. For one thing, you have complete freedom of design and branding using the cloud server solution described in this tutorial.
Setting on Your Amazon Account for Free:
The first thing you have to do is sign up and start a cloud server on Amazon’s free usage tier. Here is how:
- Go to aws.amazon.com, signup & login to your AWS Management Console
- Open EC2 tab and click “Launch Instance”.
- Select Linux 64bit with the star by it first step of wizard then click Continue 2 times until you see the screen to enter a key/value pair.
- Leave the first key field set to “name”. Set the value to a name to id your server. Click Continue.
- If it’s your first time making an instance, choose “create new key pair” and follow the procedure to do so. Otherwise, choose one you created before and continue.
- If you haven’t created a security key, choose default here and continue to launch pg and click “Launch”.
- Click on text link that reads “View your instances on the Instances page”.
- 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. If you do not have Putty, the command line interface necessary for this step, you can download it at: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
- In the left column of your Putty interface, expand “ssh” and click on “auth” then browse to where you saved your .ppk file. If you have a pem, use Puttygen to reformat it. Click “open” when done.
- Enter the user name “ec2-user” and you will get a command prompt if it worked.
- Type the following command line commands at the prompt:
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;
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’;
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.
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 it said ok, you are okay, so try again and it should work.
Now type the following commands to install phpmyadmin if you want it:
tar -jxf phpMyAdmin-3.4.1-all-languages.tar.bz2 -C /var/www/html
mv phpMyAdmin-3.4.1-all-languages phpmyadmin
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
Find the line that reads “$cfg[‘blowfish_secret’] = ”;” and add a value of a secret passcode. 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 in your new phpmyadmin area.
Installing a WordPress Blog in the Cloud:
- Now go to your phpmyadmin and create a new database named wps.
- 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.
- Go to the site manager, click “new site” and enter the public DNS into the host field. Select “SFTP” as the protocol. Logon type needs to be “Normal” and finally enter the username and click connect.
- 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 dir by going to /var/www/html.
- 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.
- 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.
- 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.
That is all there is to creating you very own free usage tier account with Amazon cloud server and installing WordPress on it. You can use this account completely free if you don’t go over on disk space usage. After that year, you will start accumulating charges. Also, if you go over your allotted disk space in the free usage tier, you will start accumulating charges. Be careful and monitor your Amazon account to be safe. Have fun with your new free WordPress site in the cloud! You will find it goes faster and smoother than on any other server.