Create an aligned partition

An aligned partition gives you the best read/write performance, but you will have to sacrifice some space to align your partition.

To create,

# parted -a optimal /dev/sda mkpart primary 0% 100%

And you can check if it is aligned,

# parted /dev/sda align-check optimal 1

NGINX HTTP Basic Authentication with LDAP

First,  install libpam-ldap

# apt-get install libpam-ldap

Config ldap:// properly. This will add ldap backend to PAM.

Now, create a file /etc/pam.d/nginx

@include common-auth
@include common-account

This will add nginx service in PAM.

Then, config your nginx to enable HTTP basic authentication using auth_pam and PAM service name “nginx”

location /someplace {
  auth_pam "Restricted Area";
  auth_pam_service_name nginx;
}

Restart nginx. Done.