How to repair grub bootloader on a dual boot machine with Windows and Linux

Grub 2 typically gets overridden when you install Windows or another Operating System. To make Linux control the boot process, you need Reinstall (Repair/Restore) Grub using a Linux Live CD. mount $ROOT_DISK /mnt mount $BOOT_DISK /mnt/boot/efi # optional for i in /dev /dev/pts /proc /sys /sys/firmware/efi/efivars /run; do sudo mount -B $i /mnt$i; done chroot /mnt grub-install $DISK update-grub don’t forget to update UUID in /mnt/etc/fstab using blkid

October 12, 2019 · 1 min · 68 words · Akhil Jalagam

Restricting Access with HTTP Basic Authentication in Apache and Nginx

You can restrict access to your website or some parts of it by implementing a username/password authentication. Usernames and passwords are taken from a file created and populated by a password file creation tool, for example, apache2-utils. Creating a Password File Create additional user-password pairs. Omit the -c flag because the file already exists Nginx configuration location /public/ { auth_basic off; } } Apache/httpd basic configuration <Directory "/var/www/html"> AuthType Basic AuthName "Restricted Content" AuthUserFile /etc/httpd/....

October 12, 2019 · 1 min · 95 words · Akhil Jalagam

IP based restriction using Nginx

You can restrict access to certain parts of your website using Nginx’s inbuilt authentication and authorization mechanism based either on your client’s I.P, by prompting for a login prompt or both. A sample I.P. based authorization configuration would be like:

October 12, 2019 · 1 min · 40 words · Akhil Jalagam

Use NGINX as a Reverse Proxy

A reverse proxy is a server that sits between internal applications and external clients, forwarding client requests to the appropriate server. While many common applications, such as Node.js, are able to function as servers on their own, NGINX has a number of advanced load balancing, security, and acceleration features that most specialized applications lack. Using NGINX as a reverse proxy enables you to add these features to any application. Basic Configuration for an NGINX Reverse Proxy server_name example....

October 12, 2019 · 1 min · 99 words · Akhil Jalagam

How to Redirect www URL to non-www and non-www URL to www with Nginx

This tutorial will show you how to redirect a www URL to non-www, e.g. www.example.com to example.com, with Nginx. We will also show you how to redirect in the other direction, from a non-www URL to www. Configure DNS Records In order to set up the desired redirect, www.example.com to example.com or vice versa, you must have an A record for each name. Option 1: Redirect www to non-www Option 2: Redirect non-www to www

October 12, 2019 · 1 min · 75 words · Akhil Jalagam