Install Nginx PHP MySQL Python Flask on Amazon EC2 Linux AMI

Assumptions:

  • you have a brand new EC2 instance running Amazon Linux AMI
  • your time zone is America/Chicago

Install Nginx PHP-FPM and MySQL

optional

update 2018-01-31: The first line of the following snippet can be skipped as AMI now has built-in epel 6.8.9 installed as of today

sudo /bin/rpm -ivh http://ftp.uninett.no/linux/epel/6/i386/epel-release-6-8.noarch.rpm
sudo /bin/rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
sudo /bin/rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm

install nginx php mysql memcached memcache

sudo yum -y update
sudo ln -sf /usr/share/zoneinfo/America/Chicago /etc/localtime
sudo yum install -y gcc make nginx php-fpm php-devel php-mysql php-pdo php-pear php-mbstring php-cli php-odbc php-imap php-gd php-xml php-soap php-pecl-apc pcre-devel memcached php-pecl-memcached openssl-devel mysql-server mysql

sudo pecl install memcache

# auto start nginx php mysql memcached
sudo chkconfig nginx on
sudo chkconfig mysqld on
sudo chkconfig php-fpm on
sudo chkconfig memcached on

LaTeX Support for Jekyll Blog

When I was writing , I decided to use \(\LaTeX\) to write some formulae.

After googling jekyll latex support, I found this article. It took me to another blog post by a high school student from Boston, which provided a nice tutorial that adds LaTeX support on Jekyll blogs by using some tricks to let MathJax, an open source JavaSrcipt display engine for mathematics, work properly in Jekyll environment.