Assigning SSL using Let’s Encrypt to Websites Running in LXCs

Budhajeewa's Blog
Let’s Encrypt is a great service that provide SSL Certificates free of charge. It intends to make more data transferred through the WWW secure. This assumes websites running in LXCs, to which HTTP requests are reverse proxyed to using NGINX, as described in Hosting Multiple Applications in a Server, with Linux Containers (LXC). Install the Let’s Encrypt Certificate Generator sudo apt install letsencrypt Stop ...

Hosting Multiple Applications in a Server, with Linux Containers (LXC)

Budhajeewa's Blog
Using Linux Containers (LXC) is a good way to host multiple applications in a single server with separation of resources and applications. You may think that running several Linux Containers and multiple instances of same service is very resource heavy. But I currently have 3 LXCs running in a VPS with only 512 MB RAM! I prefer to run all ...

Set up SSH Access into LXCs

Budhajeewa's Blog
By default, it’s not possible to SSH into LXCs from outside, but we can accomplish that by setting up a SSH server in LXC and some port forwarding magic. Setup SSH Server in LXC We assume that the internal IP address of your LXC is 10.0.3.2 (See Assign Static Internal IP Addresses to LXC.). Log in to the LXC from the host ...

How to Auto Start LXCs when Host Starts

Budhajeewa's Blog
LXCs don’t normally auto start when the host server starts. We have to manually configure them to auto start. Go to the LXC directory from your host server. All LXCs are stored in the /var/lib/lxc/ directory of the host, and all LXCs have a directory with their name inside that directory. So, if the name of your LXC is com-budhajeewa, that LXC’s ...

How to Point a Domain to LXC using NGINX in Host

Budhajeewa's Blog
If you have a website or a web application in a LXC, you need a way to let people access it. We can do it by assigning a domain to the LXC. This requires NGINX to be installed in your host server. Imagine the static IP of your LXC is 10.0.3.2 (See Assign Static Internal IP Addresses to LXC.) and you need ...

Assign Static Internal IP Addresses to LXC

