[How to]Install Nginx on Linux Centos 6.5 / 6.6

nginx_200

When this tutorial written, latest stable version of nginx is 1.6.2, and the latest nginx mainline version is 1.7.10. But, when it comes to centos, “If it ain’t broke, don’t fix it“, so I choose a stable one. Here is the code.

yum update -y
sudo rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
cd /etc/yum.repos.d
curl -O http://rpms.famillecollet.com/enterprise/remi.repo

touch /etc/yum.repos.d/nginx.repo
echo "[nginx]" >> /etc/yum.repos.d/nginx.repo
echo "name=nginx repo" >> /etc/yum.repos.d/nginx.repo
echo "baseurl=http://nginx.org/packages/centos/6/\$basearch/" >> /etc/yum.repos.d/nginx.repo
echo "gpgcheck=0" >> /etc/yum.repos.d/nginx.repo
echo "enabled=1" >> /etc/yum.repos.d/nginx.repo

yum install -y nginx
service nginx restart

To make sure it’s installed :

..[$] <()> netstat -ntpl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name
tcp        0      0 0.0.0.0:8013                0.0.0.0:*                   LISTEN      13063/nginx
tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      13063/nginx
.....

Right now I implement on Digitalocean (it has referral link) because it’s fast and easy to deploy, my favorite feature is snapshot. I usually using the smallest one ($5 / month), when it goes well in the smallest one, it will be better on the bigger one.

Markdown [Snippet] Simple and easy beautiful markdown output

Everybody like markdown, it’s easy and beautiful. But the output of markdown syntax just plain html, how to make it better?

Yeah, that is my question. I don’t want to install anything beside markdown. So it’s back to basic.

Here is the step (do it in your console for first step) :

git clone https://gist.github.com/6878245.git
mv 6878245/head.html . && rm 6878245/ -rf
markdown yourmarkdown.md > body.html
git clone https://gist.github.com/6878289.git
mv 6878289/tail.html . && rm 6878289/ -rf
cat head.html body.html tail.html > index.html

Here is the second step when you edit your markdown file, and compile & combine it again :

git clone https://gist.github.com/6878094.git
mv 6878094/combine_md.sh . && chmod u+x combine_md.sh && rm 6878094/ -rf

After You got the snippet from My gists :

vim index.md
./combine_md.sh

and voila, your markdown is better now.