This site is based on WordPress, a free and open–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 online identification document issued by CAs (Certificate Authority). 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 & WoSign because they are blacklisted by major browsers (read here).
Once your website certificate and its associated private key are downloaded. You can follow this article to set it up.
For those who have no prior knowledge of certificates. I hope the following quick recap of the major concepts can help:
- Certificate – public ID document, usually with a file extension of .pem or .crt.
- Key – the secret file you keep to yourself. A certificate and its key form an inseparable pair.
- CSR – 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 common name which should be your domain name. You create CSR with a command line similar to mine:
openssl req -new -newkey rsa:2048 -nodes -keyout xiaohaionline.com.key -out xiaohaionline.com.csr
- 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.
Another note is about WordPress 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:
Please note I am running:
Commands might differ if you use different OS versions.
I recently (September 2018) moved the server from RHEL to Linux (Amazon AMI). The Amazon AMI’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.
sudo yum remove php httpd php-cli php-xml php-common httpd-tools
sudo yum install httpd24
sudo 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
sudo yum install mod24_ssl
sudo service httpd restart