Budhajeewa's Blog
LXC assigns random internal IP addresses to Containers by default. But it can be hard to refer to them that way. A good practice is to set static IPs. Imagine your LXC’s name is my-lxc. We have to open the network interfaces file and make some modifications to it. You can do this from inside the LXC by attaching (lxc-attach ...

How to Create Linux Containers in Ubuntu

Budhajeewa's Blog
Here’s how to do it: This is the command: lxc-create -t download -n [New LXC Name] -- --dist [Distribution Name] --release [Release Name] --arch [Architecture] Explanation: New LXC Name is the name that you wish to call your new Linux container. I usually name my LXCs using Reverse Domain Name Notation of the domain I wish to use for that ...

Host Laravel in Apache Shared Hosting

Budhajeewa's Blog
Want to host a Laravel application in a shared hosting server, but can’t figure out how to point the domain to the public directory?Put the following in a .htaccess file in the project root which is probably the public_html directory. RewriteEngine on RewriteCond %{HTTP_HOST} ^domain-name.com$ [NC,OR] RewriteCond %{HTTP_HOST} ^www.domain-name.com$ RewriteCond %{REQUEST_URI} !public/ RewriteRule (.*) /public/$1 [L] The post Host Laravel ...

Host Laravel in Apache Shared Hosting

Budhajeewa's Blog
Want to host a Laravel application in a shared hosting server, but can’t figure out how to point the domain to the public directory?Put the following in a .htaccess file in the project root which is probably the public_html directory. RewriteEngine on RewriteCond %{HTTP_HOST} ^domain-name.com$ [NC,OR] RewriteCond %{HTTP_HOST} ^www.domain-name.com$ RewriteCond %{REQUEST_URI} !public/ RewriteRule (.*) /public/$1 [L] The post Host Laravel ...

Fix Ubuntu Locales Error

Budhajeewa's Blog
Just installed Ubuntu, ran apt-get update and apt-get upgrade to encounter a “perl: warning: Setting locale failed.” error? Run sudo locale-gen en_US en_US.UTF-8 xx_YY xx_YY.UTF-8 sudo dpkg-reconfigure locales “xx_YY” should be the locale that the system reports missing. For me, it’s usually “si_LK”. Missing “si_LK” happens even when I create a DigitalOcean droplet. May be the OS uses my IP’s ...

Fix Ubuntu Locales Error

Budhajeewa's Blog
Just installed Ubuntu, ran apt-get update and apt-get upgrade to encounter a “perl: warning: Setting locale failed.” error? Run sudo locale-gen en_US en_US.UTF-8 si_LK si_LK.UTF-8 sudo dpkg-reconfigure locales “si_LK” should be the locale that the system reports missing. For me, it’s usually “si_LK”. Missing “si_LK” happens even when I create a DigitalOcean droplet. May be the OS uses my IP’s ...

“npm start” Doesn’t Work?

Budhajeewa's Blog
If you just cloned a project that uses npm start to compile and run itself, and it doesn’t run, but throws an error about lite-server (Or something like that), being not available, try installing following NodeJS packages globally. npm install -g concurrently lite-server typescript And then open /etc/sysctl.conf as root and paste following line into it. fs.inotify.max_user_watches=524288 And then run sudo sysctl -p. ...

“npm start” Doesn’t Work?

Budhajeewa's Blog
If you just cloned a project that uses npm start to compile and run itself, and it doesn’t run, but throws an error about lite-server (Or something like that), being not available, try installing following NodeJS packages globally. npm install -g concurrently lite-server typescript And then open /etc/sysctl.conf as root and paste following line into it. fs.inotify.max_user_watches=524288 And then run sudo sysctl -p. ...

සෙංකොට්ටං: කියන තරං සුවඳ නැත

Budhajeewa's Blog
ස්පොයිලර්ස් තියෙන්න පුළුවං නිසා පොත නොකියෙව්ව කට්ටිය මේ ලිපිය නොකියව ඉන්නව නං හොඳයි. පහුගිය කාලයේ මිනිස්සු පිස්සුවෙං වගේ හොඳ කියපු පොතක් තමයි “සෙංකොට්ටං” කියන්නෙ. අන්තර්ජාලේ තැං තැං වල සිද්ද වෙච්ච කතාවල හැටියට මේක ඇවිල්ලා “පට්ට” පොතක්. වෙන පොත් මාලාවක් කියවන නිසා මේක මිලදීගෙන කියවන්න උනන්‍දුවක් නොතිබ්බට, මේ ළඟදි ඔෆිස් එකේ ලොක්කා මේක මිලදී ගත්තු නිසා සහ අඩු කාලයක් ඇතුලත ...

සෙංකොට්ටං: කියන තරං සුවඳ නැත

Budhajeewa's Blog
ස්පොයිලර්ස් තියෙන්න පුළුවං නිසා පොත නොකියෙව්ව කට්ටිය මේ ලිපිය නොකියව ඉන්නව නං හොඳයි. පහුගිය කාලයේ මිනිස්සු පිස්සුවෙං වගේ හොඳ කියපු පොතක් තමයි “සෙංකොට්ටං” කියන්නෙ. අන්තර්ජාලේ තැං තැං වල සිද්ද වෙච්ච කතාවල හැටියට මේක ඇවිල්ලා “පට්ට” පොතක්. වෙන පොත් මාලාවක් කියවන නිසා මේක මිලදීගෙන කියවන්න උනන්‍දුවක් නොතිබ්බට, මේ ළඟදි ඔෆිස් එකේ ලොක්කා මේක මිලදී ගත්තු නිසා සහ අඩු කාලයක් ඇතුලත ...

How to freely and properly store your photos in Google Drive

Budhajeewa's Blog
It has been quite a time since Google allowed us to store our photos in Google Photos for free. They recently increased the size of the photos that can be stored for free to 16 Mega Pixels. When they announced that, I decided to back up all my photos to Google Photos. The best thing about uploading photos to Google ...

How to freely and properly store your photos in Google Drive

Budhajeewa's Blog
It has been quite a time since Google allowed us to store our photos in Google Photos for free. They recently increased the size of the photos that can be stored for free to 16 Mega Pixels. When they announced that, I decided to back up all my photos to Google Photos. The best thing about uploading photos to Google ...

I installed Windows 10: It’s good, but I’ll use Ubuntu

Budhajeewa's Blog
As with many in Sri Lanka, my first OS was a pirated copy of Windows. It was a copy of Windows XP and like most, I still remember it’s product key by heart (QW4HD-DQCRG-HM64M-6GJRK-8k83T. I didn’t Google this, I swear.). I know many others who perfectly remember this exact product key. But soon after I bought my first PC, I ...

I installed Windows 10: It’s good, but I’ll use Ubuntu

Budhajeewa's Blog
As with many in Sri Lanka, my first OS was a pirated copy of Windows. It was a copy of Windows XP and like most, I still remember it’s product key by heart (QW4HD-DQCRG-HM64M-6GJRK-8k83T. I didn’t Google this, I swear.). I know many others who perfectly remember this exact product key. But soon after I bought my first PC, I ...

ජනාධිපතිවරණය 2015; එහෙනම් එකත් ඉවරයි? නෑ, තවම පටන් ගත්තා විතරයි හිටං!

Budhajeewa's Blog
දැනට හෝරා කිහිපයකට පෙර මැතිවරණ කොමසාරිස් මහින්ද දේශප්‍රිය හෙවත් “මැකෝ” විසින් පසුගිය 8 වන දින පවත්වන්නට යෙදුන ජනපතිවරණයේ නිල අවසන් ප්‍රතිඵලය ප්‍රකාශ කළා. ඒක අනුව විපක්‍ෂයේ පොදු අපේක්‍ෂක ලෙසින් තරග කළ මෛත්‍රිපාල සිරිසේන ජයග්‍රහණය කළා. මෛත්‍රිට සපෝට් කර අය සතුටු උනා, මහින්‍දට සපෝට් කළ අය මෛත්‍රිට ඡන්දෙ දීපු අයට බැන්නා. තව පැය කීපෙකිං — ඒ කියන්නෙ හවස 6 ට ...