{"id":1,"date":"2017-07-03T06:24:44","date_gmt":"2017-07-03T06:24:44","guid":{"rendered":"http:\/\/xiaohaionline.com\/?p=1"},"modified":"2018-09-10T01:14:46","modified_gmt":"2018-09-10T01:14:46","slug":"starting-point","status":"publish","type":"post","link":"https:\/\/xiaohaionline.com\/index.php\/2017\/07\/03\/starting-point\/","title":{"rendered":"How to create a site similar to this"},"content":{"rendered":"<p>This site is based on\u00a0<a href=\"https:\/\/wordpress.org\"><b>WordPress<\/b><\/a>, a free and <b>open<\/b>&#8211;<b>source<\/b> content management system (CMS) based on PHP and MySQL. Most steps can be found from this well written article: <i><a href=\"http:\/\/coenraets.org\/blog\/2012\/01\/setting-up-wordpress-on-amazon-ec2-in-5-minutes\/\">Setting Up WordPress on Amazon EC2 in 5 minutes<\/a><\/i>.<\/p>\n<p>It is always a good idea to setup a SSL certificate for your site. SSL certificate is an online identification document issued by CAs (<i>Certificate Authority<\/i>). There are many CA vendors to choose from. I bought from register.com with an annual cost of around $27. You should stay away from StartCom &amp; WoSign because they are blacklisted by major browsers (read <a href=\"https:\/\/blog.mozilla.org\/security\/2016\/10\/24\/distrusting-new-wosign-and-startcom-certificates\/\">here<\/a>).<\/p>\n<p><!--more-->Once your website certificate and its associated private key are downloaded. You can follow this <a href=\"https:\/\/access.redhat.com\/documentation\/en-US\/Red_Hat_Enterprise_Linux\/5\/html\/Deployment_Guide\/s1-use-new-key.html\">article<\/a> to set it up.<\/p>\n<p>For those who have no prior knowledge of certificates. I hope the following quick recap of the major concepts can help:<\/p>\n<ul>\n<li>Certificate &#8211; public ID document, usually with a file extension of .pem or .crt.<\/li>\n<li>Key &#8211; the secret file you keep to yourself. A certificate and its key form an inseparable pair.<\/li>\n<li>CSR &#8211; certificate signing request, i.e. a request signed by YOU and sent to CA, providing basic identification information. One important piece of information is the <i>common name<\/i> which should be your domain name. You create CSR with a command line similar to mine:\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;width:435px;\"><div class=\"text codecolorer\">openssl req -new -newkey rsa:2048 -nodes -keyout xiaohaionline.com.key -out xiaohaionline.com.csr<\/div><\/div>\n<\/li>\n<li>You submit the content of your CSR file through a webpage to your CA, and after verification of some basic information your CA should issue you the certificate for you to use.<\/li>\n<\/ul>\n<p>Another note is about \u00a0<a href=\"https:\/\/wordpress.org\"><b>WordPress<\/b><\/a> itself: if you want your installation to work for installing new themes or auto upgrading the software, you need to make the apache user account the owner of the \/var\/www\/html\/ folder. You can use the following commands:<\/p>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;width:435px;\"><div class=\"text codecolorer\">sudo chown -R apache:apache \/var\/www\/html\/<\/div><\/div>\n<p>Please note I am running:<\/p>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;width:435px;\"><div class=\"text codecolorer\">Red Hat Enterprise Linux Server release 7.3 (Maipo)<\/div><\/div>\n<p>Commands might differ if you use different OS versions.<\/p>\n<p>I recently (September 2018) moved the server from RHEL to Linux (Amazon AMI). The Amazon AMI&#8217;s default installation instructions installs PHP 5.3 which is not compatible with some recent plugins (e.g. mathjax-latex in my case). I decided to upgrade to PHP 5.5. The following commands were used for that purpose.<\/p>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;width:435px;\"><div class=\"text codecolorer\">sudo yum update -y<br \/>\nsudo yum remove php httpd php-cli php-xml php-common httpd-tools<br \/>\nsudo yum install httpd24<br \/>\nsudo yum install php55 php55-devel php55-common php55-cli php55-pecl-apc php55-pdo php55-mysql php55-xml php55-gd php55-mbstring php-pear php55-mysqlnd php55-mcrypt<br \/>\nsudo yum install mod24_ssl<br \/>\nsudo service httpd restart<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>This site is based on\u00a0WordPress, a free and open&#8211;source content management system (CMS) based on PHP and MySQL. Most steps can be found from this well written article: Setting Up WordPress on Amazon EC2 in 5 minutes. It is always a good idea to setup a SSL certificate for your site. SSL certificate is an [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[25,24,26,23],"class_list":["post-1","post","type-post","status-publish","format-standard","hentry","category-software","tag-apache","tag-php","tag-web-site","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/xiaohaionline.com\/index.php\/wp-json\/wp\/v2\/posts\/1","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xiaohaionline.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xiaohaionline.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xiaohaionline.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xiaohaionline.com\/index.php\/wp-json\/wp\/v2\/comments?post=1"}],"version-history":[{"count":18,"href":"https:\/\/xiaohaionline.com\/index.php\/wp-json\/wp\/v2\/posts\/1\/revisions"}],"predecessor-version":[{"id":273,"href":"https:\/\/xiaohaionline.com\/index.php\/wp-json\/wp\/v2\/posts\/1\/revisions\/273"}],"wp:attachment":[{"href":"https:\/\/xiaohaionline.com\/index.php\/wp-json\/wp\/v2\/media?parent=1"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xiaohaionline.com\/index.php\/wp-json\/wp\/v2\/categories?post=1"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xiaohaionline.com\/index.php\/wp-json\/wp\/v2\/tags?post=1"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}