Prepare Linux Box Freshly

Wasin Thonkaew - Nov 21, 2018

This post is more or less a note for myself whenever I need to freshly prepare (thus include installation) softwares on Linux box. Most of the time I work with unmanaged VPS box which doesn't have any restoring from snapshot feature. Thus we start off fresh, really fresh.

The list of stuff I need to prepare on Linux box freshly is as follows

Postgres DB

It's very efficient to also set user, and password in environment variables so you don't have to login as posgres user then enter password every single time.
Set the following two environment variables in your ~/.bash_profile or ~/.bash_aliases.

export PGUSER=postgres
export PGPASSWORD=<your password>

nghttp2

This is a dependency that required by curl and nginx later to make it supports http2 protocol.

Install it by apt install nghttp2 libnghttp2-dev libssl-dev.

brotli

This is a dependency that required by curl and nginx later to make it supports brotli compression algorithm.

Checkout latest release version (as of now of this post) or check latest version on its github page. Then execute git checkout curl-7_62_0.

Then ./configure --with-nghttp2 --prefix=/usr/local --with-ssl --with-brotli --with-zlib which is what I need, you may need to consult other options with ./configure --help and might need to install some more dependencies, just follow what shown on screen.

What we need to do is to get default compile arguments from nginx. The trick I use is to firstly install nginx from apt install nginx, then execute nginx -V to get configure arguments. Copy it somewhere then we use these combine with --add-module=/usr/local/src/ngx_brotli appending at the end to build nginx with brotli support.

By now, we should have no worry about http2 support. But for safety, just check result from nginx -V whether it has --with-http_v2_module or not. If not, then you need to make nginx support it first in which I don't include such guide in this post though.

I blog about projects I'm working on. Mostly about mobile games, tech, web service, little tiny things I built for myself or for public, and tech/game industry-wide. Currently I'm living in Shenzhen, China. I'm running a small creative company with my girlfriend here.