{"id":684,"date":"2014-10-22T02:50:17","date_gmt":"2014-10-21T21:50:17","guid":{"rendered":"http:\/\/52.24.147.87\/?p=6"},"modified":"2018-03-09T08:36:27","modified_gmt":"2018-03-09T03:36:27","slug":"aws-free-website-2","status":"publish","type":"post","link":"http:\/\/www.stonemillkids.com\/index.php\/2014\/10\/22\/aws-free-website-2\/","title":{"rendered":"Creating a WebSite with AWS and WordPress (in 24 hours)"},"content":{"rendered":"<p>I have been thinking for a long time about creating website.\u00a0 A launching point of sorts, for whatever I want to do next.<\/p>\n<p>After doing some research, I decided to use amazon web services, or AWS.<\/p>\n<p>I logged into<\/p>\n<p><a href=\"http:\/\/www.aws.amazon.com\/free\">http:\/\/www.aws.amazon.com\/free<\/a><\/p>\n<p>After selecting the free tier, I went though the basics, choosing basic options to maintain the free tier.<\/p>\n<p><a href=\"http:\/\/www.stonemillkids.com\/wp-content\/uploads\/2015\/06\/Step_2_Free.png\"><img loading=\"lazy\" class=\"alignnone size-medium wp-image-428\" src=\"http:\/\/www.stonemillkids.com\/wp-content\/uploads\/2015\/06\/Step_2_Free-300x187.png\" alt=\"Step_2_Free\" width=\"300\" height=\"187\" srcset=\"http:\/\/www.stonemillkids.com\/wp-content\/uploads\/2015\/06\/Step_2_Free-300x187.png 300w, http:\/\/www.stonemillkids.com\/wp-content\/uploads\/2015\/06\/Step_2_Free-1024x638.png 1024w, http:\/\/www.stonemillkids.com\/wp-content\/uploads\/2015\/06\/Step_2_Free.png 1574w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Once finished, the console was ready to go<\/p>\n<p>Once the system was up and running, the next step was to determine what to do.\u00a0 I wanted to install software, but needed to connect to the system.\u00a0 Connecting via SSH seemed logical, but I needed to create a key that I could use to connected.<\/p>\n<p>Luckily,\u00a0amazon had a good tutorial on that one.<\/p>\n<p><a href=\"https:\/\/docs.aws.amazon.com\/AWSEC2\/latest\/UserGuide\/putty.html\">https:\/\/docs.aws.amazon.com\/AWSEC2\/latest\/UserGuide\/putty.html<\/a><\/p>\n<p>I download putty,<\/p>\n<p><a href=\"http:\/\/www.chiark.greenend.org.uk\/~sgtatham\/putty\/download.html\">http:\/\/www.chiark.greenend.org.uk\/~sgtatham\/putty\/download.html<\/a><\/p>\n<p>And tried to login, but failed because I needed to use PuTTYgen to convert\u00a0the keys.\u00a0 Amazon&#8217;s page was light on instrusctions, so I found more here:<\/p>\n<p>http:\/\/the.earth.li\/~sgtatham\/putty\/0.60\/htmldoc\/Chapter8.html#pubkey-puttygen<\/p>\n<p>This allowed me to login.\u00a0 However the default user was ec2user.\u00a0\u00a0I did not have all of the permissions\u00a0I needed, so I wanted to determine how to switch to root.\u00a0 After some googling:<\/p>\n<pre>$sudo su -\r\n<\/pre>\n<p>will create a root console.<\/p>\n<p>Now that I was able to do that.\u00a0 I started looking at how to install WordPress.<\/p>\n<h3>Installing WordPress<\/h3>\n<p><a href=\"https:\/\/wordpress.org\">https:\/\/wordpress.org<\/a><\/p>\n<p>The first time I installed wordpress, I did it by downloading and installing the .zip files. \u00a0This worked, but I am editing the post to include using a package manager.<\/p>\n<p>This is the best <a href=\"http:\/\/ahmed.amayem.com\/installing-wordpress-step-1a-installing-the-wordpress-directory-using-yum-on-linux-centos-6\/\">link<\/a> I found using the package manager. \u00a0The biggest thing was finding a Linux distribution that is compatible with AWS, then getting the rpm from that directory.<\/p>\n<p>The biggest key is the following instructions:<\/p>\n<pre id=\"pre-2\">$ sudo yum-config-manager --enable epel<\/pre>\n<p>The first command enables the repository.\u00a0 If that does not work, then you have to manually add the repository<\/p>\n<p>If that does not work, then you can could also add the repository manually to<\/p>\n<p class=\"p1\"><span class=\"s1\">vi \/etc\/yum.repos.d\/epel.repo <\/span><\/p>\n<p>Install the rpm repository for fedoria. Keep in mind your\u00a0architecture may be different.\u00a0\u00a0<a href=\"http:\/\/dl.fedoraproject.org\/pub\/epel\/\">http:\/\/dl.fedoraproject.org\/pub\/epel\/<\/a>\u00a0has all the options. \u00a0 If you have trouble, you can also check out this link directly from Fedora:<\/p>\n<p><a href=\"https:\/\/fedoraproject.org\/wiki\/EPEL\/FAQ#How_can_I_install_the_packages_from_the_EPEL_software_repository.3F\">https:\/\/fedoraproject.org\/wiki\/EPEL\/FAQ#How_can_I_install_the_packages_from_the_EPEL_software_repository.3F<\/a><br \/>\nOnce the repository has been added , you simply type:<\/p>\n<pre class=\"prettyprint prettyprinted\">$sudo yum install wordpress\r\n<\/pre>\n<p>Once this is installed, you want to know where it is located.<\/p>\n<pre>$sudo rpm -ql<\/pre>\n<p>This told me the location for wordpress was in \/usr\/share\/wordpress.<\/p>\n<p>The default directory for apache was \/var\/www\/html.\u00a0 I needed to change that to \/var\/www\/html\/wordpress.\u00a0 I first created a sym link to the new wordpress directory<\/p>\n<pre>#sudo ln -s \/usr\/share\/wordpress \/var\/www\/html\/wordpress<\/pre>\n<p>Then I edited the \/etc\/httpd\/conf\/httpd.conf and changed the Document Root to the new folder<\/p>\n<pre>#\r\n# DocumentRoot: The directory out of which you will serve your\r\n# documents. By default, all requests are taken from this directory, but\r\n# symbolic links and aliases may be used to point to other locations.\r\n#\r\nDocumentRoot \"\/var\/www\/html\/<strong>wordpress<\/strong>\"<\/pre>\n<h3 class=\"prettyprint prettyprinted\">Installing wordpress with a zip.<\/h3>\n<p class=\"prettyprint prettyprinted\">Below are two links that describe how to install wordpress with the zip directly from a zip. \u00a0Again, I would suggest the package manager, but since I had this document, I left the information.<\/p>\n<p><a href=\"http:\/\/blog.adlibre.org\/2010\/03\/10\/how-to-install-wordpress-on-centos-5-in-five-minutes-flat\/\">http:\/\/blog.adlibre.org\/2010\/03\/10\/how-to-install-wordpress-on-centos-5-in-five-minutes-flat\/<\/a><\/p>\n<p><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-wordpress-on-centos-6--2\">https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-wordpress-on-centos-6&#8211;2<\/a><\/p>\n<h3>MySQL<\/h3>\n<p>I ran into a couple of issues creating custom databases in MySQL&#8230; or so I thought.\u00a0 I was running into the apache service not be modifiable.\u00a0 Editing the httpd.conf fixed that.<\/p>\n<pre>$vi \/etc\/httpd\/conf\/httpd.conf\r\n\r\n&lt;Directory \/&gt;\r\nOptions FollowSymLinks\r\nAllowOverride All\r\n&lt;\/Directory&gt;\r\n<\/pre>\n<p>WordPress was still not working, so more googling uncovered that I had missed the installing php-gd and a restart of httpd helped<\/p>\n<pre>$yum install php-gd\r\n$service httpd restart\r\n<\/pre>\n<p>However, I was still unable to get a webpage up.\u00a0 The next idea was look a MySQL.\u00a0 I decided to look at the user manual to\u00a0 create a custom user for my site (check out the next 2URLs before proceeding:<\/p>\n<p><a href=\"http:\/\/dev.mysql.com\/doc\/refman\/5.5\/en\/adding- users.html\">http:\/\/dev.mysql.com\/doc\/refman\/5.5\/en\/adding-users.html<\/a><\/p>\n<pre>$mysql -u root -p\r\n<\/pre>\n<p>Create a wordpress database:<\/p>\n<pre>MySQL&gt; CREATE DATABASE wordpress;\r\nQuery OK, 1 row affected (0.00 sec)<\/pre>\n<p>Create the new user and password:<\/p>\n<pre>MySQL&gt;CREATE USER 'monty'@'localhost' IDENTIFIED BY 'some_pass';\r\n<\/pre>\n<p>Give the user correct privileges to just the wordpress database:<\/p>\n<pre>MySQL&gt; GRANT ALL PRIVILEGES ON wordpress.* TO wordpressuser@localhost IDENTIFIED BY 'password';\r\nQuery OK, 0 rows affected (0.00 sec)\r\n<\/pre>\n<p>Tell MySQL to reload:<\/p>\n<pre>MySQL&gt; FLUSH PRIVILEGES;\r\nQuery OK, 0 rows affected (0.00 sec)<\/pre>\n<p>Exit out of MySQL:<\/p>\n<pre>MySQL&gt; exit\r\n<\/pre>\n<p><a href=\"https:\/\/codex.wordpress.org\/Installing_WordPress\">Following the 5 minute WordPress install<\/a>, I was able to get the basic website up.<\/p>\n<p><a href=\"http:\/\/www.stonemillkids.com\/wp-content\/uploads\/2015\/06\/002-001_First_Post.png\"><img loading=\"lazy\" class=\"alignnone size-medium wp-image-326\" src=\"http:\/\/www.stonemillkids.com\/wp-content\/uploads\/2015\/06\/002-001_First_Post-300x138.png\" alt=\"002-001_First_Post\" width=\"300\" height=\"138\" srcset=\"http:\/\/www.stonemillkids.com\/wp-content\/uploads\/2015\/06\/002-001_First_Post-300x138.png 300w, http:\/\/www.stonemillkids.com\/wp-content\/uploads\/2015\/06\/002-001_First_Post.png 986w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Once that was ready, I now needed to upload files my custom files, themes, etc. to my new wordpress site.\u00a0 Unfortunately, AWS did not allow me to place the files directly where the needed to go using the browser on my local PC.\u00a0 That means I needed another solution to transfer files to my AWS server.<\/p>\n<p>Back to the amazon website, and found this article:<\/p>\n<p><a href=\"http:\/\/codex.wordpress.org\/Using_Themes#Selecting_the_Active_Theme\">http:\/\/codex.wordpress.org\/Using_Themes#Selecting_the_Active_Theme<\/a><\/p>\n<p style=\"text-align: left;\">&#8230; and this set of text:<\/p>\n<p style=\"text-align: center;\">Using an <a title=\"FTP Clients\" href=\"http:\/\/codex.wordpress.org\/FTP_Clients\"><span style=\"text-decoration: underline;\"><span style=\"color: #0066cc;\">FTP client<\/span><\/span><\/a> to access your host web server, create a directory to save your Theme in the <tt><span style=\"font-size: medium;\">wp-content\/themes<\/span><\/tt> directory provided by WordPress. For example, a Theme named <b>Test<\/b> should be in <tt><span style=\"font-size: medium;\">wp-content\/themes\/test<\/span><\/tt>.<\/p>\n<p style=\"text-align: left;\">Now the theme can be changed:<\/p>\n<p style=\"text-align: left;\"><a href=\"http:\/\/www.stonemillkids.com\/wp-content\/uploads\/2015\/06\/002-002_Starting_Page.png\"><img loading=\"lazy\" class=\"alignnone size-medium wp-image-325\" src=\"http:\/\/www.stonemillkids.com\/wp-content\/uploads\/2015\/06\/002-002_Starting_Page-300x187.png\" alt=\"002-002_Starting_Page\" width=\"300\" height=\"187\" srcset=\"http:\/\/www.stonemillkids.com\/wp-content\/uploads\/2015\/06\/002-002_Starting_Page-300x187.png 300w, http:\/\/www.stonemillkids.com\/wp-content\/uploads\/2015\/06\/002-002_Starting_Page.png 582w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p style=\"text-align: left;\">And I was ready to start this blog.\u00a0 The whole item took me less that one evening of work in between dinner and kids.\u00a0\u00a0\u00a0 Kudos to AWS and WordPress for making this so easy.<\/p>\n<h3 style=\"text-align: left;\"><strong>Other Links<\/strong><\/h3>\n<p style=\"text-align: left;\">I also found another good link on the Amazon Web Site for more information:<\/p>\n<p><a href=\"http:\/\/ec2-downloads.s3.amazonaws.com\/AmazonLinuxAMIUserGuide.pdf\">http:\/\/ec2-downloads.s3.amazonaws.com\/AmazonLinuxAMIUserGuide.pdf<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have been thinking for a long time about creating website.\u00a0 A launching point of sorts, for whatever I want to do next. After doing some research, I decided to use amazon web services, or AWS. I logged into http:\/\/www.aws.amazon.com\/free After selecting the free tier, I went though the basics, choosing basic options to maintain [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":421,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[18,4,17],"tags":[25,24,54,32],"_links":{"self":[{"href":"http:\/\/www.stonemillkids.com\/index.php\/wp-json\/wp\/v2\/posts\/684"}],"collection":[{"href":"http:\/\/www.stonemillkids.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.stonemillkids.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.stonemillkids.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.stonemillkids.com\/index.php\/wp-json\/wp\/v2\/comments?post=684"}],"version-history":[{"count":6,"href":"http:\/\/www.stonemillkids.com\/index.php\/wp-json\/wp\/v2\/posts\/684\/revisions"}],"predecessor-version":[{"id":923,"href":"http:\/\/www.stonemillkids.com\/index.php\/wp-json\/wp\/v2\/posts\/684\/revisions\/923"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.stonemillkids.com\/index.php\/wp-json\/wp\/v2\/media\/421"}],"wp:attachment":[{"href":"http:\/\/www.stonemillkids.com\/index.php\/wp-json\/wp\/v2\/media?parent=684"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.stonemillkids.com\/index.php\/wp-json\/wp\/v2\/categories?post=684"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.stonemillkids.com\/index.php\/wp-json\/wp\/v2\/tags?post=684"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}